LPSPI with GPIO as Chip Select and Changing CPOL / CPHA (i.MXRT1050/1160)

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

LPSPI with GPIO as Chip Select and Changing CPOL / CPHA (i.MXRT1050/1160)

Jump to solution
318 Views
christian_mauderer
Contributor III

Hello,

I'm working with an application that runs on a i.MXRT1050 and 1160 with a custom LPSPI driver. I use GPIOs for the chip select pins.

Unluckily, I have two SPI devices connected, that use different CPOL settings. So I have to switch these settings between the transfers. With GPIOs as chip select, I first set the GPIO and then start the transfer via TCR / TDR. Due to that, the idle level of the clock line changes after the chip is selected and the device chip interprets that as a clock.

Is there a possibility to manually set the idle level of the SPI clock line between two SPI transfers without doing a whole byte of dummy transfer?

With kind regards

Christian

0 Kudos
1 Solution
291 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @christian_mauderer,

Unfortunately, there is not possible to manually set the idle level of the SPI clock line between transfers without doing a whole byte of dummy transfer. As mentioned in the i.MX RT1050 Processor Reference Manual, the CPOL bit cannot be modified during a data transfer:

RaRo_0-1699988209705.png

[Table 47-3. LPSPI Command Word in Master mode]

Kind regards, Raul.

View solution in original post

2 Replies
292 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @christian_mauderer,

Unfortunately, there is not possible to manually set the idle level of the SPI clock line between transfers without doing a whole byte of dummy transfer. As mentioned in the i.MX RT1050 Processor Reference Manual, the CPOL bit cannot be modified during a data transfer:

RaRo_0-1699988209705.png

[Table 47-3. LPSPI Command Word in Master mode]

Kind regards, Raul.

275 Views
christian_mauderer
Contributor III

Hello @RaRo,

thanks for your response. It's what I assumed. I'll find a way to work with it.

With best regards

Christian Mauderer

0 Kudos