Author Topic: Raspberry UART  (Read 3343 times)

0 Members and 1 Guest are viewing this topic.

Offline luiHSTopic starter

  • Frequent Contributor
  • **
  • Posts: 612
  • Country: es
Raspberry UART
« on: January 23, 2020, 09:24:35 am »
 
Hi.

I need to make a program for serial port communications with the Raspberry. I've been reading that the Raspberry has two UARTs; the Mini UART and the PL011.

1.- The mini UART (/dev/ttyS0) is dependent on the frequency of the core VPU, which can vary according to the processor load, and therefore could be unstable and fail.
2.- On the other hand, using the PL011 (/dev/ttyAMA0) implies having to disable Bluetooth.

What UART do you usually use with the Raspberry that is not a problem ?, is to communicate at 115200 baud with a Kinetis MK66 microcontroller, I have doubts if it is reliable to use the mini UART.

Regards
 
« Last Edit: January 23, 2020, 09:26:39 am by luiHS »
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2332
  • Country: 00
Re: Raspberry UART
« Reply #1 on: January 23, 2020, 12:12:08 pm »
You can attach a USB 232 cable on the USB port, Will be the 3rd option
 
The following users thanked this post: luiHS

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 11370
  • Country: fi
Re: Raspberry UART
« Reply #2 on: January 23, 2020, 12:17:48 pm »
On Raspi3, I have used /dev/serial0 reliably, I think the key was to set force_turbo in /boot/config.txt, which removes CPU frequency throttling, of course increasing power dissipation, but on Raspi3, this won't cause thermal issues unless you have a tight, closed box with very poor cooling.

Don't know how it's on Raspi4, though.
 
The following users thanked this post: luiHS

Offline GeorgeOfTheJungle

  • Super Contributor
  • ***
  • !
  • Posts: 2699
  • Country: tr
Re: Raspberry UART
« Reply #3 on: January 23, 2020, 12:51:30 pm »
1.- The mini UART (/dev/ttyS0) is dependent on the frequency of the core VPU, which can vary according to the processor load, and therefore could be unstable and fail.
2.- On the other hand, using the PL011 (/dev/ttyAMA0) implies having to disable Bluetooth.

Really? Wow, the list of RPi hardware issues is a never ending story. Use a good SBC, an Orange Pi PC is not only better but also cheaper.

https://www.aliexpress.com/item/32448079125.html

The further a society drifts from truth, the more it will hate those who speak it.
 
The following users thanked this post: luiHS

Offline johnkenyon

  • Regular Contributor
  • *
  • Posts: 123
  • Country: gb
Re: Raspberry UART
« Reply #4 on: January 23, 2020, 01:08:47 pm »
You could attach a UART to the I2C or SPI pins.

Do a search for a "i2c UART" and/or "SPI UART".
This yields things like the MAX3107 (single serial port with 128byte FIFO).
I'm sure I've seen single chip 4 and 8 port devices.

Another place to look is in the Linux kernel source.
Looking at /usr/src/linux/drivers/tty/serial/Kconfig revealed support (from at least 4.4.x onwards) for the following:

SERIAL_MAX310X
Supported ICs are MAX3107, MAX3108, MAX3109, MAX14830.
Each IC contains 128 words each of receive and transmit FIFO
that can be controlled through I2C or high-speed SPI."

SERIAL_SC16IS7XX
Supported ICs are SC16IS740, SC16IS741, SC16IS750, SC16IS752, SC16IS760 and SC16IS762.



 
The following users thanked this post: luiHS

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 17828
  • Country: fr
Re: Raspberry UART
« Reply #5 on: January 23, 2020, 06:45:45 pm »
You can refer to that: https://www.raspberrypi.org/documentation/configuration/uart.md
I think the RPi4 has the same limitation.

As said in the link, you can either disable BT if you don't use it, or switch BT to the mini-uart instead.
 
The following users thanked this post: luiHS

Offline luiHSTopic starter

  • Frequent Contributor
  • **
  • Posts: 612
  • Country: es
Re: Raspberry UART
« Reply #6 on: January 24, 2020, 06:10:45 am »
 

Thanks to everyone for your replies.
I've tried both options, Mini UART and PL011, and both seem to work fine. I will probably use the PL011, because at this moment I don't need Bluetooth, I can use WIFI for wireless applications.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->