I am using Arduino UNO and SIM 900A. Pins 0 and 1 are used as TX and RX. Is it possible to use any other pins?
1 Answer
The best choice for serial communications is obviously the HardwareSerial object, Serial
, on pins 0 & 1. However, it is really dedicated to the USB connection (via the onboard Serial-to-USB adapter). There are ways to connect other devices to these pins, but it is an advanced topic, and should not be attempted by beginners.
The second best choice would be pins 8 & 9, because AltSoftSerial requires those pins. It is very efficient and reliable.
After that, any other pins can be used with one of these two software serial libraries:
NeoSWSerial is less efficient than AltSoftSerial, but much more efficient than SoftwareSerial. It only supports baud rates 9600, 19200 and 38400, but it does support simultaneous TX and RX. I maintain this library.
If you must use a different baud rate, SoftwareSerial is the last choice. It blocks interrupts for long periods of time and can interfere with other libraries. It cannot transmit and receive at the same time.