|
|
| Author |
Message |
sturgessb
Joined: 25 Apr 2008
Posts: 246
Location: Norwich, UK
|
|
Posted: 16 March 2009, 17:09 PM Post subject: |
|
|
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 |
|
| Back to top |
|
 |
dkinzer Site Admin
Joined: 03 Sep 2005
Posts: 2593
Location: Portland, OR
|
|
Posted: 16 March 2009, 17:18 PM Post subject: |
|
|
| 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? | 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. |
|
| Back to top |
|
 |
GTBecker
Joined: 18 Jan 2006
Posts: 472
Location: Cape Coral
|
|
Posted: 16 March 2009, 17:24 PM Post subject: 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 |
|
| Back to top |
|
 |
Don_Kirby
Joined: 15 Oct 2006
Posts: 329
Location: Long Island, New York
|
|
Posted: 16 March 2009, 17:26 PM Post subject: |
|
|
| 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 |
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.
-Don |
|
| Back to top |
|
 |
sturgessb
Joined: 25 Apr 2008
Posts: 246
Location: Norwich, UK
|
|
Posted: 16 March 2009, 22:40 PM Post subject: |
|
|
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.
| 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
|
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] |
|
| Back to top |
|
 |
twesthoff
Joined: 17 Mar 2006
Posts: 199
Location: Fredericksburg, VA
|
|
Posted: 16 March 2009, 23:18 PM Post subject: NMEA parsing, serial interrupt? |
|
|
ZBasic wrote: | Quote: | 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.
| Change this line to:
GPS_string = GPS_string & Chr(GPS_byte)
See if that works...
| Quote: |
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
|
|
|
| Back to top |
|
 |
dkinzer Site Admin
Joined: 03 Sep 2005
Posts: 2593
Location: Portland, OR
|
|
Posted: 16 March 2009, 23:21 PM Post subject: |
|
|
| sturgessb wrote: | | I cant seem to convert the Byte to a Char for the string. I have the following. | 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.
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(). |
|
| Back to top |
|
 |
sturgessb
Joined: 25 Apr 2008
Posts: 246
Location: Norwich, UK
|
|
Posted: 17 March 2009, 0:04 AM Post subject: |
|
|
Thanks!
ok so in this instance its probably me thats dying not the zx! |
|
| Back to top |
|
 |
|