How to realize QSPI 24bit communication

Discussion to talk about software related topics only.
Post Reply
zhangjie5168
Posts: 6
Joined: Sun Aug 05, 2012 8:27 pm
Location: tianjin China

How to realize QSPI 24bit communication

Post by zhangjie5168 »

I am a chinese user,how to realize the MOD5282's 24bit communication?
thank you.
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: How to realize QSPI 24bit communication

Post by dciliske »

If I understand you correctly, you wish to send 24 bits as a single transmission (not as three separate 1 byte sequences).

Here's the code for doing that.

Code: Select all

BYTE TXBuffer[4];
OS_Sem QSPI_SEM;
OSSemInit( &QSPI_SEM, 0 );
UCOS_ENTER_CRITICAL();
TXBuffer[0] = data[0];
TXBuffer[1] = data[1];
TXBuffer[2] = data[2];

// if you've set the hardware chip enable pin via QSPIInit ignore the pin_.CE lines
pin_.CE = 0; // set the hardware Chip Enable pin low
QSPIStart(TXBuffer, NULL, 3, &QSPI_SEM_); 
OSSemPend( &QSPI_SEM_, 0 );                     // Wait for QSPI to complete
pin_.CE = 1; // set the hardware Chip Enable pin high
UCOS_EXIT_CRITICAL();
Dan Ciliske
Project Engineer
Netburner, Inc
Post Reply