K27 SPI Interrupt Mode Chip Select

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

K27 SPI Interrupt Mode Chip Select

Jump to solution
570 Views
santosh1
Contributor III

Hello, 

I have a K27 based board, and i am attempting to use interrupt based SPI transfers. I have got chip select set for PCS0, and the controller is the master.

cmdData.isPcsContinuous = true;
cmdData.whichCtar = kDSPI_MasterCtar0;
cmdData.whichPcs = MASTER_PCS;
cmdData.isEndOfQueue = false;
cmdData.clearTransferCount = false;

DSPI_ClearStatusFlags(SPI, kDSPI_AllStatusFlag);
DSPI_EnableInterrupts(SPI, kDSPI_RxFifoDrainRequestInterruptEnable|kDSPI_TxFifoFillRequestInterruptEnable);

DSPI_StartTransfer(SPI);

Chip select is not being pulled down when i attempt to use interrupt based transfers. In blocking mode, transactions are good - chip select is pulled down, Serial In and Serial Out can see data, and slave responds as expected. However when i attempt interrupt mode, Chip Select does assert at all - it just stays high. I followed the K28 example - would appreciate any pointers on what i am missing.

Thanks

Labels (1)
1 Solution
435 Views
EdgarLomeli
NXP Employee
NXP Employee

Hello Santosh

Your problem could be caused by a wrong configuration of the module.

PCSIS field in MCR register determinates the inactive state of chip select signal.

PCS config.PNG

In SDK example the follow instruction:

masterConfig.pcsActiveHighOrLow = kDSPI_PcsActiveLow

Ensures PCSIS equals 1 in PCS0 bit field in order to pull down chip select signal when the transmission starts.

Next pictures were taking when PCSIS[PCS0] value was zero and one respectively:

PCS High.PNG

PCS Low.PNG

Is your K27 presenting a similar behavior of the first picture?

Let me know your results.

Regards.

View solution in original post

1 Reply
436 Views
EdgarLomeli
NXP Employee
NXP Employee

Hello Santosh

Your problem could be caused by a wrong configuration of the module.

PCSIS field in MCR register determinates the inactive state of chip select signal.

PCS config.PNG

In SDK example the follow instruction:

masterConfig.pcsActiveHighOrLow = kDSPI_PcsActiveLow

Ensures PCSIS equals 1 in PCS0 bit field in order to pull down chip select signal when the transmission starts.

Next pictures were taking when PCSIS[PCS0] value was zero and one respectively:

PCS High.PNG

PCS Low.PNG

Is your K27 presenting a similar behavior of the first picture?

Let me know your results.

Regards.