Serial Communication byte $0f crash
flo
Posts: 38
I'm having strange behavior on my propeller when receiving a data packet that includes the byte $0f (decimal 15)
I apologize I can't post the code right now but this is what happens: I send a series of bytes to the prop and echo it back to my terminal. One of the bytes (doesn't matter which) is incremented by one and sent:
I noticed that ascii equivalent of $0f is <shift in>. Is it possible that the bits are shifting instead of being stored in the byte array? Or when they are being read they are interpreted?
Pseudo code:
I apologize I can't post the code right now but this is what happens: I send a series of bytes to the prop and echo it back to my terminal. One of the bytes (doesn't matter which) is incremented by one and sent:
07 00 00 00 00 00 00 00 07 00 01 00 00 00 00 00 07 00 02 00 00 00 00 00 07 00 03 00 00 00 00 00 ... 07 00 0c 00 00 00 00 00 07 00 0d 00 00 00 00 00 07 00 0e 00 00 00 00 00 ** NOTHING ** 07 00 f0 00 00 00 00 00
I noticed that ascii equivalent of $0f is <shift in>. Is it possible that the bits are shifting instead of being stored in the byte array? Or when they are being read they are interpreted?
Pseudo code:
counter := 0 recbyte := comm.rxcheck If recbyte <> -1 x[noparse][[/noparse]counter] = recbyte counter++ when counter == 8 iterate through x[noparse][[/noparse]] and comm.str(x[i]) and comm.str(carriage return) counter := 0 [/i]
Comments
You can turn the ascii control characters off in the parallax serial terminal by going into preferences and then choose the function tab.
Or your terminal program is interpreting it in this same manner.
The reason I'm echoing it is to debug. Normally, once the byte array is full I pass the pointer to another cog to process. This works great if $0f isn't in the byte array.
Something is happening between receiving and saving into the byte array. I know the other cog works fine because I echo back the string BEFORE I send the pointer to the other cog. Therefore, its crashing somewhere in the receiving and writing to memory area.
Post Edited (flo) : 3/16/2010 7:47:05 PM GMT
Why not post your actual code, instead of pseudocode, so we can take a look at it?
-Phil
-Phil
OOps, I'll fix that. But like Kwin mentioned, it's not the Extended_FDSerial as I don't do any NUM converts on receive.
It could be overwriting part of the program.