by i-Bot » Thu Jun 18, 2009 11:30 pm
by i-Bot
Thu Jun 18, 2009 11:30 pm
The Xmega is more flexible an hence more complex tan the ATMega which I have used.
If you look at the data sheet, then the alternate function (UART) can override the GPIO, so do not enable the UART. Port PE1 is TX out on the ATMega, but not on the XMega, this would be port PE3.
Take regard to the different datasheets for XMega A, XMega128-A1, and the ATMega128
Work only with the I/O port registers. For Port E these are 32 registers located at peripheral address starting 0x0680 (datasheet section 31) and are defined in datasheet section 13.17
Assuming you work with PE1, then you must consider the DIR direction register to set PE1 as output, then use the OUT register to set and clear the bit, or alternatively use the set/clear/toggle.
Consider the setting of the PIN1CTRL for the mode you want to experiment with.
The Xmega is more flexible an hence more complex tan the ATMega which I have used.
If you look at the data sheet, then the alternate function (UART) can override the GPIO, so do not enable the UART. Port PE1 is TX out on the ATMega, but not on the XMega, this would be port PE3.
Take regard to the different datasheets for XMega A, XMega128-A1, and the ATMega128
Work only with the I/O port registers. For Port E these are 32 registers located at peripheral address starting 0x0680 (datasheet section 31) and are defined in datasheet section 13.17
Assuming you work with PE1, then you must consider the DIR direction register to set PE1 as output, then use the OUT register to set and clear the bit, or alternatively use the set/clear/toggle.
Consider the setting of the PIN1CTRL for the mode you want to experiment with.