Shop OBEX P1 Docs P2 Docs Learn Events
Saving RAM space. — Parallax Forums

Saving RAM space.

ArchiverArchiver Posts: 46,084
edited 2003-04-27 05:25 in General Discussion
Hi,

In anticipation of a new NMEA RS232 GPS box I have
ordered, I started whipping up some code for it (after
looking at a few examples), however I have run into
major problem; I need more RAM space.

The code I have just about gobbles up all my RAM, and
I need more space so I can perform calculations on the
NMEA data received.

I’m relatively new to Stamps (though I've had it a
while), and am wondering if anyone can give me a few
pointers on how I could save some space (or possibly
add some more ram to my BS2sx?).

Here’s the code anyway.

'{$STAMP BS2sx}
'{$PBASIC 2.0}
'Liam Farr - liam@f... - 24/04/03

'
Variables
time var byte(6) 'time UTC (HHMMSS)
lat var byte(8) 'latitude without last decimal
long var byte(9) 'longitude without last decimal
'

'
Main Code
nmea_in: 'get the current time, lattitude and
longatude from the serial nmea input.
serin 2, 16884, [noparse][[/noparse]wait("$GPGGA"),skip 1,str time\6,skip
1,str lat\8,skip 3,str long\9] '16572 = 4800 Baud-8
Bit No parity Inverted for BS2 & BS2e, 16884 = 4800
Baud-8 Bit No parity Inverted for BS2SX & BS2p.
goto nmea_out

nmea_out 'output the nmea data (time, lat & long)
to the debug window.
debug "Time: ", DEC time, " ", "Latitude: ", DEC
lat, " ", "Longitude: ", DEC long, CR, CR
goto nmea_in
'

Cheers

Liam

__________________________________________________
Yahoo! Plus
For a better Internet experience
http://www.yahoo.co.uk/btoffer

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-04-26 15:06
    You might want to look at my article on GPS reception and decoding from Nuts &
    Volts magazine last year. Even thought I use a BS2p for GPS (so that the
    entire GPMRC string can be buffered to the Scratchpad RAM), the conversion of
    of string data to useful numbers may be useful to you.

    Go to this link (Parallax -> Resources -> Nuts & Volts Columns -> Volume 3):

    <A
    HREF="http://www.parallax.com/html_pages/resources/nvcolumns/Nuts_Volts_Download\
    s_V3.asp
    ">
    http://www.parallax.com/html_pages/resources/nvcolumns/Nuts_Volts_Downloads_V3.

    asp</A>

    and download article #83.

    -- Jon Williams
    -- Parallax




    In a message dated 4/26/2003 3:50:30 AM Central Standard Time,
    nz_liam@y... writes:

    > Hi,
    >
    > In anticipation of a new NMEA RS232 GPS box I have
    > ordered, I started whipping up some code for it (after
    > looking at a few examples), however I have run into
    > major problem; I need more RAM space.
    >
    > The code I have just about gobbles up all my RAM, and
    > I need more space so I can perform calculations on the
    > NMEA data received.
    >
    > I
  • ArchiverArchiver Posts: 46,084
    edited 2003-04-27 05:25
    Thanks for that, I'll look into it.


    Cheers

    Liam

    --- jonwms@a... wrote: > You might want to look at
    my article on GPS
    > reception and decoding from Nuts &
    > Volts magazine last year. Even thought I use a
    > BS2p for GPS (so that the
    > entire GPMRC string can be buffered to the
    > Scratchpad RAM), the conversion of
    > of string data to useful numbers may be useful to
    > you.
    >
    > Go to this link (Parallax -> Resources -> Nuts &
    > Volts Columns -> Volume 3):
    >
    > <A
    >
    HREF="http://www.parallax.com/html_pages/resources/nvcolumns/Nuts_Volts_Download\
    s_V3.asp
    ">
    >
    http://www.parallax.com/html_pages/resources/nvcolumns/Nuts_Volts_Downloads_V3.
    >
    > asp</A>
    >
    > and download article #83.
    >
    > -- Jon Williams
    > -- Parallax
    >
    >
    >
    >
    > In a message dated 4/26/2003 3:50:30 AM Central
    > Standard Time,
    > nz_liam@y... writes:
    >
    > > Hi,
    > >
    > > In anticipation of a new NMEA RS232 GPS box I have
    > > ordered, I started whipping up some code for it
    > (after
    > > looking at a few examples), however I have run
    > into
    > > major problem; I need more RAM space.
    > >
    > > The code I have just about gobbles up all my RAM,
    > and
    > > I need more space so I can perform calculations on
    > the
    > > NMEA data received.
    > >
    > > I
Sign In or Register to comment.