Go to Post The more women we have as 'rock stars' in FIRST, the more girls we'll see celebrating math and science and the doors they can open. - JaneYoung [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 18-01-2017, 11:42
codeman73 codeman73 is offline
Registered User
FRC #1024
 
Join Date: Jan 2017
Location: Indiana
Posts: 1
codeman73 is an unknown quantity at this point
pixy serial byte stream sometimes offset by a byte?

We are reading the serial stream with I2C. We've got the serial protocol figured out and have been able to decode the object data, most of the time. But sometimes it seems like the bytes in the data stream are offset by a byte. We could deal with it, if they were offset to the right, i.e. preceeded by a zero. Then we could just skip the first byte. But it's the other way around. It looks like the first byte we read is the sync word, but truncated.

For example, in a correct stream, we see the following:

0xaa55,0xaa55,checksum,signature, etc

But instead we see

0x55aa,0x55-then first byte of checksum

Yes we know about the little-endian-ness and are reading that correctly.

I searched a bit here first and found http://www.cmucam.org/projects/cmucam5/wiki/RoboRIO. The RoboRio code there seems to handle a similar condition. They look for

PIXY_START_WORDX 0x55aa

instead of the expected

PIXY_START_WORD 0xaa55

and then they just read a byte. But then wouldn't you be losing that first sync word, or everything following that would be off by a byte?

Any suggestions?
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 23:54.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi