Raspberry Pi Serial Port Uart Wiki
Ok, I have one uart interface (TXD GPIO 14, RXD GPIO 15). I want at least one more uart interface. Pokemon Hack Misty Rom here.
How to get more than one uart interface. In fact given the time it cost me I should have just got a mega with 4 serial ports. Disable Raspberry Pi UART. / Programming in C/C++ / UART Serial Port / Using the UART. Set to 115200-8-N-1 use the command line interface to the Raspberry Pi in the same way as if you we're. / Programming in C/C++ / UART Serial Port / Using the UART. Set to 115200-8-N-1 use the command line interface to the Raspberry Pi in the same way as if you we're.
Possible solutions: • Bit banging: Use two unrelated spare GPIOs. I understand that timing is a problem on a standard linux. Would it be reliable with very low baudrate? • Switching: RPI decides when to talk to which device.
• spi to 2 x uart bridge: Didn't find a suitable part (availability, price, dil package) • usb to uart: Expensive Are there other options? I'm inclined to switching, if it can be done. What would you advise? A USB UART, such as FTDI, isn't really expensive.
All your other options sound like they will cost you more in parts and time than the ~$13 it might cost you, and be unreliable or slow. Just go for the fast and trouble-free option, such as: Sparkfun sells one too. In fact, maybe you can just pull one out of some old USB device or buy one from a junk store that doesn't know what it does. I messed with an SPI to UART adapter for an Arduino project, there was no existing library so I wrote my own.
In the end it worked ok, but if I could have just dropped in a $15 part I would have. In fact given the time it cost me I should have just got a mega with 4 serial ports. Alternatively if you want lots of serial ports you could look at RS485 serial, which is similar to 232 (though not compatible), which supports multi-drop, ie several interfaces over the one line.
USB to UART bridges are cheap and readily available, but have really lousy timing characteristics. Newark sells an 'Embedded Pi' board which has an STM32F ARM processor that you can write bare-metal code on. That chip has three UARTs on it, and I think they can go pretty fast; if you were to use one to communicate with the Raspberry Pi that would leave two available for other purposes. Disclaimer: I've bought one of these boards, but have as yet simply used the Raspberry Pi itself to handle by I/O needs directly. If you want lots of slower UARTs, the STM32F on the Embedded Pi board could probably handle a fair number, especially if you're willing to write some Arm assembly language. If there are two groups of 16 I/O pins available on a single board it might be possible to have 16 simultaneous software UARTs all working at once at a pretty decent baud rate (have a periodic interrupt at 3x or 5x the baud rate which stores 16-bit latched values from the receive port to a buffer, and outputs 16-bit precomputed values from a buffer to the transmit port; if you do this, then provided the average servicing time for the software UARTs isn't too great, it won't matter if there is an occasional worst-case hit (e.g.