Hi all - new to the forum.
I'm trying to use register A for digital I/O on a Teensy++. I believe this is a Teensy++ 2.0 (the AVR is clearly an Atmel AT90US1286).
I'm setting direction register with:
DDRA = 0b00000111;
I'm trying to use A0-2 as digital outputs (A3-7 will be unused, so I'll maintain them as inputs with internal pull-up enabled). However, if I try to command the output using PORTA, the pins don't behave as expected. Sometimes they seem to go from ground to ~2.6V instead of ground to 5V, and sometimes they go from ~2.6V to 5V.
I don't have any issues with any other registers (B-E). I understand that register A can be used for analog I/O, but I don't know what to do to disable this, and make it function like any digital I/O register.
I've seen some things about connecting AVCC to VCC and AGND to GND. From what I see in schematics for the Teensy++ 2.0 and AT90USB1286, it looks like AVCC is already connected to VCC and AGND isn't available, so I don't know where to start with that. I also don't know if there's something I should be doing in code to specifically configure register A for digital I/O.
Any help is appreciated.
Thanks,
-Rob
I'm trying to use register A for digital I/O on a Teensy++. I believe this is a Teensy++ 2.0 (the AVR is clearly an Atmel AT90US1286).
I'm setting direction register with:
DDRA = 0b00000111;
I'm trying to use A0-2 as digital outputs (A3-7 will be unused, so I'll maintain them as inputs with internal pull-up enabled). However, if I try to command the output using PORTA, the pins don't behave as expected. Sometimes they seem to go from ground to ~2.6V instead of ground to 5V, and sometimes they go from ~2.6V to 5V.
I don't have any issues with any other registers (B-E). I understand that register A can be used for analog I/O, but I don't know what to do to disable this, and make it function like any digital I/O register.
I've seen some things about connecting AVCC to VCC and AGND to GND. From what I see in schematics for the Teensy++ 2.0 and AT90USB1286, it looks like AVCC is already connected to VCC and AGND isn't available, so I don't know where to start with that. I also don't know if there's something I should be doing in code to specifically configure register A for digital I/O.
Any help is appreciated.
Thanks,
-Rob