cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Anonymous
Not applicable
2,799 Views

XAPP502 SlaveSerial.c inconsistency question

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?

 

0 Kudos
0 Replies