Pages: 1 [2]   Go Down
Author Topic: Problem with reading string from GSM  (Read 1456 times)
0 Members and 1 Guest are viewing this topic.
Orlando, FL
Offline Offline
Full Member
***
Karma: 0
Posts: 147
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

AWOL.  The unit I'm running as mentioned before is not a 16Mhz processor.  It is an 8Mhz processor.  Processor speed has nothing to do with the software buffer either.  Looking at the TinyGPS library support forms they also recommend increasing the software buffer from the NewSoftSerial Library to 256 byte from 64 bytes.  The Hardware Serial buffer is a different item all together.  If you look at the data stream i posted above you will see that including terminators I was receiving 84 bytes of data at 9600bps from the GSM module(including 2 byte terminators).  This means that 20bytes of data were being truncated and not stored in the software buffered in the NewSoftSerial library.  For small information being sent this is not a problem but for large strings of data such as in my case and in the case of NMEA data from a GPS module using a "virtual Software Serial port" needs extra space and needs to be adjusted accordingly.     The hardware serial buffer is 128bytes.  As you can see if I were to reverse the pin out and make the Software Serial hooked up to the computer and the Hardware serial hooked to the GSM the problem goes away because of the buffer size difference.  No i didn't need to make the buffer 256bytes, 128bytes would have been fine but I'd rather have overkill when there is room in the code to do it. 

Thanks again for your input.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 291
Posts: 25898
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You're quite right, I did miss the fact that your processor has only 8 300 instruction cycles per received character period to process the incoming data, and not 16 600.
I apologise.

I did, however notice that you'd provided a one hundred character buffer for the received data in your sketch.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Pages: 1 [2]   Go Up
Jump to: