Shop OBEX P1 Docs P2 Docs Learn Events
GPS unit + SD data logger = ?? — Parallax Forums

GPS unit + SD data logger = ??

CCraigCCraig Posts: 163
edited 2007-03-09 21:08 in General Discussion
Greetings,

I'm still working on my GPS project and now need some adult supervision. (I'm only 39, oops, just had a birthday, now I'm 3A. That doesn't work anymore, does it). I re-wrote the GPS software using edge detect (isr FEAR) and it works great. Now I want to change it. (sound familar?).

Problem:
·I want to merge the Parallax GPS unit with Bean's SD Data logger. Using the 'extra ports' on the GPS unit, I want to log position information to the data logger every 10 seconds. The GPS unit will send a 'cut down' GPS string (plus logger status) out to the master SX. The GPS unit will also listen for a command string from the master (A. lookup waypoint # from different file on the logger and send it back. B. save present position to waypoint file). I also have a power fail detect signal to manage. Power fail has a little less than one second to finish writing and close file before loss of main power.

The GPS unit is a SX20 running at 20MHz.

Signals:
Inputs:
· A. Slow (4800 baud) data block from GPS radio (about 400 ms long, with the last 100 ms the data I need, once per second.)
· B. Input from master SX (commands) 19k2 baud?
· C. Status byte and information back from the data logger. 19k2
· D. Power fail detect. Signal goes low, the lights go out in 1 second.

Outputs:
· E. GPS data and SD logger status to master SX. 19k2?
· F. Data to SD data logger. 19k2

I think this is doable. Am I right? I have three input data streams to watch. Some are slow to respond. The data logger may take as long a 500 ms to respond on a large file write. The command request from the master SX may never come. The data from the GPS radio is always going to come in once per second and is really slow.

What I need:
· Ideas, suggestions, warnings, pseudocode, readings etc. I'll do the work. I just need encouragement. Can I handle 4 inputs and 2 output within the ISR. None of the data is critical. Missed data log while in a waypoint fetch is not important. Should I disable interrupts while I'm doing that? And if so, what about power fail? I'm just now beginning to understand the SX, interrupts etc. Is this too much?

Thanks for bearing with me, Chris

Comments

  • BeanBean Posts: 8,129
    edited 2007-03-09 17:21
    Chris,
    It might be easier to use a slower baud rate.

    To receive you generally need to sample at 3x the baud rate, that would be 57600 times a second. At 20MHz that is only 347 cycles.

    I would use the SD Data logger at 2400 baud (adjust the jumper). And make the SX communications at 4800 (same speed at the GPS). That will make the interrupt 4800x3 = 14400 times per second giving you 1389 clocks per interrupt.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com
    Coming soon! Propeller based OSD module www.hittconsulting.com
    ·
  • CCraigCCraig Posts: 163
    edited 2007-03-09 21:05
    Thanks Bean,

    Do you think I'll be able to do 2 inputs and 2 outputs? GPS to master SX and GPS to SD Data Logger?

    or is that asking too much? Pretty big project for the first time ISR learning test.

    Thanks, Chris
  • BeanBean Posts: 8,129
    edited 2007-03-09 21:08
    You'll just have to watch how big your receive buffers need to be. The SX20/28 doesn't have loads of RAM.
    Other than that, it should be quite do-able at 2400 & 4800 baud.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com
    Coming soon! Propeller based OSD module www.hittconsulting.com
    ·
Sign In or Register to comment.