Announcement

Collapse
No announcement yet.

Pic basic - 4800 baud?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.
    Lez, more widely known as flez1966

  • #2
    You'll have to break the data into chunks and store those

    Comment


    • #3
      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.
      Lez, more widely known as flez1966

      Comment


      • #4
        To process serial commands you really need an interupt based buffer routine.

        Comment


        • #5
          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.

          Comment


          • #6
            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.



            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.

            Comment

            Working...
            X