Sign In

Don't have a Xilinx account yet?

  • Choose to receive important news and product information
  • Gain access to special content
  • Personalize your web experience on Xilinx.com

Create Account

Username

Password

Forgot your password?
XClose Panel
Xilinx Home
Reply
Visitor
pbrown@signalcraft.com
Posts: 2
Registered: ‎01-20-2012
0

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?