SOLVED: ATXMEGA128A1 PORTA.OUT says what's input and PORTA.IN is 0

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

While testing the inputs on pins with my on-chip command line program, I connected a 3.3V point on the dev board with pin 7 of port A on the headers with a wire and the program said that PORTA.OUT is 0x81. The first pin is not connected to the board headers so I suppose it has to do with something else like voltage stability (or something. I really don't know) so when I disconnect the wire, it says 0x01. Connected or disconnected, PORTA.IN says 0.

 

My binders are written according to the datasheet (in BASCOM-AVR):

PortRegisters_Names:
Data "DIR", "DIRSET", "DIRCLR", "DIRTGL", "OUT", "OUTSET", "OUTCLR", "OUTTGL"
Data "IN", "INTCTRL", "INT0MASK", "INT1MASK", "INTFLAGS", "PIN0CTRL", "PIN1CTRL", "PIN2CTRL"
Data "PIN3CTRL", "PIN4CTRL", "PIN5CTRL", "PIN6CTRL", "PIN7CTRL", "" 'END
PortRegisters_Offsets:
Data 0%,1%,2%,3%,4%,5%,6%,7%,8%,9%,10%,11%,12%,16%,17%,18%,19%,20%,21%,22%,23%, 65535% 'END

 

It seems that the OUT register needs to be replaced with the IN register.

 

Is this a known glitch or is something damaged in the hardware?

 

Edit: The port direction is 0x00

Last Edited: Sat. Jun 6, 2015 - 12:43 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Found the problem. I had an offset in PORT addresses.