GPS NMEA, Failover Circuit upgrade attempt.

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Constantine, are you aware that all versions of the Picaxe editor, including yours, incorporates a virtual serial terminal to use in Simulation Mode?

Chris
upload_2016-8-13_0-42-2.png
 

HellasTechn

Apr 14, 2013
1,579
Joined
Apr 14, 2013
Messages
1,579
BTW, while reading through some of the code posted I noticed that the comments on the Pause 1 lines states "Pause for 1uS". That's actually a 1 millisecond (1mS) pause.
Removing it from the code didn't make any difference.
 

HellasTechn

Apr 14, 2013
1,579
Joined
Apr 14, 2013
Messages
1,579
Thinking about it now made me see that the Simulation is a nice tool but not flawless.
Think about it, when we where runnimg our first simulations and altering the code we used pin C.5 as GPS1 serin while the picaxe manual states that in order to use C.5 (which is not recommended) you have to use Hserin command. During simulations that did not produce an error. WHY ?

My next step will be to transmit NMEA sentences captured from the GPS from the PC to the picaxe useing some software (probably Hyperterminal if it can transmit) and see how the picaxe will react.

Any suggestions about communication software are welcomed !
 
Last edited:

HellasTechn

Apr 14, 2013
1,579
Joined
Apr 14, 2013
Messages
1,579
Could it be that this picaxe chip just isn't powerfull enough to execute this code and read gps data ?
Or do we need to run the picaxe a higher freq ?
 

HellasTechn

Apr 14, 2013
1,579
Joined
Apr 14, 2013
Messages
1,579
I used Termite program to send the captured nmea data to the picaxe and confirmed them with the Oscope.

Still the same.

I also used the old code that had no timeout commands and picaxe does not respond at all.

So there is nothing wrong with the GPS. there must be something wrong either with the picaxe chip or with the code.

I have ordered two 20M2 chips that i should be getting within the next two weeks. i will try the code on them also to see what happens.
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Thinking about it now made me see that the Simulation is a nice tool but not flawless.
Think about it, when we where runnimg our first simulations and altering the code we used pin C.5 as GPS1 serin while the picaxe manual states that in order to use C.5 (which is not recommended) you have to use Hserin command. During simulations that did not produce an error. WHY ?

My next step will be to transmit NMEA sentences captured from the GPS from the PC to the picaxe useing some software (probably Hyperterminal if it can transmit) and see how the picaxe will react.

Any suggestions about communication software are welcomed !
That's not exactly what the manual states. This is....
HSERIN var
- Var is a variable to receive the data byte.
Function:
Serial input via the hardware serial input pin (format 8 data, no parity, 1 stop).
Information:
The hserin command is used to receive serial data from the fixed hardware serial
input pin of the microcontroller. It cannot generally be used with the serial
download input pin - use the serrxd command in this case.
Baud rate is defined by the hsersetup command, which must be issued before this
command can be used.
Users familiar with the serin command will note the hserin command has a
completely different format. This is because the hserin command supports much
higher baud rates than serin, and so is unable to process received bytes ’on the fly’
(e.g. by changing ASCII into binary, as with the serin # prefix), as there is
insufficient time for this processing to occur before the next hserin byte is
received (at high baud rates). Therefore the raw data is simply saved in the
memory and the user program must then process the raw data when all the bytes
have been received.
Are you certain of the baud rate used by the GPS?
Chris
 

HellasTechn

Apr 14, 2013
1,579
Joined
Apr 14, 2013
Messages
1,579
That's not exactly what the manual states. This is....
Well ok but here it says :
http://www.picaxe.com/BASIC-Commands/Serial-RS232-Interfacing/serin/
***
Serial input with optional qualifiers (8 data, no parity, 1 stop).

The serin command is used to receive serial data into an input pin of the microcontroller. It cannot be used with the serial download input pin, which requires use of the serrxd command instead.
***

But still the simulation worked with serin command and pin c.5 as gps1 input
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
I doubt very much that 4800 baud is too fast for any Picaxe. If you have any doubts why not create another program to test it? I'm referring to simply receiving the GPS into the Picaxe and outputting that data to hyperterm?

Chris
 

HellasTechn

Apr 14, 2013
1,579
Joined
Apr 14, 2013
Messages
1,579
If you have any doubts why not create another program to test it? I'm referring to simply receiving the GPS into the Picaxe and outputting that data to hyperterm?

This is not a bad idea.

I doubt very much that 4800 baud is too fast for any Picaxe.

I can lower the baud rate and then use the Termite to transmit NEMA to the picaxe and see.
 

HellasTechn

Apr 14, 2013
1,579
Joined
Apr 14, 2013
Messages
1,579
I wrote this, which is supposed to echo back an NMEA sentence like the following:

$GPGSA,A,3,02,24,25,32,,,,,,,,,2.79,1.62,2.27*0E

main:
SERIN c.4, N4800_4, b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12
SERout b.1, N4800_4, (b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12)
goto main

In simulation it works. In real life it echoes back part of the sentence and the rest in characters i dont understand.

I will post them here later.

If Ashley could write a code that would echo back at least GSA sentence then may be able to figure out what is wrong.
 

Sadlercomfort

Ash
Feb 9, 2013
424
Joined
Feb 9, 2013
Messages
424
Are you sure its not supposed to be T4800_4 instead of N4800_4?

Testing this out wouldn't hurt.. I'm reading other peoples experiences with reading GPS NMEA data using PICAXE and they all use T.
 

HellasTechn

Apr 14, 2013
1,579
Joined
Apr 14, 2013
Messages
1,579
I will try that now and let you know.
In the meanwhile can you write a code where picaxe will echo back out to the pc whatever is getting from the GPS ?
Just to see that it reads correctly what it gets as input.
 
Last edited:

HellasTechn

Apr 14, 2013
1,579
Joined
Apr 14, 2013
Messages
1,579
Are you sure its not supposed to be T4800_4 instead of N4800_4?
I will try that now and let you know.

That didn't work either. Same response.
When i power up the picaxe without GPS connected it looks like it goes to "Both GPS tioeout state" and it stays like that even after i connect GPS to input 1 , 2 or both at the same time.
When i have the GPS connected on input 1 and power up the picaxe after, It looks like nothing at all happens. No Leds on or relay action, nothing untill i unplug the gps. after that it goes to "Both GPS tioeout state" and it stays like that again.

Below is a termote log of GPS output. it is slightly different that hyperterminal logs but GSA sentence is exactly the same.
 

Attachments

  • termite log.txt
    10 KB · Views: 131

HellasTechn

Apr 14, 2013
1,579
Joined
Apr 14, 2013
Messages
1,579
In the meanwhile can you write a code where picaxe will echo back out to the pc whatever is getting from the GPS ?
I really think we should try this and maybe it will give us a picture what Picaxe is reading. Given that the problem is that it reads data wrong an that it does not write them wrong which i dont think is the case because when i wtore the code to transmit the GSAhello, it wrote it correctly.
 

HellasTechn

Apr 14, 2013
1,579
Joined
Apr 14, 2013
Messages
1,579
Last edited:

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
In addition to the above i think we may need to use a MAX232 interface between the GPS and the picaxe.
Theese are rally cheap. I think i will order a few just to check.
This is the one i am thinking to order. Do you think this is suitable to accept 2 rs232 inputs and give out 2 TTL outputs ? (to use 1 chip for both GPS's)
http://www.ebay.com/itm/10PCS-MAX23...403746?hash=item3d17dd9962:g:AgMAAOSw14xXFKm9
I was thinking about this issue before you posted this. I'm referring to using a single 14M2 to receive two separate satellite signals. While Picaxe states that their chips can multitask it is not a true multi-threading capability. The chip is simply capable of making use of Pause commands to branch program flow to another task during the Pause period. This is obviously not true multi-threading.

Personally I think you'd be far better advised to use two 08M2 chips or two 14M2's if you need more GPIO pins. This way simultaneous GPS reception from two sat's would be totally independent.

BTW, I know just about zip with regard to GPS NMEA so I googled it and read this. My guess is that you've already visited these pages.

http://gpsworld.com/what-exactly-is-gps-nmea-data/
http://www.visualgps.net/

Chris
 

HellasTechn

Apr 14, 2013
1,579
Joined
Apr 14, 2013
Messages
1,579
Top