1
\$\begingroup\$

I'm looking for a GPIO expander with UART interface, but I can't find a single IC. I know that this is not the place to ask for product recommendations, but I wonder why there are hundreds of GPIO expanders with I2C, SMBus, SPI, etc. interfaces, but no single chip with UART.

I want to control the GPIOs with UART.

OK, it would be easy to use a low cost MCU with UART interface and write code to support the GPIOs, but you need the skills and it is much more work and testing involved than using an out-of-the box IC.

Am I right that there are no UART IO expander IC's on the market and if yes, what is the reason for this?

\$\endgroup\$
9
  • \$\begingroup\$ Sorry, I couldn't understand. Do you want to control the expander with UART (i.e. configure using UART commands). or do you want to use the expander for UART communication (i.e. use the ports as RXD/TXD)? \$\endgroup\$ Commented May 22 at 8:21
  • \$\begingroup\$ I want to control the expander with UART \$\endgroup\$ Commented May 22 at 8:49
  • 1
    \$\begingroup\$ If there were any demand from manufacturers in the electronics industry for such an IC, then it would exist. If there were sufficient demand then there would be multiple sources - because there would be money to be made. So the answer to why this is had to come by is simply that very few people want it... \$\endgroup\$
    – brhans
    Commented May 22 at 10:41
  • 1
    \$\begingroup\$ What UART do you intend to control it from? If it's another MCU, what's the problem with programming? If it's a PC, PCs don't have UART ports any more, so you'd be using a USB-to-UART adapter, which means you might as well just do USB-to-GPIO directly. \$\endgroup\$
    – Dave Tweed
    Commented May 22 at 12:16
  • \$\begingroup\$ It‘s an embedded controller running linux and providing UART on these 2 pins. It must stay UART for other reasons. \$\endgroup\$ Commented May 22 at 14:00

1 Answer 1

4
\$\begingroup\$

I found at least one chip which can be used as UART to GPIO bridge, so your assumption is incorrect.

In reality it might be a pre-programmed MCU, but on the other hand, also many other chips you can buy are just pre-programmed MCUs, with custom logos and markings on them.

The problem with UART-based GPIO expanders is that you need two pins for communicating with it, and then you need the two devices to communicate within tolerance of the baud rate setting. That means that there cannot be more than 2..3% error in the baud rate, so you need precise enough internal or external oscillators to keep baud rates of both chips stable with varying supply voltage and temperature.

That would typically mean adding a crystal oscillator to a GPIO expander that it does not otherwise need. That uses 1 or 2 GPIO expander IC pins and adds cost.

If you have two GPIO pins, you can just use I2C. That does not require an additional clock as the transfer timing is controlled by the I2C SCL clock. This makes the GPIO expander simpler and makes both chips cheaper. And faster, as many I2C chips go up to 400 kHz or beyond that. It would be much slower and difficult to try same with UART.

\$\endgroup\$
10
  • \$\begingroup\$ Ok, now I'm curious about the one and only :-). Please share. \$\endgroup\$ Commented May 22 at 8:51
  • 3
    \$\begingroup\$ Well, that is a bit difficult, as basically you are asking which chip to buy. But you can just put "UART to GPIO bridge" to your favourite search engine and you likely find many. \$\endgroup\$
    – Justme
    Commented May 22 at 8:59
  • 1
    \$\begingroup\$ Great point about the key difference between UART and other interfaces. I've used to see chips supporting "I2C/Serial" or "SPI/Serial" interfaces, but never paid attention to what "serial" actually means. It was a bit of a surprise to realize that it is usually synchronous serial, not an UART at all. \$\endgroup\$
    – Maple
    Commented May 22 at 21:28
  • 1
    \$\begingroup\$ Nowadays there are low cost MCU's that have a 1% clock generator on board. So I think the argument of complexity and cost for UART interface does not count anymore. \$\endgroup\$ Commented May 23 at 5:02
  • \$\begingroup\$ @StefanWyss Sure there are, but not in the most low-cost MCUs. And they must be carefully checked what 1% means. It may be 1% at some voltage and temperature, like for some AVRs, but if you are a hobbyist and use it at 5V, it's not within UART requirements any more. \$\endgroup\$
    – Justme
    Commented May 23 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.