Pages: [1]   Go Down
Author Topic: GSM shield, Mega and extra UART.  (Read 770 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Since GSM Shield uses SoftwareSerial with interrupts, is it possible to modify it to use Serial instead of SoftwareSerial on Mega since it have 4 hardware UARTs? Does this make the performance any better?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 610
Posts: 49071
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Since GSM Shield uses SoftwareSerial
The shield does not use SoftwareSerial. The library (stupidly) uses a variation of SoftwareSerial to communicate with the shield.

Bend some pins on the shield, add jumper wires, and rewrite the library.

Quote
Does this make the performance any better?
HardwareSerial always beats SoftwareSerial. Whether the difference is noticeable depends on how much data you are sending/receiving and what baud rates are involved.

Sending one character a week will not demonstrate a measurable performance improvement when using hardware serial instead of software serial. Sending a million characters an hour will.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Since GSM Shield uses SoftwareSerial
The shield does not use SoftwareSerial. The library (stupidly) uses a variation of SoftwareSerial to communicate with the shield.

Bend some pins on the shield, add jumper wires, and rewrite the library.

Quote
Does this make the performance any better?
HardwareSerial always beats SoftwareSerial. Whether the difference is noticeable depends on how much data you are sending/receiving and what baud rates are involved.

Sending one character a week will not demonstrate a measurable performance improvement when using hardware serial instead of software serial. Sending a million characters an hour will.

I think the better thing to do here is back port the interrupt capability of SoftwareSerial variant the GSM library used to official SoftwareSerial library, add the respective methods to HardwareSerial, extract a superclass from improved SoftwareSerial and HardwareSerial, and then rebase GSM library to that new Serial. When using Leonardo (2 UARTs) or Mega (4 UARTs) which have more than one hardware serial interface, bend pins and use jumper wires, and initialise GSM library with a hardware serial interface.
Logged

Pages: [1]   Go Up
Jump to: