PDA

View Full Version : Trouble Reading Binary or BCD from a GPS



gavo
- 6th August 2011, 15:20
Hi All,

I am having trouble reading data from a GPS which has been set to a Binary Output which I assume is in BCD. If I read the info coming from the GPS in NMEA it reads 100% and I can display all the info on my LCD. Once the GPS is set in binary I can't seem to display any information and if I look at the "GPS Viewer" on the PC it shows me all the text info in Longs/Lats exactly what I want to receive on my PIC. I assume they have some conversion from BCD to ASCII in their software, does anyone know how to convert this data so I can display something readable?

Archangel
- 6th August 2011, 21:16
Here is a pretty good link about BCD & Packed BCD, might be helpful, you can mask upper or lower nibble and save into an array or just some variables, or convert to DEC and display as ASCII.
http://en.wikipedia.org/wiki/Binary-coded_decimal

gavo
- 7th August 2011, 14:40
Hi Archangel,

Many Thanks for the reply,

I am just trying to see how I could do that, how could I convert it it Dec?

If I use the Serin command to receive the data on serin2 portc.7, 84, [B0, B1, B2, B3, B4, B5]
I could then see the Dec Value if I use lcdout $FE,1,DEC B0, DEC B1, DEC B2 etc, etc, but how could I then convert it to ASCII?, could I save the DEC Value of B0 and then recall it to display the ASCII value?, if I could how would I be able to "save" the DEC value of B0?

mackrackit
- 7th August 2011, 18:27
This may also help
http://www.picbasic.co.uk/forum/showthread.php?t=66&p=203#post203