Go Down

Topic: Leonardo and serial communication cable (Read 759 times) previous topic - next topic

alexe100

Hi, (new to arduinos)

I am trying to exchange data via serial port between PC and arduino Leonardo. I know already that i must use Serial1 and not Serial because Serial is allocated for micro programming.

"The Arduino Leonardo board uses Serial1 to communicate via TTL (5V) serial on pins 0 (RX) and 1 (TX). "

The question is: should I use the same usb cable to use the Serial1 or do I need to connect another cable 
to use Serial1. which cable? db9? USB? USBtoSerial?    If I need to use another cable, could you please tell me the connections I have to setup.

Thanks a lot

Alex

spcomputing

Quote
I am trying to exchange data via serial port between PC and arduino Leonardo. I know already that i must use Serial1 and not Serial because Serial is allocated for micro programming.


Try loading the 04.Communications "ASCIITable" sketch to the Leonardo and open the Serial Monitor at 9600.  Go back to the IDE and note that you are on Serial and not Serial1.

If you connect something TTL to D0/D1, you will need to use the Serial1 in your sketch.  You PC to Leonardo will be through Serial.
http://www.spcomputing.com

James C4S

I'm not sure you understand the difference between Serial and Serial1.


not Serial because Serial is allocated for micro programming.

"Serial" is for the USB to serial "device".  This is used for programming or communicating with the PC.  If you wish to transfer data from the PC to the Leonardo without any additional hardware, you are going to be using "Serial".

"Serial1" is for communicating with another TTL serial device connected to Pins 0 and 1.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Go Up