Problem with copying hex data
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-10-28 5:28 AM
Posted on October 28, 2015 at 13:28
Hello,
I have following problem with copying hex data.for
(i = 0; i < 6; i++) {
printf
(
''%02x''
, packet[i]);
// copy packet to FIFO
}
Printf copy data from packet[] to FIFO.
Everything is ok if copying data like these on first screenshot bellow (0xAA,0xBB,0xCC,0xDD).
But if copiyng different values (but with some data type - 0x01, 0x03, 0x00, 0x05) things going wrong. In the destination FIFO is 0x30, 0x30, 0x00, 0x00,... which is bad.
It is weird for me. Where can be a problem?
Thank you.
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-10-28 6:16 AM
Posted on October 28, 2015 at 14:16
The protocol is not very robust to character loss, might want a space, or synchronization byte to that the digits don't slip.
If there is an issue over the wire, look at the bit timings, and intersymbol spacing (ie increase stop bits)
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-10-28 1:13 PM
Posted on October 28, 2015 at 21:13
