Skip to content

Part of ASM code for AVR32DD20 #402

Answered by SpenceKonde
X0NARU asked this question in Q&A
Discussion options

You must be logged in to vote

the _SFR_TO_IO_ADDR() macro is meaningless on modern AVRs, the address of SFRs in the I/O space is identical to the address in data space.

The registers you need to use are the VPORT registers - VPORTx.OUT and VPORTx.DIR instead of PORTx and DDRx (PORTx is now the name of the full PORT structure in the extended I/O space (specifically, they start at 0x0400 and each one is 32 bytes long: DIR DIRSET DIRCLR DIRTGL, OUT OUTSET, OUTCLR, OUTTGL, IN, INTFLAGS, PORTCTRL (for slew rate limiting), and then the 4 PINCONFIG related registers, then 1 reserved address before the PINnCTRL registers start halfway through the port, and while I did fact check that - I wrote that from memory successfully :-P).

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by X0NARU
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants