I've got a couple duemilanove boards that I'm trying to interface (through serial) with a wireless RF transmitter and receiver. At the same time, I'd like to be able to power the boards over USB.
However, from what I understand, the RX/TX pins are directly connected to USB via the FTDI chip. What ends up happening is: when I send data to the TX pin, it seems to end up going through USB to my computer instead. The same seems to be happening with the receiver; Serial.available() never gets any data.
Things seem to work when I tried using software serial. However, hardware serial has some advantages that might be useful, and it's just plain stupid that I can't use hardware serial when I only need one connection.
My question in a nutshell: how can I use hardware serial while using USB for power without data being diverted to USB?
The TX and RX pins are connected to the FTDI chip, which provides the mechanism to allow the Arduino to communicate with the PC.
Anything else can be connected to the TX and RX pins, too. So, there should be no problem connecting the RF transmitter to the TX pin on one Arduino and the RF receiver to the RX pin on the other Arduino.
When Serial.available() is called, it looks to see how much data is available in the serial input buffer. It does not know (or matter) whether that data arrived at the RX pin by way of the FTDI chip or the RF receiver.
When data appears on the TX pin, the FTDI chip sees it, and sends it to the serial buffer on the PC. The RF transmitter should see it, too, and get all excited, resulting in RF waves being generated.
Typically, RF transmitters and RF receivers have on-board LEDs that flash when they are sending or receiving data.
The thing to do when debugging RF issues is to concentrate on the sender, first. Make it send lots of data. 2 bytes every 5 minutes makes for a lot of waiting to see LEDs flashing.
Watch for the Arduino's TX light to flash. Verify that the RF transmitter is flashing at the same time. If the RF transmitter's LED doesn't flash, then, it's most likely a hardware issue.
When you know that the sender is sending, then you can work on making the receiver receive.
If you look at the schematic you will see that the TX & RX pins on the arduino are connected tot he USB/serial chip through 1K resistors. That means any direct connection to these pins can over ride any signal that the USB chip puts on them.
Thanks for the replies. After some experimentation, I found that only the RX pin on the receiver side is having issues; the whole thing works if I have the transmitter on hard serial and the receiver on soft serial (or both on soft). I think I'm just going to go with soft serial and steer clear of this headache.
I'm having the same exact issue with my RF transmitter/receiver project. Is there any way to get the receiver to work with the RX pin instead of using software serial?
edit: I got it to work by creating a receiving pin using SoftwareSerial. Still have no idea why the RX pin is so resistant to an "overriding" voltage.