hrsmjjames
Posts: 13
Joined: Fri Jan 12, 2018 4:38 pm

Supported Hardware Flags and Baud Rate on UARTs

Wed Jul 31, 2019 7:47 am

Hi all,

A cross post from https://www.raspberrypi.org/forums/view ... 2#p1510382 as I'm not sure which area is best to post on.

Essentially:

Please forgive me if I've missed another forum post that already includes this information but I've struggled to find anything definitive.

I have a device that requires us to use a 3.3 TTL interface to it. It states in it's documentation: Baud rate – 9600 Data bytes – 8 Parity – None Stop bits - 1 Handshake – None.

I have successfully communicated with it when I use a FTDI USB to TTL Serial Cable (3.3V) but I would like to use one of the PI's UART outputs to do this.

I've gone through the stages of adding to my boot/config.txt

Code: Select all

enable_uart=1                                                                                                          
dtoverlay=pi3-disable-bt  
and if I run raspi-gpio get 14-15 I get:

Code: Select all

GPIO 14: level=1 fsel=4 alt=0 func=TXD0
GPIO 15: level=1 fsel=4 alt=0 func=RXD0
and ls -l shows

Code: Select all

lrwxrwxrwx 1 root root           7 Jul 30 17:10 serial0 -> ttyAMA0
if I use ssty i see the following:

Code: Select all

stty -F /dev/ttyAMA0
speed 9600 baud; line = 0;
-brkint -imaxbel
If I then try and set 1 stop bit

Code: Select all

stty -F /dev/ttyAMA0 9600 cs8 -parenb -cstopb -crtscts -ixon
and then call ssty again I still get:

Code: Select all

speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q;
stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc
I can see the flags set but I still can't communicate with the device, its fine however if i use my FTDI USB TTL Serial Cable.

So, is the above config possible using the on-board UARTS? Is there something else interfering with them that I might have missed?

Thanks

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26716
Joined: Sat Jul 30, 2011 7:41 pm

Re: Supported Hardware Flags and Baud Rate on UARTs

Wed Jul 31, 2019 9:01 am

Please don't cross post, it just spreads information out and make it more difficult for people to find.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

Return to “Troubleshooting”