16-bit QSPI transfer
Posted: Fri Feb 12, 2010 7:30 am
I've been playing around with the QSPI2Serial sample program. I ran into some problems trying to transfer 16-bit packets initially. I'm unfamiliar with the term "word align", however with a little fiddling I was able to get the transfer working. Below is a snippet of the modifications made.
The only thing that I don't like about this setting is that I had
to set the QueueBitSize to 18 instead of 16 which would have
made more sense
So from here I can see what the buffer sends and what the buffer recieves. Another thing I don't understand
is why I had to decrement the pointer address for both buffers.
Now is this the proper way to go about the problem or is it a quick solution that will
cause problems later on? Thanks for any input provided.
Code: Select all
//Initialize buffers
static BYTE RXBuffer[2], TXBuffer[2]= {0xAB,0xCD};
to set the QueueBitSize to 18 instead of 16 which would have
made more sense
Code: Select all
QSPIInit(3000000, //Baudrate
0x18, //QueueBitSize
0x1, //CS
0x0, //CSPol
0x0, //ClkPolarity
0x1, //ClkPhase
TRUE, //doutHiz
0x0, //csToClockDelay
0x0 //delayAfterTransfer
); // Keep overloaded defaults
is why I had to decrement the pointer address for both buffers.
Code: Select all
for (int i=0; i<=10; i++)
{
iprintf("TXBuffer is %X\n",TXBuffer[i]);
}
QSPIStart(TXBuffer-1, RXBuffer-1, 2, &QSPI_SEM); // Send data via QSPI
OSSemPend( &QSPI_SEM, 0 ); // Wait for QSPI to complete
iprintf("\n\n");
for (int i=0; i<=10; i++)
{
iprintf("RXBuffer is %X\n",RXBuffer[i]);
}
cause problems later on? Thanks for any input provided.