Hi, I have a design that connects a Spartan 3e running a Microblaze soft-core with an SPI unit attached to the OPB bus to a 16 Bit DAC unit (DAC8534). The data I send to the DAC unit has the bit order reversed. The SPI_OPB pheripheral has no way of reversing the shift out order from what I can see. Below is a program snippet of sending data to the dac unit:
------------------------------------------------------------------------------------------------------------------------- // Select the DAC Unit XSpi_mSetSlaveSelectReg(XPAR_SPI_DAC_BASEADDR, SPI_DAC_SELECT);
// Set the message data. send_data[0]=0x20; // Control Register send_data[1]=0x0F; // Upper 8 bit value send_data[2]=0x0F; // Lower 8 bit value
// Send the message data. spi_transfer(send_data, 3);
// Deselect the DAC Unit XSpi_mSetSlaveSelectReg(XPAR_SPI_DAC_BASEADDR, SPI_NONE_SELECT);
-------------------------------------------------------------------------------------------------------------------------
The data sent to the dac unit appears as 0xF0F0 instead of 0x0F0F disregarding the control byte. Does anyone know of how I can reverse the bit order at a minimal overhead cost. Can you give an example of bit order reversing?
Thanks, Aaron Curtin