I have a USB-to-TTL serial cable (RN-SRL-FTD5V- CLR) connected between PC and Uno via a breadboard. I have cable Tx connected to Uno Rx and cable Rx connected to Uno Tx. Cable ground is connected to Uno ground. There is no cable connected to the Uno USB port. A 9VDC power supply is plugged into the Uno power jack. My script and serial monitor are running at 9600 baud. When I connect the cable to the PC the IDE gives me a USB0 serial port which I select.
When I send a byte to Uno the cable Tx LED flashes but there is no response from Uno. I used a logic probe to look at the Uno Rx interface; it is always High, even when my cable is disconnected – no pulsing. With the cable disconnected (its Tx floating) I see high frequency noise, but if I load it with a resistor to ground it goes to Low, and when I send a byte I see the expected pulsing. With the cable connected I played with resistor loads but still no pulses getting through. I also did a loopback test of Tx and Rx (as given in http://arduino.cc/forum/index.php?PHPSESSID=8e8d79345d8a71da16ee1ab52ef7c07e&topic=67509.0;wap2) and characters echoed as expected.
Shouldn't I just be able to simply hook TX to Rx directly?
Is the High state of Uno Rx the problem?
Would appreciate some help; I'm at the end of my wits.
With the cable disconnected the state of the RX pin is undefined because it's programmed to be an input.
With the cable disconnected (its Tx floating)
The cable's TX should not be floating, it should be an output and therefore it should have a defined state even unconnected. Are you sure the cable's TX/RX are labeled correctly?
I also thought the cable should have a defined output when disconnected. The Tx wire is supposed to be orange and that is what I am using. I checked all wires with the logic probe and see the same high frequency stuff. However that's when I thought to grab hold of the probe; same stuff! It looks like I'm picking up some interference that could be masking the Low state. But in the absence of the probe and a hard Low state one would think that there would be no high frequency reading; i.e. the condition I created with the resistor load and saw data pulses.
I do not have a scope. All I have is the logic probe, with three LED outputs: Hi, Lo and Blinking Pulse.
The reading I'm getting for the high frequency stuff is "Sq Wave < 1 MHz" (steady HI and Lo, and Blinking Pulse).
The reading I'm getting for the resistor loaded pulses is HI, Blinking Pulse, Lo (low state plus positive pulses).
The response I'm looking for is an LED flash when I send an 'H' . It works when using the USB A-B cable.
char val; // variable to receive data from the serial port
int ledpin = 13; // LED connected to pin 13
void setup() {
pinMode(ledpin, OUTPUT);
Serial.begin(9600); // start serial communication at 9600bps
}
void loop() {
if( Serial.available() ) // if data is available to read
{
val = Serial.read(); // read it and store it in 'val'
}
if( val == 'H' ) // if H' was received
{
digitalWrite(ledpin, HIGH); // turn ON the LED
} else {
digitalWrite(ledpin, LOW); // otherwise turn it OFF
}
delay(100); // wait 100ms for next reading
}
You are right the LED stays on in this sketch; I had played with several versions of this. In one case I did echo.
I got tired of working on this and the mess on my desk so I can't send a wiring picture. It was very simple. The cable Tx, Rx, and Gnd wires were on a header that plugged into the breadboard. Three wires plugged into the breadboard then completed the circuit into Uno Rx, Tx, and Gnd. The LED plugged into Uno pin 13 and breadboard ground through a 270 ohm resistor.
I'm new to this forum. What is the advantage of code tags over copy and paste for a simple sketch like this?
I'm new to this forum. What is the advantage of code tags over copy and paste for a simple sketch like this?
Readability and the assurance that the forum system will not modify your code. In most cases I don't even look at code not in code tags because of this.
I talked to tech support at the chip maker FTDI. He gave me a way to check the cable: download gtkterm from Ubuntu Software Center (it's actually listed as Serial Terminal); connect Tx to Rx ; send characters; if each character feeds back to the terminal (echos) then cable is OK. My cable is OK. I had already done the loopback on Uno and it was OK. So these results alerted me to examine the cable wiring. Sure enough, I had selected the wrong wire for ground when soldering to the header. That made me feel kind of stupid, but in my defense the cable documentation was poor in this respect.