I'm currently working on an arduino sketch (EEPROM programmer) that receives serial data from a computer, then outputs data\address info through the I/O pins. However, I need one more I/O pin for the address bus... Since I'm only receiving data through the serial port, I was hoping that I could use pin 1 (TX) for digital I/O, but the Arduino wouldn't listen to my digitalWrite commands.
Is there any way I can use pin 1 in my project while still receiving serial data?
If you use Serial it configures the hardware UART to take over pins 0 and 1 - in this case they cannot be used with digitalWrite(). Use SoftwareSerial instead perhaps?
Alternatively look at the code in HardwareSerial.cpp and figure out what to override. [ or look the posting mentioned above ]
bob800:
I'm currently working on an arduino sketch (EEPROM programmer) that receives serial data from a computer, then outputs data\address info through the I/O pins. However, I need one more I/O pin for the address bus... Since I'm only receiving data through the serial port, I was hoping that I could use pin 1 (TX) for digital I/O, but the Arduino wouldn't listen to my digitalWrite commands.
Is there any way I can use pin 1 in my project while still receiving serial data?
The USART has priority over normal pin operations when it's enabled. You can disable the transmitter by clearing a bit in USCR0B.