I am new to Raspberry Pi and GPIO
communication, I am going to make a program to create a communication between my laptop and raspberry via serial com. After referred some tutorial, little confused about the connection between devices.
For my purpose, should I simply connect the RX TX pin
with COM
via 2 wires? or I need to add an ADM232A
interface IC between these to make the conversion of TTY
to RS232C
.
BTW the program is using Qt serial.
-
Is there a special reason why you want to use a serial connection if there is TCP/Ip and you are building both sides?Andy– Andy2018年01月30日 09:30:02 +00:00Commented Jan 30, 2018 at 9:30
-
@Andy no special reason, just for learning and testing, accurately I want to read or write GIOP from another computer. Look like a monitor(my laptop) to make sure the program in Pi side is given the right IO.JustWe– JustWe2018年01月30日 09:37:16 +00:00Commented Jan 30, 2018 at 9:37
2 Answers 2
The Pi is 3V3 TTL (i.e. the signals are low=0V and high=3V3). RS232 is +/- 12V (i.e. the signals are low=-12V and high=12V). They do not mix. Feeding that signal into a Pi GPIO will destroy both the GPIO and the Pi.
You need to use an appropriate adapter.
It may be simpler if you use USB at the Pi end. At least you know the Pi will not be damaged by what's at the other end.
-
TTL is 5V not 3V3. Two references below, rest you can google. Allaboutcircuits SparkfunChetan Bhargava– Chetan Bhargava2018年01月30日 09:18:58 +00:00Commented Jan 30, 2018 at 9:18
-
@ChetanBhargava 3V3 TTL is a well understood and commonly used expression.joan– joan2018年01月30日 09:25:01 +00:00Commented Jan 30, 2018 at 9:25
-
please provide referencesChetan Bhargava– Chetan Bhargava2018年01月30日 09:43:17 +00:00Commented Jan 30, 2018 at 9:43
To connect your Raspberry pi to your laptop using USB to serial
Solder appropriate header to your Pi enter image description here
Get a USB to serial adapter that supports 3.3 Volt logic levels. enter image description here
Get some dupont wires
Use GPIO diagram below enter image description here
Connect your RxD GPIO Pin (GPIO15) to TxD pin of your USB to serial adapter. Connect TxD GPIO Pin (GPIO14) to RxD pin of your USB to serial adapter. Connect your USB to serial adapter ground to Raspberry Pi Ground (Pin 6 of GPIO connecter)
Use appropriate serial terminal program (depends on your OS and choice)