Forums

A million UARTs....

Started by casperPro 3 years ago9 replieslatest reply 3 years ago188 views

hello,

Am currently using the RT5350F router. This has a limited number of UARTs. If any one knows of a router that has say more than 2 uarts that will be awesome.

Also if there is any to way to multiplex multiple UART ports that will be good too. Some people suggest using an analog multiplexer. Am not certain is this will be really useful.

Any clues will be much appreciated.


Thanks



[ - ]
Reply by Tim WescottJune 3, 2017

Without knowing why you want a million UARTs on a router, I don't think anyone is going to be able to help you.

[ - ]
Reply by casperProJune 3, 2017

Apologies for using that term. It was only a metaphor. I am interested in attaching 5 separate senors to this device. Each sensor communicates using UART. So if any one has ever done some thing similar it would be helpful to have some suggestions.


Thanks.

[ - ]
Reply by Tim WescottJune 3, 2017

It sounds like your top-level problem is to attach a bunch of sensors that talk using RS-232 to Ethernet?

If you don't have any particular size or environmental constraints this sounds like a perfect job for a Raspberry Pi or Beaglebone and a bunch of serial-to-USB converters.

[ - ]
Reply by MichaelKellettJune 3, 2017

There are processors with 6 UARTs - you could use one to intelligently multiplex the RT5350's UART.

You could use a tiny (48 pin Lattice iCE5LP4k) FPGA to do the same thing.

If it's a one off you can buy little boards from China with an Altera FPGA fitted for about £10.

You could use an ST Nucleo board with a 200MHz ARM processor and bit bang 5 UARTS.

If you really need a million UARTs I think the very biggest FPGAs could do it but they don't have enough pins ;-)


MK




[ - ]
Reply by artmezJune 3, 2017

Seriously sounds like a class project. Getting "mentors" to help is fine, but you won't get far if you rely on others to do your work!

My standard admonition before trying to "code" ANY design is to make sure that all architectural details are nailed down first. The datasheet:

https://cdn.sparkfun.com/datasheets/Wireless/WiFi/...

shows that this device has only one UART and it's only a two-pin interface (data in/out). Much of this was already asked about the sensor, but:

  • what is its data rate?
  • are these sensors addressable?
  • is the sensor data provided on-demand (i.e. polled) or asynchronously (i.e. just spurts out when it has "new" data)?
  • what is its electrical interface (TTL/CMOS/RS-232)?
  • Is it REALLY a UART interface?

The last item is important since some people causally call anything with a serial interface a "UART", when it may not be, as it might be an I2S, SPI or I2C interface (also available on this part). The distinction makes a BIG difference!

So, do you have a part number and/or datasheet for the sensors? That would help us "mentors" get a better idea of what an appropriate solution would be.


[ - ]
Reply by SidKaulJune 3, 2017

Many embedded processors are limited to 1 or 2 UARTs as handling these UART puts more pressure on processor.. whos processing power itself is limited and on top of it it has to handle these many UARTS so make no sense to provide an option in embedded systesms...

When connecting to computer you have options for Serial HUB such as these shown below.

icusb23216f.main[1]_89119.jpg

When working with higher end processor architectures such as cortex you get like 3 to 5 UARTS....

The whole idea of embedded system is to try and work on a single communication bus system to reduce components and cost so having more 2 or 3 UARTs in an embedded system makes no sense where you can use more reliable and easily scalable protocols such as I2C and SPI.

[ - ]
Reply by doctekJune 3, 2017

A key question is whether the sensors that are connected will transmit whenever they want (in which case you must handle multiple channels of asynchronous input) or if they only respond when addressed (in which case you can control when you receive input and can restrict the number of inputs you have to handle).

The first case is the hardest and typically occurs when you have multiple users connected to a system or have real time response requirements. Hopefully, this is not your case. If it is, then the idea of using USB to UART dongles with a RPi or BBB is the way to go.

The second case is easier to handle with an embedded system (small microprocessor). Build or buy a uart multiplexer so you can select one sensor at a time and read it before moving to the next one. Probably a basic Arduino could handle this if the rate at which the sensors must be read is fairly low. Since the sensors use uarts, they probably are not designed for high speed data transfer.

One final question is whether the sensor uarts interface at 5V levels or use true RS-232 levels. You need to consider this when you design or specify your multiplexer.

[ - ]
Reply by OlegBelovJune 3, 2017

If the desired baud rate is not very high (19200 is OK) you can implement many software UARTs using microprocessor like ATMega, ATTiny, STM32, etc.. If your sensors are responding only to requests from the host and simultaneous receiving is not supposed, the job is very simple and a number of channels is limited only by the number of pins. Of course multichannel voltage converters are necessary if your sensors use +-3..15 voltage levels. It is a challenge to implement many software UARTs which can receive simultaneously, but it is possible too. 

[ - ]
Reply by jkvasanJune 4, 2017

Hi Casperpro,

This is not a big deal if you use a simple RS485 (simplex) or a RS422B (Duplex) hardware and related software techniques. Just connect a MAX485 to your RXD and Txd. Use a query-response code or if your sensors just dump data then use an enable pin to individually allow data to your RT350. This means you time multiplex each sensor and need only one UART at your router device.