Connecting more than one serial device to PIC16f877a

multiplexerpicserial

In my project i need to interface a gps receiver and a gsm modem to pic16f877a, But there is only one set of UART lines in this Microcontroller. Is it possible to multiplex these two devices using software without the use of additional hardware?

Best Answer

You're approaching the problem in the wrong way. You have two devices that put out serial data, so you need a microcontroller with two UARTS. Luckily, such things are available, for example among the PIC24's there are chips that have two UART ports and two I2C ports. These are still PIC, so you can apply your PIC16 skills.

Match the microcontroller to the application! Do not have a "pet" microcontroller that you use for everything, no matter what.

There isn't much reason to use a PIC16 today in a new design. It's great that Microchip stands behind them and still makes them. But the primary value of this is that you can replace a nonworking one in an old device.