Ublox GPS checksum in Oshonsoft BASIC

ericgibbs

Joined Jan 29, 2010
21,445
hi,
There is some Code or Text Format in your file that the Site software will not accept.

Report the problem in Feedback Forum.

E
 

jjw

Joined Dec 24, 2013
823
You are sending the bytes as a string instead of one single byte.
For example the first byte 0xB5 is sent as four characters "0" "×" "B" "5"

Call periph_wr() has no data to be sent.
When reading from the slave, the SPI master has to provide the clock by writing dummy bytes.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,830
You are sending the bytes as a string instead of one single byte.
For example the first byte 0xB5 is sent as four characters "0" "×" "B" "5"

Call periph_wr() has no data to be sent.
When reading from the slave, the SPI master has to provide the clock by writing dummy bytes.
Hi J,
I see.
I'll have another go.
C
 

jjw

Joined Dec 24, 2013
823
I don't know the ublox SPI protocol, but guess, that you should send the whole message before the ublox has the return message available.
Do you have the calculated checksum in your message?
 

Thread Starter

camerart

Joined Feb 25, 2013
3,830
I don't know the ublox SPI protocol, but guess, that you should send the whole message before the ublox has the return message available.
Do you have the calculated checksum in your message?
Hi J,
Yes, that sounds logical, as it wouldn't know what you are about to send, until it had been sent. I think 0xFF, are sent to retrive the return message.
In the CODE there is a Checksum calculator, which is yet to be implemented, so I used an example I found complete with checksum.
EDITED
C
 
Last edited:

sagor

Joined Mar 10, 2019
1,050
What the heck is this line for:

m2s(i) = m2s(i) + i

You are adding the loop counter to the value. So, M2S(1) will become 0x63 instead of 0x62, M2S(2) will become 0x0c instead of 0x0a, and so on....
All the values of your initial string will be totally different than what you initialized them as...
 

Thread Starter

camerart

Joined Feb 25, 2013
3,830
What the heck is this line for:

m2s(i) = m2s(i) + i

You are adding the loop counter to the value. So, M2S(1) will become 0x63 instead of 0x62, M2S(2) will become 0x0c instead of 0x0a, and so on....
All the values of your initial string will be totally different than what you initialized them as...
Hi S,
It reflects my level of coding. I sense it's not correct, and try different ideas.
I think I have a good example somewhere in my files, let's see if I can find it.
EDIT: I removed that line, and with different timing, it now works.
Thanks all,
C
 
Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,830
Hi,
I tested the program, which sends the correct sequence of BITEs to the GPS, but there is no MISO return.
If I can't get it to work with a known example, then I may not need the checksum calculator, and may have another solution to the reason for all of this.
There is a probable issue regarding the Clock polarity, so I'll start a fresh post.
Thanks.
C
 
Top