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

Supported Hardware Flags on UART0

Tue Jul 30, 2019 4:24 pm

Hi all,

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:

speed 9600 baud; line = 0;
-brkint -imaxbe


update:
I was missing the -a argumen on stty, however I can see the flags set but I still can't communicate with the device.

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

Thanks
Last edited by hrsmjjames on Wed Jul 31, 2019 7:42 am, edited 2 times in total.

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

Re: Supported Hardware Flags on UART0

Tue Jul 30, 2019 4:31 pm

I've realised I've made a rookie error that I was missing the -a argument on

Code: Select all

stty -F /dev/ttyAMA0 
so I wasn't receiving the full output however my device is still not working but its fine on the USB one.

Is there anything I could be missing that's interfering with ttyAMA0 or ttyS0?

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