Page 1 of 1

Second SIO/UART

Posted: Wed Sep 19, 2012 3:10 pm
by bbncomms
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?

Re: Second SIO/UART

Posted: Wed Sep 19, 2012 3:49 pm
by Serac
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 :)

Re: Second SIO/UART

Posted: Thu Sep 20, 2012 7:47 pm
by TonyD
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.

Re: Second SIO/UART

Posted: Thu Oct 11, 2012 1:20 pm
by speculatrix
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?

Re: Second SIO/UART

Posted: Fri Oct 12, 2012 12:18 pm
by TonyD
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 ...

Re: Second SIO/UART

Posted: Fri Oct 12, 2012 3:54 pm
by speculatrix
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...

Re: Second SIO/UART

Posted: Fri Oct 12, 2012 8:49 pm
by Serac
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.

Re: Second SIO/UART

Posted: Sat Oct 13, 2012 7:24 pm
by TonyD
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.

Re: Second SIO/UART

Posted: Mon Apr 06, 2015 2:38 am
by ameenfaraz
Have a Look over the kickstater project i hope it may solve your problem.

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

Re: Second SIO/UART

Posted: Fri Oct 07, 2016 12:01 am
by OkiAviation
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.

Re: Second SIO/UART

Posted: Fri Oct 07, 2016 7:42 am
by karrika
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.

Re: Second SIO/UART

Posted: Tue Feb 27, 2018 5:17 pm
by n67
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.