K27 SPI Interrupt Mode Chip Select

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

K27 SPI Interrupt Mode Chip Select

跳至解决方案
1,072 次查看
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

标签 (1)
1 解答
937 次查看
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.

在原帖中查看解决方案

1 回复
938 次查看
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.