Quick question...
Is there any possibility that after writing to the zx many many times (i have probably flashed it thousands of times), that this would cause issues with its performance and continuity?
Only I'm getting some weird results with previously proven code.
Ben
NMEA parsing, serial interrupt?
The Flash memory (which contains your program's code) has a 10,000 write cycle specification. That doesn't mean that it quits working after 10,000 cycles; it means that problems may arise after that many cycles.sturgessb wrote:Is there any possibility that after writing to the zx many many times (i have probably flashed it thousands of times), that this would cause issues with its performance and continuity?
- Don Kinzer
NMEA parsing, serial interrupt?
> ...10,000 write cycle...
When I attended an Atmel seminar a few years ago, we were told by design
engineers present that the specification is very conservative. In fact,
they said, 100,000 cycles is common and 1e6 cycles possible.
Tom
When I attended an Atmel seminar a few years ago, we were told by design
engineers present that the specification is very conservative. In fact,
they said, 100,000 cycles is common and 1e6 cycles possible.
Tom
Tom
This is the method I would pursue. Typically, I would discard all incoming data until I received the delimiting character (in this case the '$'). Then, buffer the data until another '$' is received. The buffer now contains a complete sentence (ignoring lost or incorrect data). At this point, you can either begin receiving data into the same or a different buffer until another '$' is received.spamiam wrote:Since each GPS sentence stats with a "$", in your receive task you could pull data off the incoming queue until you hit a "$" at that point the previously recorded data must be a whole sentence, and you can transfer that string somewhere else and set a flag indicating the data is ready.
-Tony
-Don
I'm trying the byte at a time version suggested but I cant seem to convert the Byte to a Char for the string. I have the following.
And if I write GPS_string to screen i get....
71
7180
718071
71807171
7180717165
718071716544
71807171654450
7180717165445050
718071716544505050
71807171654450505057
7180717165445050505748
etc etc. no Chars?
Then after a few seconds it goes to this....
...7180717165445050514852524654484844535051564653515557447844484849495546565148564469444944524452464952
718071716544505051485252465448484453505156465351555744784448484949554656514856446944494452445246495236
71
7136
71
7136
71
7136
71
7136
71
7136
71
7136
71
7136
71
7136
717136
71
7136
71
and on and on like that.
This Com Port stuff is doing my head in, I can't remember having any problems with this kindof last time I dealt with it. I'm really beginning to think this zx is dying.
Or am I just being a dunce?
[/code]
Code: Select all
Do
Call GetQueue(com2RXQueue, GPS_byte, 1)
GPS_string = GPS_string & Cstr(GPS_byte)
If GPS_byte = Asc("$") then
'Process the string here, and then clear
GPS_string = ""
End If
Loop
71
7180
718071
71807171
7180717165
718071716544
71807171654450
7180717165445050
718071716544505050
71807171654450505057
7180717165445050505748
etc etc. no Chars?
Then after a few seconds it goes to this....
...7180717165445050514852524654484844535051564653515557447844484849495546565148564469444944524452464952
718071716544505051485252465448484453505156465351555744784448484949554656514856446944494452445246495236
71
7136
71
7136
71
7136
71
7136
71
7136
71
7136
71
7136
71
7136
717136
71
7136
71
and on and on like that.
This Com Port stuff is doing my head in, I can't remember having any problems with this kindof last time I dealt with it. I'm really beginning to think this zx is dying.
Or am I just being a dunce?
[/code]
NMEA parsing, serial interrupt?
ZBasic wrote:
GPS_string = GPS_string & Chr(GPS_byte)
See if that works...
Change this line to:I'm trying the byte at a time version suggested but I cant seem to convert the Byte to a Char for the string. I have the following.
GPS_string = GPS_string & Chr(GPS_byte)
See if that works...
Code:
Do
Call GetQueue(com2RXQueue, GPS_byte, 1)
GPS_string = GPS_string & Cstr(GPS_byte)
If GPS_byte = Asc("$") then
'Process the string here, and then clear
GPS_string = ""
End If
Loop
The CStr() function converts a value to the string equivalent. For example, if a byte has the value 105, the string returned by CStr() when passed that byte is "105". It sounds as if that is not what you intended here.sturgessb wrote:I cant seem to convert the Byte to a Char for the string. I have the following.
The function that you likely intended to use is Chr(). If passed the same 105 value described above, Chr() returns the single-character string "I". Note that Asc() and Chr() are inverse functions with respect to one another. The closest function that could be considered an inverse of CStr() is ValueS().
- Don Kinzer