Welcome to the MP3Car.com forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. Registering will also remove advertisements. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact contact us.
|
08-14-2005, 12:58 PM
|
#1
|
|
FLAC
Join Date: Jan 2004
Location: UK
Vehicle: XM 2.1 TD
Posts: 1,281
|
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.
|
|
|
08-16-2005, 09:15 AM
|
#2
|
|
Low Bitrate
Join Date: May 2004
Location: Hertfordshire, UK
Vehicle: Range Rover
Posts: 65
|
You'll have to break the data into chunks and store those
|
|
|
08-20-2005, 06:22 AM
|
#3
|
|
FLAC
Join Date: Jan 2004
Location: UK
Vehicle: XM 2.1 TD
Posts: 1,281
|
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.
|
|
|
08-20-2005, 06:36 PM
|
#4
|
|
Low Bitrate
Join Date: May 2004
Location: Hertfordshire, UK
Vehicle: Range Rover
Posts: 65
|
To process serial commands you really need an interupt based buffer routine.
|
|
|
08-21-2005, 01:43 AM
|
#5
|
|
Raw Wave
Join Date: May 2003
Posts: 2,021
|
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.
|
|
|
08-21-2005, 01:51 AM
|
#6
|
|
Raw Wave
Join Date: May 2003
Posts: 2,021
|
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.
Last edited by Chris31 : 08-21-2005 at 01:58 AM.
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 09:32 AM.
|
|