S32K344 LPSPI DUAL CLOCK MODE

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

S32K344 LPSPI DUAL CLOCK MODE

688 Views
MyLV
Contributor I

Hi NXP team,

I want to reduce Spi_AsyncTransmit() consumption on S32K344.

when I changed Core_LCK down to 80Mhz and the Spi_AsyncTransmit() executed time is 104 μs in result. if Core_LCK is 160Mhz then executed time is 52 μs.

According to RM, S32K344 support to 160Mhz in maximum.

MyLV_0-1693801157662.png

any suggestion to have done thru SPI configuration please?  

When I check on Lpspi_Ip_Cfg.h file there is LPSPI_IP_DUAL_CLOCK_MODE ( Dual clock configuration). I confused about it.

Could you explain?

@cuongnguyenphu 

 

 

0 Kudos
Reply
3 Replies

612 Views
MyLV
Contributor I

Hi @cuongnguyenphu 

Thank you for replying.

I want to reduce Spi_AsyncTransmit() executing time. It seem only Core_LCK (MCU configuration) impact on the processing time.

Is there any solution to reduce the Spi_AsyncTransmit() executing time through SPI configuration? 

Related to Clock, LPSPI_IP_DUAL_CLOCK_MODE is available inside SPI configuration.

From my understanding, the LPSPI_IP_DUAL_CLOCK_MODE allows user to change the clock mode at runtime, but it only effects the SPI data exchange rate, NOT the execution time of Spi_AsyncTransmit() right?

 

Best Regards,

MyLV

0 Kudos
Reply

562 Views
cuongnguyenphu
NXP Employee
NXP Employee

Hi @MyLV ,
Yes you're right, the setting LPSPI DUAL CLOCK MODE only effects to SPI data exchange rate.
To change Core_clk in runtime you should do as following:
1. Config 2 Mcu Clock setting mode, let's say: Clock Setting 0 for Core_Clk 80Mhz, and Clock Setting 1 for Core_Clk 160Mhz.
In S32CT, you can do this by below steps:
- In Clock tool, create 2 functional groups:

cuongnguyenphu_0-1695119255444.png

- Config Core_Clk for each Functional group

2. In Peripheral Tool, in MCU module, create 2 MCU Clock setting config coresponds to 2 Functional group of Clock tool in step1:

cuongnguyenphu_1-1695119433734.png


- Generate code.

3. In run-time, whenever you want to change the clock setting, just call  Mcu_InitClock(<param>) with <Param> is the ID of MCU clock setting, which is generated in Mcu_Cfg.h file

 



 

 

 

0 Kudos
Reply

643 Views
cuongnguyenphu
NXP Employee
NXP Employee

Can you explan your question in more detail please? I cannot understand your question

0 Kudos
Reply