I have to look into that error, but you might can use my other attempt of a 2-port driver, this one just uses one file and is more in line with FastSpin's drivers.
Sorry for not sending the code sooner. I cannot get anything working at 9600 baud. Tried serveral gps models from parallax all have 9600 baud.
Have had excellent experience with the P1 doing this in PropC or Spin. I looked at the Cogserial code as well as the fullduplexserial2 and I do not see anything obvious to me. Eventhough I am not an expert in asm language.
Thanks for the help.
as I was thinking it looks like you are using strings wrong.
Spin does not have types so a string is just a address in memory pointing to some memory location hopefully ending with a byte 0.
ser.str(string("test",10,13)) should work and output the text "test" followed by a new line.
It basically defines a 'string' of bytes in memory like
byte "test",13,10,0 and gives the memory address of that location to the function ser.str(…)
gpsraw := gpsd.rx
ser.str(gpsraw)
can not work
gpsraw is a long, a memory address where you can access 4 bytes. so your rx receives the lowest byte in gpsraw. As it should do. Say you get a "A" then gpsraw will be the number 65 stored at @gpsraw in memory.
But this is not a string. It is just a number in one of the 4 bytes described by gpsraw, defined as long.
ser.tx(gpsraw) will give you the character received...
Comments
Please look at the above code. Is there an issue with cogserial at 9600 baud?
Thanks
I have to look into that error, but you might can use my other attempt of a 2-port driver, this one just uses one file and is more in line with FastSpin's drivers.
Enjoy!
Mike
Thanks I will look at that.
Thanks for the try but getting the same. Hex spits out hex, dec spits out numbers str spits out gibberish.
Martin
Same with cogserial
you have to do something wrong.
can you post some code to look at?
Mike
Sorry for not sending the code sooner. I cannot get anything working at 9600 baud. Tried serveral gps models from parallax all have 9600 baud.
Have had excellent experience with the P1 doing this in PropC or Spin. I looked at the Cogserial code as well as the fullduplexserial2 and I do not see anything obvious to me. Eventhough I am not an expert in asm language.
Thanks for the help.
No rush.
Spin does not have types so a string is just a address in memory pointing to some memory location hopefully ending with a byte 0.
ser.str(string("test",10,13)) should work and output the text "test" followed by a new line.
It basically defines a 'string' of bytes in memory like
byte "test",13,10,0 and gives the memory address of that location to the function ser.str(…)
gpsraw := gpsd.rx
ser.str(gpsraw)
can not work
gpsraw is a long, a memory address where you can access 4 bytes. so your rx receives the lowest byte in gpsraw. As it should do. Say you get a "A" then gpsraw will be the number 65 stored at @gpsraw in memory.
But this is not a string. It is just a number in one of the 4 bytes described by gpsraw, defined as long.
ser.tx(gpsraw) will give you the character received...
Mike
I thank you for your help. I am attempting to port from the code in spin and PropC from P1. So we shall see.
Again thanks.
Martin
With fastspin you still can use FullDuplexSerial2.spin, there are examples you define FullDuplexSerial2.spin as a class and can use it from C.
Enjoy!
Mike