# Connection to a USB to TTL dongle

I have a USB dongle which converts TTL UART signal from a microcontroller to USB level signal using level converter. I has six pins Vcc, GND, RTS, CTS, TXD, RXD. My microcontroller has two pins for UART which are RX and TX. my microcontroller is Atmega16L and the USB dongle is RN-SRL-PRO3V-DGL from Roving Networks.

I need to know how to connect micro to USB dongle. Is it RXD connected to RX and TXD connected to TX. or is it the other way around (RXD to TX and TXD to RX).

Any help is much appreciated. Thanks

-
In my experience the connector is labeled from the PC point of view. The RX is the PCs receive channel. A scope is a good way to see which is TX or RX. TX is being actively driven and RX will be open. –  kenny Jun 1 '12 at 1:13
yeah i had put it on the scope i found that the TX pin on the microcontroller is always high. I found that really strange. Is that normal? –  David Norman Jun 1 '12 at 1:18
@DavidNorman Write a small test code that transmits one byte (something like 0xA5) in a loop. Then, if you have configured the UART correctly, you'll see this byte on the TX pin with the oscilloscope. –  Nick Alexeev Jun 1 '12 at 1:53
I have done something similiar by using a serial Emulator. The problem is when I send something through the emulator its not detected at the TX pin of the dongle. I presume I did something wrong and now the dongle is not working. But the LEDs on the dongle still work. –  David Norman Jun 1 '12 at 2:00
This is just wording, but I wouldn't call it a "level converter" that just implies you are changing the level of the signal, but the IC is doing a lot more than that. –  Kellenjb Jun 1 '12 at 2:20

If the Dongle output is TTL and no RS232 converter IC is expected between the dongle and target controller then positive logic is usually used.
The TX line from the dongle = RX line into target will be high when idle. The dongle rx line = target tx line expects a high = +5V in idle state. Start bits are 0V and stop bits are 5V. The dongle TX line = target RX should be "stiff enough" to drive say a 1kohm load and still return say 4V+ when idle. Loading the dongle rx line with a 1k to ground or +5V should pull the line to the appropriate level.

If the Dongle output is true bipolar RS232 (+/- relative to ground) and negative logic is used then the TX line from the dongle = RX line into PC etc should be negative when idle. The RX line of the dingle = TX line of target expects a low = say -5V to -12V when idle. Start bits are positive wrt ground. Stop bits are negative wrt ground.

To make the dongle work you may need to loop back RTS to CTS.

-
so simple words. I'm getting a logic high from the TX pin in idle mode from the micro so thats normal rite? –  David Norman Jun 1 '12 at 3:55
@DavidNorman - Yes. –  Russell McMahon Jun 1 '12 at 4:24
sweet you're the man. why is this stuff so hard –  David Norman Jun 1 '12 at 5:59
Do i still need to loopback RTS to CTS on the dongle even if im using 'no hardware flow control'? –  David Norman Jun 3 '12 at 22:57
You MAY get away without joining RTS & CTS when no flow control or software flow control is used, and may not. Because: The "no hardware flow control" comment may come from a higher level and nobody may have told the hardware. ie if the whole system was designed and implemented by one competent designer then you'd expect not to have to joining them. If you cannot be sure if this is the case (but can guess with fir certainty that it's not) then joining them may be needed. [This is "so hard" because it 'grew like topsy' and the 'standard' has been rerereinterpreted thousands of times.] –  Russell McMahon Jun 4 '12 at 0:44
show 1 more comment
USB-Dongle-TXD pin is output ---> copper ---> input RXD pin of Atmega.
USB-Dongle-RXD pin is input ---< copper ---< output TXD pin of Atmega.


I checked with datasheets for Prolific and Atmega. Both chips have TXD as output and RXD as input.

-
Thanks Rocket Surgeon. I have the exact connection with the micro but still no communication. The baud rate and the settings on the micro are exactly the same as the dongle. What should i do with the RTS and CTS pins on the dongle? right now I shorted them. –  David Norman Jun 1 '12 at 2:01
Yes CTS-RTS should be shorted to each other. Do the same for DTR-DCD –  user924 Jun 1 '12 at 2:22