What are the GPIO registers used for?

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

Thanks in advance for any information about the purpose of the GPIO registers in the XMega.

Field the chicken, ignore the ball.

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

They are there for you do whatever you like with. As the are in the very low address space they are reachable with the SBi and CBI opcodes which makes them perfect for storing bit level (boolean) variables.

In tiny/mega there used to be just three: GPIOR0, GPIOR1, GPIOR2 and only GPIOR0 was in SBI/CBI range allowing for just 8 such bit variables.

Meanwhile Xmega have LOADS of the things. In fact I'd say "too many". You don't need that many fast access variables in most programs and meanwhile you only get to use four virtual ports.. It would have been far better if Atmel had given half as many GPIOR registers and doubled the number of virtual ports to 8.

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

Ah. Thanks much.

Field the chicken, ignore the ball.