6

I want to use a Rpi to interface with 3 atmega ics in an embedded system but the pi seems to only have one uart port. I know arduino can emulate a serial connection over two io pins, will this be possible on a pi? I plan on using a headless raspbian setup with a mono c# terminal application.

Gerharddc
  • 307
  • 1
  • 5
  • 12

2 Answers2

7

What you are referring to is called Software Serial, where bytes are bit banged and create the same effect as a serial port.

Using a normal Linux distribution the answer is, No. The reason is because bit banging required real time processing of data, otherwise the data will just be junk.

This answer at Electronics Stack shows a USB board with 4 hardware serial ports on it. Its not cheap but it will great.

You can use a multiplexer which is a cheap way to get 4 serial ports but you cannot use all 4 at the same time. You can switch between ports on demand.

You can buy a SC16IS752 that uses I2C - Which means you can add a few of these with real time data flow. It is more complicated since you have to build everything around it your self.

enter image description here

You also buy cheap USB to UART - a USB Hub and add as many as you like

enter image description here

Piotr Kula
  • 17,336
  • 6
  • 66
  • 105
2

You need to use RS485 for connecting instead of RS232. Then you can have single master (RPi) polling multiple slaves (AVRs) one after another in a loop. For this you can use MODBUS or some other similar communication protocol.

avra
  • 1,273
  • 8
  • 9