Gps with 16f628


Closed Thread
Results 1 to 8 of 8

Thread: Gps with 16f628

Hybrid View

  1. #1
    Join Date
    Apr 2006
    Location
    Alberta Canada
    Posts
    166


    Did you find this post helpful? Yes | No

    Default

    thanks for the reply.. i understand that a lot more than i did before... my lcd is currently not working, and i dont know why, so as soon as i get it fixed, or i get another, i will retry writing the code using your example...

    thanks

    danny

  2. #2
    Join Date
    Apr 2006
    Location
    Alberta Canada
    Posts
    166


    Did you find this post helpful? Yes | No

    Default

    OK, i think ive got the basics of how to do this... im sorry if it seems like im asking you all to write the code for me, but im not... im just one of those people that figure the best way to learn is from examples.. i have tried changing leinske's code to make it display with a serial lcd, and what data it displays... i got it to work, except for displaying the course... thanks for that, i learnt a lot from it.... i just learned that my gps does output GPAPB sentences (only outputs it if there is a route active), and so i changed the code for it... i just want to display waypoint name and distance and direction for some geocaching stuff i am working on... when i try to compile, it says that there is an error. it says "expected ]"... i know its probably a stupid mistake somewhere, but i cant find it.... im using a 16f88 at 10mhz, with an epic programmer... the gps is a sporttrak map.... thanks for all the help...


    @ DEVICE HS_OSC
    DEFINE OSC 10
    cmcon = 7
    TRISA = %00000000

    'variables
    '-------------------------------------------------------------
    lcd VAR PORTA.3
    gpsin VAR PORTB.0
    GPAPB_IN VAR BYTE
    TimeOut CON 3000
    baudGPS CON 24764 '16572 + 8192 (bit 13)
    blink VAR BYTE 'SNR warning
    warning VAR BYTE 'cycle warning
    xtrack VAR WORD 'crosstrack error
    lrcorrect VAR WORD 'steer right or left to correct
    xtrackunits VAR BYTE 'cross track error units n or k
    arrivalcircle VAR WORD 'arrival alarm circular
    arrivalperp VAR WORD ' arrival alarm perpendicular
    magbear VAR WORD 'origin to dest 'magnetic bearing
    dest VAR WORD 'destination ID
    bear VAR WORD 'position to dest
    head VAR WORD 'heading to steer

    'initialize variables

    'setup serial lcd
    '-------------------------------------------------------------

    Pause 5000
    SerOut2 lcd, 32,[254,"X"] 'clear screen
    Pause 100

    'main program
    '-------------------------------------------------------------

    GPS: 'read GPS

    SerIn2 GPSin,baudGPS,Timeout,Nogps,[wait("$GPAPB"), wait(","), blink, wait(","), warning, wait(","), DEC2 xtrack, wait(","), lrcorrect, wait(","), xtrackunits, wait(","), arrivalcirlce, wait(","), arrivalperp, wait(","), DEC3 magbear, wait(",$,"), mag, wait(","), dest, wait(","), DEC3 bear, wait(","), DEC3 head]

    SerOut2 lcd, 32,[254,"G",4,1]
    SerOut2 lcd, 32,[#lrcorrect," "]
    SerOut2 lcd, 32,[254,"G",1,2]
    SerOut2 lcd, 32,[#magbearing," "]
    SerOut2 lcd, 32,[254,"G",4,2]
    SerOut2 lcd, 32,[#mag," "]
    SerOut2 lcd, 32,[254,"G",1,3]
    SerOut2 lcd, 32,[#dest," "]
    SerOut2 lcd, 32,[254,"G",4,3]
    SerOut2 lcd, 32,[#magbear," "]
    SerOut2 lcd, 32,[254,"G",1,1]
    SerOut2 lcd, 32,[#maghead," "]

    Pause 500
    GoTo gps

    Nogps:
    Pause 100
    SerOut2 lcd, 32,[254,"X"]
    SerOut2 lcd, 32,[254,"G",5,2]
    SerOut2 lcd, 32,[" NO GPS"]
    Pause 100
    GoTo GPS

Similar Threads

  1. GPS $GPRMC to PIC16F684. Need help with SERIN2
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 27th November 2009, 10:47
  2. Replies: 1
    Last Post: - 27th July 2008, 07:14
  3. GPS clock timing !
    By bethr in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 3rd July 2008, 21:11
  4. Replies: 2
    Last Post: - 28th April 2006, 13:10
  5. GPS Receiver
    By lester in forum Adverts
    Replies: 2
    Last Post: - 22nd February 2006, 13:47

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts