Depending on your application, you can use a serial port. When you choose STC, you don't need to add hardware. Generally, 5 1 needs to add a switch chip to control the serial port to connect gps or GSM.
The serial port of STC microcontroller can be set at P3 port or P 1 port.
If you use STC
Assume that P3 serial port pin is connected to GPS and P 1 serial port pin is connected to GSM.
Normally, the serial port is always set at P3, after processing gps data, it is set at P 1, and after sending data, it is set at P3.