Results 1 to 6 of 6

Thread: Pic basic - 4800 baud?

  1. #1
    lez
    lez is offline
    FLAC lez's Avatar
    Join Date
    Jan 2004
    Location
    UK
    Posts
    1,334

    Pic basic - 4800 baud?

    I need 4800 baud in picbasic to try to monitor the 4800 baud gps signal from my gps mouse.

    Tried the obvious serin porta.0,4800 style command but not happy it is.



    Also, (was going to work this out later but if anyone has this answer!) If I wait for the start of gps data (GPRMC) header ie

    $GPRMC,092204.999,A,4250.5589,S,14718.5084,E,0.00, 89.68,211200,,*25

    I cant store it all as pic's have no string variables?

    I wanted to read this on 1 pin, then store it, change it to SMS 7 bit superscrewed and send it to the phone as a send sms.

    (which reminds me, does any phone support simple txt msg sendingwithout using 7 bit nibble swapped padded data?)


    Think I can see it costing lots of money for the programming fluid (40%proof) for this one.

  2. #2
    Low Bitrate Enak's Avatar
    Join Date
    May 2004
    Location
    Hertfordshire, UK
    Posts
    65
    You'll have to break the data into chunks and store those

  3. #3
    lez
    lez is offline
    FLAC lez's Avatar
    Join Date
    Jan 2004
    Location
    UK
    Posts
    1,334
    But if I serin() and get the first chunk, I cant process it as I need all the other chunks.

    I have not tried yet but I presume if I just read/store it that I wont be able to store it without missing the next chunk......

    I suppose that depends on the size of the chunks, and how fast I can run the pic etc.

  4. #4
    Low Bitrate Enak's Avatar
    Join Date
    May 2004
    Location
    Hertfordshire, UK
    Posts
    65
    To process serial commands you really need an interupt based buffer routine.

  5. #5
    Registered User
    Join Date
    May 2003
    Posts
    1,736
    Setup the UART to interrupt on every char received.

    On the ISR, read the received char, if its a "$" then you know you got the start of a header comming up. Else keep looking for it until it finds one.

    Once you got a "$", this is when you start looking for a string "GPRMC". You can store this string on a retlw table.

    From there on compare the next received char to the first char of the string which is a "G". If it fails then reset and look for a "$" again.

    If it passed looking for a "G" then increment the retlw table index so it points to "P".

    The expected char to be received is now "P"...

    Keep looping until you got the GPRMC checked, once its passed you can now store what ever is comming up right up to the LFCR characters.

    Store it using indirect adr, using FSR and INDF.

  6. #6
    Registered User
    Join Date
    May 2003
    Posts
    1,736
    Quote Originally Posted by lez
    I suppose that depends on the size of the chunks, and how fast I can run the pic etc.
    PIC is fast enough for 4800bps, unless your code is so bloated.



    Quote Originally Posted by Enak
    To process serial commands you really need an interupt based buffer routine.
    I agree, its the best thing to do. I dont know how well BASIC handles a PIC interrupts...by the sound of it hes using a SW UART.

Similar Threads

  1. GPS vehicle tracking, any advise ?
    By paulfromholland in forum GPS
    Replies: 53
    Last Post: 07-01-2005, 03:42 AM
  2. OBD2 PIC code.
    By racemier in forum Engine Management, OBD-II, Engine Diagnostics, etc.
    Replies: 3
    Last Post: 02-06-2005, 12:10 PM
  3. Visual Basic Question????
    By chuckctv in forum Software & Software Development
    Replies: 9
    Last Post: 12-28-2004, 11:25 AM
  4. Basic Stamps???
    By adjones in forum Power Supplies
    Replies: 14
    Last Post: 08-23-2004, 11:28 PM
  5. Using a PIC with Zehnder's LCDplugin - First Time Programing.
    By Machs_FueL in forum Software & Software Development
    Replies: 1
    Last Post: 06-16-2002, 03:12 AM

Bookmarks

Posting Permissions

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