Maximum Number of Variables for SERIN, and PE line breaks?

Armp

Senior Member
I need to receive a string of ASCII data from a GPS using serin in the format:

serin GPS_in, N4800_32,("$GPGLL,"),@bptrinc,@bptrinc,@bptrinc,@bptrinc, ..... and on and on...
What is the maximum number of variables that can be specified in one statement?
And how do I break the line up into multiple lines in the Editor. I don't see a 'line continuation' character
 

eclectic

Moderator
I need to receive a string of ASCII data from a GPS using serin in the format:



What is the maximum number of variables that can be specified in one statement?
And how do I break the line up into multiple lines in the Editor. I don't see a 'line continuation' character
For the second, please try

PE > View > Options > Editor >Wrap long lines

e
 

Armp

Senior Member
For the second, please try

PE > View > Options > Editor >Wrap long lines
I tried that - but it gives me
serin GPS_in, N4800_32,("$GPGLL,"),@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptr,@bptrinc,@bptrinc,@bptrinc,@bptr,@bptr,@bptr,@bptr,@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptr,@bptrinc,@bptrinc,@bptrinc
And for readabilty what I'd like is

serin GPS_in, N4800_32,("$GPGLL,"),
@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptr, 'Latiude
@bptrinc,@bptrinc,@bptrinc,
@bptr,@bptr,@bptr,@bptr,
@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptr, 'Longitude
@bptrinc,@bptrinc,@bptrinc
 

Armp

Senior Member
By using line wrap, symbols and spaces I can improve the readability.
Makes it a little easier to check, but is it legal to use a symbol for @bptrinc and @bptr?

symbol chr = @bptrinc
symbol __ = @bptr

serin GPS_in, N4800_32,("$GPGLL,"),chr,chr,chr,chr, __,chr,chr,chr,
__,__,__,__, chr,chr,chr,chr, __,chr,chr,chr
 

Goeytex

Senior Member
My first thought is that it would not work , however the snippet below works in the simulator
and suggests that it will.


symbol ch = @bptrinc
symbol _ = @bptr

b0 = 27
b1 = 144
b2 = 221

do
bptr = 0
sertxd (#ch," ",#ch," ",#_,cr,lf)
pause 1000
loop
 

hippy

Ex-Staff (retired)
I believe the maximum number of variables is 'infinite' limited only by the amount of program memory. I seem to recall that previously being asked somewhere on the forum but can't currently locate the post.

As to line breaks; there are none. All statements have to be on one line.

Looking at what you are attempting to do I would suggest using a PICAXE with background receive is a better way of doing things.
 

srnet

Senior Member
And bear in mind that if you are receiving a GPS string using fixed locations in the string (which you appear to be doing) then it does not work if the lengths of the fields change, such as before the GPS has a fix or maybe if it looses its fix.

Searching for the comma seperators to delimit the fields is a more robust way to decode the string.
 

Armp

Senior Member
Which version of PICAXE are you using? If it's an ...X2 chip then I'd be using background receive: much easier.
Right now I'm doing a remap of some 1999 vintage Garmin 12XL/Motorola 68HC11 code into 20M2, more an exercise to understand the PICAXE than produce robust code. It's a challenge - but we're close...

The trig functions were relatively easy. The 16 bit divide was tougher - see my other thread.

There's a lot of good stuff here in the forums - but very hard to find with the primitive SEARCH function.
 
Last edited:

westaust55

Moderator
@Armp,

have you done a forum search to see what others have done with respect to receiving data from a GPS into a PICAXE chip.

A first search on "GPS parsing" found 74 posts. A few include:

http://www.picaxeforum.co.uk/showthread.php?19004-Smart-front-end-interface-for-GPS

http://www.picaxeforum.co.uk/showthread.php?16974-parsing-GPS-NMEA-data-on-a-picaxe

http://www.picaxeforum.co.uk/showthread.php?11755-Parsing-NMEA-GPGGA-GPRMC-with-a-28X1-to-display-TIME

http://www.picaxeforum.co.uk/showthread.php?7558-Floating-point-support-chip

http://www.picaxeforum.co.uk/showthread.php?7031-Reading-GPS-string

http://www.picaxeforum.co.uk/showthread.php?6059-NMEA-Parsing-wot-am-I-doing-wrong

Whether there is anything there of use to you, I guess only you will know.
As mentioned in one of the above threads as well as PICAXE software parsing and data extraction there is the Micromega uM-FPU V3.1 which includes GPS input parsing.


EDIT:
ah you mention a search in the post made above while I was searching and typing.

Two options for better forum searching:
1. Use the advance search option
2. USe a google search with the format <topic> site:http://www.picaxeforum.co.uk
 
Last edited:

Armp

Senior Member
@Armp,

have you done a forum sarch to see what others have done with respect to receiving data from a GPS into a PICAXE chip.

A first search on "GPS parsing" found 74 posts. A few include:
<snip>

Whether there is anything there of use to you, I guess only you will know.

EDIT:
ah you mention a search in the post made above while I was searching and typing.

Two options for better forum searching:
1. Use the advance search option
2. USe a google search with the format <topic> site:http://www.picaxeforum.co.uk
Thanks - but I think I've read them all! Hence my SEARCH comment.

As for using a FPU - IMHO the calculations don't require one for most applications.
Series expansions of SIN, COS and ATAN to 3 or 4 sig figures is enough.

Not too sure about crossing the Atlantic though :)
 
Top