- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
XAPP502 SlaveSeria l.c inconsiste ncy question
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
05-03-2012 10:29 AM
I was trying to figure out the correct bit-order to program a Spartan 3E using XAPP502. Looking at the example source code in SlaveSerial.c, I am confused as to the bit-ordering there. The code sends the bits out in this order:
DataOut = (Data16 & 0x0100) ? 1 : 0;
DataOut = (Data16 & 0x0200) ? 1 : 0;
DataOut = (Data16 & 0x0400) ? 1 : 0;
etc. to
DataOut = (Data16 & 0x8000) ? 1 : 0;
DataOut = (Data16 & 0x0001) ? 1 : 0;
DataOut = (Data16 & 0x0002) ? 1 : 0;
etc. to
DataOut = (Data16 & 0x0080) ? 1 : 0;
Then there is a comment below saying
/*BE CAREFUL THIS IS BYTESWAPPED!*/
The question is, why is it byteswapped when this is a Slave Serial application? XAPP502.pdf states " For this design, byte-swapped data is used for SelectMAP configuration but not for Slave-Serial configuration." So this code could not have worked? Or was the source file for some reason byte-swapped and the code corrects for this by swapping it back?











