[En-Nut-Discussion] DIO with ethernut 3.0 Rev-D
Harald Kipp
harald.kipp at egnite.de
Tue Mar 7 13:12:03 CET 2006
Hello Chris,
At 08:40 07.03.2006 +0100, you wrote:
>My goal is, to control individual pins on the expansion port by software.
Most important document is the AT91R40008 datasheet.
Here's how to control Pin 49 (P2):
outr(PIO_PER, _BV(2));
enables PIO mode.
outr(PIO_OER, _BV(2));
enables PIO output mode.
outr(PIO_SODR, _BV(2));
sets output high.
outr(PIO_CODR, _BV(2));
sets output low.
Please respect the electrical characteristics in the
datasheets. The CPU is 3.3V and should never be attached
to 5V logic.
Also check
http://www.ethernut.de/en/hardware/enut3/ports.html
for ports that might be used elsewhere.
Harald
More information about the En-Nut-Discussion
mailing list