Multiplexed GPIO Pins - Which USART Pins?

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey Guys,

Have just started looking into 32-bit uControllers after being around the 8-bits for sometime now. Previoulsy with devices like the atmega644 that I used only 1 pin for each function, while there may have been multiple functions for each pin, they still only used one output/input per internal component. I started looking into the AT32UC3B0128, as such the USARTn RXD and TXD pins can be used with two pins each. I understand the reason behind it, trying to maximise the amount of components to use with as much selection as possible from the pins.

My question is, are these pins grouped, set individually, or always on when I switch component on?

E.g. If I set USART 0 into one of the modes that activate the PA18 UART0 RXD pin, am I forced to use the PA19 USART0 TXD pin or could I use the PB11 USART0 TXD pin with the PA18?

Cheers,
Ryan.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Enabling a module does not actually connect it to the outside world., the peripheral multiplexing does that via the PMR0 and PMR1 registers but GPER can override that.
If GPER is set, then the physical pin is an I/O.
If GPER is clear, then the physical pin is connected to whatever function PMR0/1 have selected.

Looking at the 'Register Reset values' in the GPIO 'Module Configuration section' of the datasheet, it says that GPER for Ports 0 & 1 is set to ones, therefore all the PAxx and PBxx pins are I/O on (re)start and the internal modules (eg USART0) are blind.

The multiplexing is not grouped, so yes, you could have USART0 RX on PA18 and USART0 TX on PB11.

I pedantically configure all pins to be either an I/O, or, not an I/O and multiplexed to an appropriate internal module based on the hardware connected to the pins.

Your question also raises an interesting issue., ie. an internal pin can be connected to several real pins.,
eg. outgoing signal USART0 TX could be multiplexed to PA19 and PB11, which might not be a problem, but if USART0 RX is multiplexed to PA18 and PB10 then that could be internally 'interesting'.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Awesome, thanks, answers my question!

Your "internally interesting" comment is actually pretty funny and would be an interesting experiment. I would imagine one of the pins takes precedence or it could be that they could be super imposed on each other!

Thanks again,

Ryan.