bbncomms
Posts: 16
Joined: Tue Jun 26, 2012 2:43 pm

Second SIO/UART

Wed Sep 19, 2012 3:10 pm

There is a definite UART I/O available on the 26 way header.

I am interested in a second serial port without the addition of a USB to RS232 Adapter. Is anybody aware of a second UART accessible somewhere on the PI?

Serac
Posts: 124
Joined: Wed Jul 18, 2012 2:49 pm

Re: Second SIO/UART

Wed Sep 19, 2012 3:49 pm

http://elinux.org/RPi_BCM2835_GPIOs - Yes, there is a second UART, but you can not use both UART0 and UART1 at the same time as the only gpio pins accessable are gpio14 & gpio15 for TX & RX lines.

An alternative is to use the UART, I2C and SPI connections, but that really depends on how much low level code you want to write.

BTW: The UART0 works just fine straight out of the box - I use it for kernel debugging and as a general purpose text console with minicom on the desktop. Beats having to mess with ethernet :)

User avatar
TonyD
Posts: 447
Joined: Thu Sep 08, 2011 10:58 am
Location: Newcastle, UK
Contact: Website

Re: Second SIO/UART

Thu Sep 20, 2012 7:47 pm

If you don't want to use the USB, you could add a second (or more) UART by using the SPI or I2C interfaces on the expansion header. Maxim and NXP both do chips that do this. Here are some chips from Maxim:

MAX3108 Single UART
MAX3109 Dual UART
MAX14830 Quad UART

You would need to your own code but its definitely doable.
Tony

User avatar
speculatrix
Posts: 51
Joined: Thu Apr 05, 2012 8:29 am
Location: France
Contact: Website

Re: Second SIO/UART

Thu Oct 11, 2012 1:20 pm

I'm also interested in this. I'm thinking of using an RPI in place of a BeagleBone for a robotics project. The problem is that I currently use three of the BB's four UARTs! Low level coding does not sound like the kind of thing that I should be attempting ;) and while the maxim chips look interesting I was kind of hoping that there might be some kind of software-based solution. On the Arduino, for example, there is the SoftSerial library that allows you to use pretty much any two GPIO pins as a serial port. Does anyone know of anything similar for the RPi?

User avatar
TonyD
Posts: 447
Joined: Thu Sep 08, 2011 10:58 am
Location: Newcastle, UK
Contact: Website

Re: Second SIO/UART

Fri Oct 12, 2012 12:18 pm

In theory you could write a software UART for the RPi, but I think in practice it would be difficult to get good results on the RPi.

Basically, the software UART code would need to be tight loop for polling for receive characters but this would be interrupted by the OS as it schedules execution time to the rest of the programs running. So the software UART would miss data bits.

If the GPIO pins can generate interrupts it would make it a lot easier to do. As soon as the GPIO senses a change it could generate a interrupt to service receiving data character so no need to constantly poll the GPIO pin.

just some ideas ...
Tony

User avatar
speculatrix
Posts: 51
Joined: Thu Apr 05, 2012 8:29 am
Location: France
Contact: Website

Re: Second SIO/UART

Fri Oct 12, 2012 3:54 pm

Okay, I think I see the problem. I presume the BeagleBone gets around these issues at a hardware level. All this is way beyond my expertise...

Serac
Posts: 124
Joined: Wed Jul 18, 2012 2:49 pm

Re: Second SIO/UART

Fri Oct 12, 2012 8:49 pm

An alternative might be a UART board plugged in to either the SPI or i2c bus. http://www.ebay.com/itm/120966864751 could be a candidate - 3.3V if only the sample code & schematics were downloadable.

User avatar
TonyD
Posts: 447
Joined: Thu Sep 08, 2011 10:58 am
Location: Newcastle, UK
Contact: Website

Re: Second SIO/UART

Sat Oct 13, 2012 7:24 pm

Nice looking board, the SC16IS750 chip is very similar to the Maxim chips.

One possible solution to the OP second UART requirement, could be to multiplex the Raspberry Rx and Tx pins from the expansion header. This would obviously would require the RPi to be in control of the serial messages going out (and being received) so it would know when to swap the mux to the other serial port.
Tony

ameenfaraz
Posts: 1
Joined: Mon Apr 06, 2015 2:35 am

Re: Second SIO/UART

Mon Apr 06, 2015 2:38 am

Have a Look over the kickstater project i hope it may solve your problem.

https://www.kickstarter.com/projects/19 ... spberry-pi

OkiAviation
Posts: 1
Joined: Thu Oct 06, 2016 11:47 pm

Re: Second SIO/UART

Fri Oct 07, 2016 12:01 am

I am aware you specifically asked for a second UART, but since all or most answers in this regard have been given, please let me point out a possible alternative: RS-485 ...that means you share the port among your peripherals which would be daisy-chained on an RS-485 bus. The hardware implementation is quite easy (for both half- and full-duplex, though I recommend full-duplex with a pi), there are more than enough tutorials out there. The software side can be challenging, as you must properly manage your communication.

User avatar
karrika
Posts: 1071
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Second SIO/UART

Fri Oct 07, 2016 7:42 am

ameenfaraz wrote:Have a Look over the kickstater project i hope it may solve your problem.

https://www.kickstarter.com/projects/19 ... spberry-pi
According to the comments section from January.
@Erki - Shipping? Not likely. According to an earlier message, this company has been dissolved. They have run away with the money.

n67
Posts: 938
Joined: Mon Oct 30, 2017 4:55 pm

Re: Second SIO/UART

Tue Feb 27, 2018 5:17 pm

karrika wrote:
Fri Oct 07, 2016 7:42 am
ameenfaraz wrote:Have a Look over the kickstater project i hope it may solve your problem.

https://www.kickstarter.com/projects/19 ... spberry-pi
According to the comments section from January.
@Erki - Shipping? Not likely. According to an earlier message, this company has been dissolved. They have run away with the money.
Too bad, because it looked like a really cool thing - just what I was looking for.

Any ideas of alternatives?

BTW, as far as I can tell, the over-arching fact is this: The Pi (3B and 0W) has 2 UARTS, but you can only use one of them (at a time).

So, for all practical purposes, it only has one.

One of my core rules about anything: It does no good to have multiple anythings if you can't use them all at the same time.
"L'enfer, c'est les autres"

G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:

Epmu Sn!

J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!

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