Im working with a SIM900 module bought from SainSmart on a MEGA.
I somehow connected it and it magically "just works"! My sketch that simply sends out and SMS.
Here is my question:
Ok, the UNO is a bit different because it only has a dedicated Rx & Tx pin. MEGA has a bunch more. But even so, is there no need to specify the pins you are using for Rx & Tx when using the MEGA?
How does the UNO/MEGA know where to look for outgoing/incoming data?
Is it because those are designated Rx/Tx hardware pins that they don't need software/code specification?
Is it because those are designated Rx/Tx hardware pins that they don't need software/code specification?
The Serial object is an instance of the HardwareSerial class. That class knows about the hardware - both the Mega and the Uno and the Due and all the other supported hardware.
Well, hardware is hardware - there are UARTs in the Mega with built-in clock generation for sampling the bits to support the various data rates.
Software serial fakes that, and uses pins that support PCINT (so not all Mega pins) as part of the process. Sending & Receiving a data byte is not handled independently by the hardware, but instead requires numerous software commands to make it happen. That's why the data rate for software serial is much slower, while the hardware can run at 115200, 230400, and up to 1M.