i.MX RT1020 LPSPI, how to keep the PCS asserted

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

i.MX RT1020 LPSPI, how to keep the PCS asserted

1,572 Views
michael_imxrt
Contributor I

Hello community,

I'm currently working on a digital radio station. For the GUI I prefer to use a TFT LCD with the very known driver IC ili9341. This chip offers various interfaces and so I decided to use the LPSPI1 peripheral from my microcontroller i.MX RT1020.

Problem: For the communication i have to keep the PCS pin asserted over multiple frames and so I enabled the 'continuous transfer' bit in the register TCR of the corresponding LPSPI module. Since I set this bit, the communication hasn't worked correctly. After the first transfer, the PCS pin keeps asserted although I started a new frame. Could you give me an advice how to use the 'continuous transfer'-bit correctly?

Best regards
Michael

Tags (1)
0 Kudos
6 Replies

1,554 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi Michael,

Continuous transfer bit keeps PCS asserted between frames so I think is working as expected according to your description. Could you please clarify what exactly is not working correctly?

Best regards,

Felipe

0 Kudos

1,531 Views
michael_imxrt
Contributor I

Hi Felipe, 

Now I tried to work with the LPSPI functions provided by the SDK, and the program gets stuck in this function: 

while ((LPSPI_GetStatusFlags(base) & (uint32_t)kLPSPI_TransferCompleteFlag) == 0U);

It seems, that the peripheral isn't able to complete the transfer, could you give me any advice how to solve this problem? 

Thank you!

0 Kudos

1,506 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi,

Can you interconnect two LPSPI modules within the same board? This will help us discard some issue in the configuration.

Additionally, you mentioned that the SDK example worked fine, if this is correct then you can compare register configuration between SDK code and your code to see what exactly you are configuring wrong. My best guess so far is thar LPSPI is not correctly configured according to what the LCD requires.

Best regards,

Felipe

0 Kudos

1,503 Views
michael_imxrt
Contributor I

Hi Felipe,

Thanks for your reply, I recently tried to use the SDK example within my software and found out, that it has the same issue. In addition to that I can assure you, that the LCD has nothing to care about (at this point of development), because I'm only sending data.

Could you please show me an example of how to use the continuous transfer mode correctly?

Thank you!

0 Kudos

1,446 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi Michael,

We have APIs to enable continuous transfer in the SDK drivers but unfortunately, there is no example already implemented of this.

Best regards,

Felipe

0 Kudos

1,541 Views
michael_imxrt
Contributor I

Hi Felipe,

I the problem is: I need to keep the PCS asserted between the frames of a transfer. When I enable the continuous transfer mode, the transfer doesn't compete any longer (according to the TCIF bit). So the program gets stuck in an infinite loop. Could you show me a code example for the continuous transfer mode (except the SDK example, which works fine, but I couldn't find the main problem there)

Best regards
Michael

0 Kudos