Pin 1 (Serial TX) usage

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?

There was a modification of the HardwareSerial class posted recently that allowed read-only, write-only, or read-write access to the serial port pins.

Have you used all the analog pins, too. They can be used as digital pins.

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 ]

http://arduino.cc/forum/index.php/topic,125110.0.html

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.

Go read the datasheet for more details... :slight_smile:

AWOL:
http://arduino.cc/forum/index.php/topic,125110.0.html

Thank you! I'll be sure to try this.

Or look in the begin() function: the line

  sbi(*_ucsrb, _txen);

seems to be the obvious candidate. Though that's in terms of variables and #definery.