Hi, I'm trying to use the QSPI-module on the MCF52235, be i can't get more than one byte transferred even though i put four bytes in the queue. If i put a oscilloscope to the data out, chip select and the clock-pin i see that the first byte gets transmitted, but the chip select is low (active low) for a 4 bit transfer. This is the code that i wrote:
MCF_QSPI_QMR = 0x51C4;
//Select the Command ram position and set up the command queue.
MCF_QSPI_QAR = 0x0020;
MCF_QSPI_QDR = 0x8200;
MCF_QSPI_QDR = 0x8200;
MCF_QSPI_QDR = 0x8200;
MCF_QSPI_QDR = 0x8200;
//Select the TRANSMT RAM and write the byte to transfer
MCF_QSPI_QAR = 0x0000;
MCF_QSPI_QDR = 0xAAAA;
MCF_QSPI_QDR = 0xBBBB;
MCF_QSPI_QDR = 0xCCCC;
MCF_QSPI_QDR = 0xDDDD;
//Set up the write queue pointers
MCF_QSPI_QWR = MCF_QSPI_QWR_ENDQP(4) | MCF_QSPI_QWR_NEWQP(0x00);
//Set the command to start the spi transfer;
MCF_QSPI_QDLYR |= MCF_QSPI_QDLYR_SPE;
//Wait until the operation has been completed
while (!(MCF_QSPI_QIR & MCF_QSPI_QIR_SPIF));
//Select the Receive RAM and get the result
MCF_QSPI_QAR = 0x0010;
*result++ = MCF_QSPI_QDR;
*result++ = MCF_QSPI_QDR;
*result++ = MCF_QSPI_QDR;
*result++ = MCF_QSPI_QDR;
This code shuld work i think, but like i said, i only get one byte transferred. Doe's anyone know what's wrong?
Best Wishes
Johnny Karlsson