imx50 ecspi ss_ctl control

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

imx50 ecspi ss_ctl control

跳至解决方案
1,851 次查看
michaelcarrier
Contributor III

I have an IMX50 EVK that I am trying to connect to a spi device. Our implementation requires the ss_ctl line to be active low during the entire 2 bytes transmit transaction. I have configured ecspi2 to be the master device and I am using the provided mxc_spi.c delivered with the MCIMX50EVK dev D board. I configured spidev2.0 to be my particular user space spi driver. I am attempting to send 2 bytes (0x5511) out the escpi2 device. Using an oscilloscope I can see the 2 data bytes and the associated clock. The slave select line goes low during the time each byte is transmitted. However, in between each byte the slave select line transitions high. I need this to remain low until the 2 bytes have been transmitted.

From what I am reading setting bit 8 in ECSPIx_CONFIGREG and configuring ECSPIx_PERIODREG to 0 should produce a slave select waveform such that the slave select line remains low during idle byte periods. What am I missing here?

标签 (3)
0 项奖励
回复
1 解答
1,605 次查看
PeterChan
NXP Employee
NXP Employee

From i.MX50 reference manual 22.3.5.1.3, ECSPIx_CONFIGREG bit 8 should be clear (SS_CTL[0] is clear) for no SS negate between the SPI bursts. ECSPIx_CONREG:SMC must be 1 when using ECSPIx_CONFIGREG:SS_CTL to control the SS waveform.

Alternatively, you can set the ECSPIx_CONREG:BURST LENGTH=0x1F for 16 bit SPI burst and write 16-bit data to lower nibble of ECSPIx_TXDATA.

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,605 次查看
YixingKong
Senior Contributor IV

Michael, if Peter's answer is good, please click Correct Answer.

Thanks,

Yixing

1,606 次查看
PeterChan
NXP Employee
NXP Employee

From i.MX50 reference manual 22.3.5.1.3, ECSPIx_CONFIGREG bit 8 should be clear (SS_CTL[0] is clear) for no SS negate between the SPI bursts. ECSPIx_CONREG:SMC must be 1 when using ECSPIx_CONFIGREG:SS_CTL to control the SS waveform.

Alternatively, you can set the ECSPIx_CONREG:BURST LENGTH=0x1F for 16 bit SPI burst and write 16-bit data to lower nibble of ECSPIx_TXDATA.

0 项奖励
回复