Propeller with Parallax GPS Receiver Module
Michael Rankin
Posts: 2
I'm new to the spin language and was seeking some·help with this setup/code.
·
I have the propeller·demo board·and the Parallax GPS Receiver Module. The 4 pins on the GPS module are GND, VCC, SIO, and RAW. Currently, I have the GND pin going to VSS on the propeller demo board, VCC going to 5V on the demo board, and SIO going to I/O pin number 0 on the board.
·
What I am having trouble with is sending this header value "!GPS" plus a hex value (0x00) to the SIO pin (i/o pin 0)·and then receiving the·2 bytes back on i/o pin 0.
·
I am using the FullDuplexSerial v1.1 for the serial communication. Here is the code I have so far.
·
Any help is appreciated. Thanks.
·
Michael
·
I have the propeller·demo board·and the Parallax GPS Receiver Module. The 4 pins on the GPS module are GND, VCC, SIO, and RAW. Currently, I have the GND pin going to VSS on the propeller demo board, VCC going to 5V on the demo board, and SIO going to I/O pin number 0 on the board.
·
What I am having trouble with is sending this header value "!GPS" plus a hex value (0x00) to the SIO pin (i/o pin 0)·and then receiving the·2 bytes back on i/o pin 0.
·
I am using the FullDuplexSerial v1.1 for the serial communication. Here is the code I have so far.
·
Any help is appreciated. Thanks.
·
Michael
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 OBJ text : "vga_text" serial : "FullDuplexSerial1_1" VAR Byte RX_value[noparse][[/noparse]2] Byte Index PUB start text.start(16) dira[noparse][[/noparse]01]~~ serial.start(1,1,0,4800) serial.tx($21) serial.tx($47) serial.tx($50) serial.tx($53) serial.tx($00) dira[noparse][[/noparse]01]~ Index := 0 repeat 3 RX_value[noparse][[/noparse]Index++] := serial.rx Index := 0 repeat 3 text.hex(RX_value[noparse][[/noparse]Index++],8) text.out($0D)
Comments
This may help you.
· serial.str(@msg1)·····
· serial.tx($00)
· waitcnt(900_000+cnt)
DAT
· msg1··· byte··· "!GPS",0
I use this format to communicate with a uMMC card writer/reader.
Hope this help.
The program I use to communicate with a uMMC card writer/reader is :
''*****************************
'' uMMC_1.spin
''*****************************
CON
· _clkmode····· = xtal1 + pll16x
· _xinfreq····· = 5_000_000
· RX_PIN······· = 2
· TX_PIN······· = 3
· MODE········· = %0000································ ' see FullDuplexSerial.spin for description
· BAUD········· = 9600
·····
VAR
······· long··· k
OBJ
······· term··· : "tv_terminal"
······· serial· : "fullduplexserial"
PUB start | i
· serial.start(RX_PIN, TX_PIN, MODE, BAUD)·········· ' initialize serial object
· waitcnt(4_000_000+cnt)
··· term.start(12)
··· term.str(@title)·
··· waitcnt(40_000_000+cnt)
'
[noparse][[/noparse]Main starts here]
· term.str(@msg1)
· term.out($09)····
· serial.str(@msg1)·····
· serial.tx(13)
· waitcnt(900_000+cnt)
· repeat until k==">"·········
··· k:=serial.rx
··· term.out(k)
DAT
· title·· byte··· "First uMMC Read/Write",13,13,0
· msg1··· byte··· "V",0
0x21 which is !
0x47 which is G
It looks like I am just getting back the command I am sending. I don't know if the GPS module is returning that or the code is reading it from memory
Post Edited (Michael Rankin) : 10/10/2006 1:47:18 PM GMT
try this following code. Note, I have removed the use of fullduplex and am using 2 code snippets courtesy of Mike Green. It works like a charm for me in my AC4790 work I am doing w my ALIBE project.
hope this works for you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ALIBE - Artificial LIfe BEing. In search of building autonoumous land robot
http://ALIBE.crosscity.com/
http://fstop.crosscity.com/
http://icar.crosscity.com/
·