serial comms on RPI GPIO pins

Thread Starter

Little Ghostman

Joined Jan 1, 2014
305
Hi,I think I have over googled this and ended up confused on what should be easy question!

So apologize in advance

I am almost finished with my school prelim exams project, as well as various micro's and chips it has a Raspberry Pi on it to do a certain task. I noticed that it has RS232 pins on the GPIO and this would be handy for communicating with one of the modules on the project, the other modules use the SPI bus but one in particular would be better separated and on serial.

Now having googled and googled I am unsure if the serial pins are reserved for connecting to the PI or if you can use them for communicating to other micro's or a mix?

Does anyone know if these can be used for general serial coms or are they purely for SSH etc? This is my first project with a PI and its been a bit of steep curve! I am ok with most other micro's but this has kind of stumped me
 

nsaspook

Joined Aug 27, 2009
13,081
Does anyone know if these can be used for general serial coms or are they purely for SSH etc? This is my first project with a PI and its been a bit of steep curve! I am ok with most other micro's but this has kind of stumped me
Normally the serial port is used by Linux as a terminal port but it's easy to disable that function for serial communications with a device using your own program.

Raspbian:
https://www.raspberrypi.org/documentation/configuration/raspi-config.md

http://elinux.org/RPi_Serial_Connection
 

hexreader

Joined Apr 16, 2011
581
If you are using latest Raspian GUI, then go through menus:

menu - preferences - raspberry pi configuration - interfaces

Select serial disabled, then reboot.

Note that serial port name for current NOOBS distribution is /dev/ttyAMA0

I struggled with similar problems, and many instructions on internet seem to be out of date.

You may need system privileges to use serial port - so you might need to use "sudo" in your command when running your program

Do you not sleep?
 
Last edited:

Thread Starter

Little Ghostman

Joined Jan 1, 2014
305
Thanks alot guys, I see now why there is so much conflicting advice out there. I will have a go later and try it out, while it has plenty of I/O it seems most are happy to simple put a 'hat' on and leave it to software thats already out there.

Not sleeping much at the moment as its pre lim exams! Some of my projects are.......ambitious so I have had to put the hours in!! I dont sit the real exam until later in the year, but I need a good score in the pre lims.
 

Thread Starter

Little Ghostman

Joined Jan 1, 2014
305
So far all the PI code is in python, I am more used to C on micro's, I might look into changing the code to C for the actual exam later in the year. I have nothing against python but its been a bit of a curve!
 
Top