GPS-PICAXE 08M2

du1mga

New Member
Hi,
I'm busy since a while to connect an GPS-Receiver with 9600 bps. to an 08M2 without success.
The only thing I can see is garbage on the screen (F8)

Here is the code I use:


setfreq m16 ; resonator-speed to 16MHz
hsersetup B9600_16, %00; baud 9600 at 16MHz

mainser:
b1 = $FF ; set up a non-valid value
serin 3, N9600_16, b1 ; receive 1 byte into b1
if b1 <> $FF then ; if a byte was received
hserout 0,(b1) ; echo it back out
end if
goto mainser ; loop


This is more or less the code from the manual2.

With an Arduino the GPS-Receiver is working without problems.

Please help.

Regards du1mga
 

g6ejd

Senior Member
I've found the picaxe is too slow to read a gs output at 9600, I suggest you search this forum for example code that il read the GPS, as it cn be done with the right techniques, mostly using @bpr
 

du1mga

New Member
Hi srnet,
I was trying it before and I also try it again now with copying your line into the 8M2, but the result is the same. Receiving, but only garbage.

Regards du1mga
 

MFB

Senior Member
g6ejd , What speed was the PICAXE running at? I would have thought the 32 and 64 MHz versions would be able to read the GPS output at 9600 baud.
 

g6ejd

Senior Member
g6ejd , What speed was the PICAXE running at? I would have thought the 32 and 64 MHz versions would be able to read the GPS output at 9600 baud.
16Mhz and was too slow for normal programming techniques, even at 32, but with revised method of multiple ptr's it works well and repeatable too. Search the forum for the listing/ examples.
 

MPep

Senior Member
Please advise GPS model.
Also, it is possible that the output from the GPS is 3V3, and the PICAXE is running at 5V, which causes problems.

We need more info, such as a schematic diagram., voltage levels etc.
 

g6ejd

Senior Member
Code:
setfreq m8

high b.6
high b.7


Main:
setfreq m8

bptr = 54 

serin b.1,t4800_8,("GPRMC,"),@bptrinc,@bptrinc,@bptrinc, @bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptrinc,_
@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptr inc,@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptrinc,@ bptrinc,_
@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptr inc,@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptrinc,@ bptrinc,_
@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptr inc,@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptrinc,@ bptrinc,_
@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptr inc,@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptrinc,@ bptrinc,_
@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptrinc,@bptr
pause 500
setfreq m4
sertxd ("$GPRMC,")
bptr =0: for b0 = 54 to 116 : bptr = b0: sertxd(@bptr) : next : sertxd(13,10)
'$GPGGA,161229.487,3723.2475,N,12158.3416,W,1,07,1 .0,9.0,M,,,,0000*18 - This is one of the GPS strings
setfreq m8
bptr =0: for b0 = 54 to 122 
bptr = b0
pause 5
serout b.5,n4800_8,(@bptr) 
next 
serout b.5,n4800_8,(CR,LF)
goto main
 

g6ejd

Senior Member
Most GPS modules have a default serial speed of 4800 baud, that said, a PICAXE can't reliably handle 9600 speeds.
 

du1mga

New Member
Hi,

sorry it took a while. I was carefully trying the examples. But not one of them works. Only garbage on the screen. When I connect the GPS to the Arduino I don't have any problem. It just work fine there.

I use an 08M02 speed m16 with GPS on pin4 (port 3)and the gps is the cheap one from eBay for 25 $US.
The type is: GPS Module MT3329 SKM53
It has only 9600bps. out

Regards du1mga
 

hippy

Ex-Staff (retired)
I was carefully trying the examples. But not one of them works. Only garbage on the screen.
Perhaps you need to use an X2 with background receive but garbage could suggest polarity or baud rate errors in the programs you have tried.
 

g6ejd

Senior Member
If your using an Arduino and it works, then on the PICAXE what polarity for the serial port are you using, it can't be the default... so please advise if you have a T or N in your PICAXE serial port setting?
 
Top