Sarthdave
Posts: 1
Joined: Sun Dec 18, 2016 2:26 pm

RPI3 UART Problem

Sun Dec 18, 2016 6:35 pm

Hello everyone,

I am using raspberry pi 3 (jessie). I am trying to communicate using the UART port on pins 14 and 15 of the GPIO. I followed this tutorial to use the port.
http://spellfoundry.com/2016/05/29/conf ... ding-pi-3/

However, The port get opened in minicom but when i send something (A command to write a simple '1' using python shell) it gives me nothing on the tx pin. I observed it using my oscilloscope but observed a total zero there whenever I write something to the port.
Can anyone please guide me on this matter?
Any help is much appreciated.

DirkS
Posts: 9961
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: RPI3 UART Problem

Sun Dec 18, 2016 8:43 pm

Are you using GPIO14 / GPIO15 or physical pins 14 /15?
The UART is on GPIO14/15, physical pins 8 and 10.
see http://pinout.xyz/pinout/uart

Paul_L
Posts: 46
Joined: Tue May 29, 2012 2:13 pm
Location: Campina Romania

Re: RPI3 UART Problem

Thu Dec 22, 2016 8:24 am

I am trying also to use /dev/ttyAMA0 on a raspberry pi 3 for a modbus RTU application using a 232/485 convertor hat.

The RPI3 is running Jessie with all the updates done yesterday

Code: Select all

[email protected]:~# uname -a
Linux raspberrypi 4.4.38-v7+ #938 SMP Thu Dec 15 15:22:21 GMT 2016 armv7l GNU/Linux
Since I do not need the bluetooth I have modified /boot/cmdline.txt as bellow :

Code: Select all

[email protected]:~# cat /boot/cmdline.txt
dwc_otg.lpm_enable=0  console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
dtoverlay=pi3-disable-bt
I have disabled the bluetooth port

Code: Select all

ro[email protected]:~#  systemctl disable hciuart


I have no communication on physiscal pins 8 TXD, 10 RXD and the output of gpio readall is listed bellow

Code: Select all

[email protected]:~# gpio readall
 +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
 |   2 |   8 |   SDA.1 |   IN | 1 |  3 || 4  |   |      | 5V      |     |     |
 |   3 |   9 |   SCL.1 |   IN | 1 |  5 || 6  |   |      | 0v      |     |     |
 |   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 0 | IN   | TxD     | 15  | 14  |
 |     |     |      0v |      |   |  9 || 10 | 1 | IN   | RxD     | 16  | 15  |
 |  17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 0 | IN   | GPIO. 1 | 1   | 18  |
 |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |
 |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |
 |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |
 |  10 |  12 |    MOSI |   IN | 0 | 19 || 20 |   |      | 0v      |     |     |
 |   9 |  13 |    MISO |   IN | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |
 |  11 |  14 |    SCLK |   IN | 0 | 23 || 24 | 1 | IN   | CE0     | 10  | 8   |
 |     |     |      0v |      |   | 25 || 26 | 1 | IN   | CE1     | 11  | 7   |
 |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |
 |   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |
 |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |
 |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |
 |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |
 |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |
 |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+

That can be seen thet the UART pins are inputs

When I switch them to ALT0 I can send data from UART with minicom but I can not receive anything

Please help :)

Paul

dgordon42
Posts: 764
Joined: Tue Aug 13, 2013 6:55 pm
Location: Dublin, Ireland

Re: RPI3 UART Problem

Wed Dec 28, 2016 7:55 pm

Paul_L wrote:Since I do not need the bluetooth I have modified /boot/cmdline.txt as bellow :

Code: Select all
[email protected]:~# cat /boot/cmdline.txt
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
dtoverlay=pi3-disable-bt
The "dtoverlay=pi3-disable-bt" command does not go in /boot/cmdline.txt, it goes in '/boot/config.txt'!
Remove it from '/boot/cmdline.txt'.
Be careful editing this file, it must only contain 1 line. An incorrect '/boot/cmdline.txt' file can prevent a Pi from booting.

It is not necessary to disable Bluetooth on a Pi 3B to use the serial port.
See this post for further details.

Hope this helps,
Dave.

Return to “Interfacing (DSI, CSI, I2C, etc.)”