How to Change SPI Baudrate With MCAL

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

How to Change SPI Baudrate With MCAL

跳至解决方案
2,272 次查看
biyangdong
Contributor II

Hello,I used S32K14X_MCAL4_3_RTM_HF4_1_0_1 Mcal version with Vector Davinci tools, i want change SPI baudrate in runtime,for example,spi_init() with baudrate 3.702Mhz,when one condition satisfied,i want to change the spi baudrate to 10Mhz,is there any api functions or ways in mcal code support this function,i can't find it from AUTOSAR_MCAL_SPI_UM file. the one ways i know from it is that change spi input clock by the api function Spi_SetClockMode.

 

SPI Baudrate.pngSPI Baudrate2.png

标记 (1)
0 项奖励
回复
1 解答
2,231 次查看
namnguyenviet
NXP Employee
NXP Employee

Hello,

Please check whether this node is available in your DaVinci Configurator:

namnguyenviet_0-1617690941302.png

After enabled SpiPhyUnitAlternateClockRef and refer to the MCU clock reference point, I can see SPI_DUAL_CLOCK_MODE is STD_ON. 

namnguyenviet_1-1617691028681.png

However, I'm not sure the same thing happens with DaVinci, cause I don't have DaVinci on hands.

Best Regards,

Nam

 

 

在原帖中查看解决方案

0 项奖励
回复
4 回复数
2,232 次查看
namnguyenviet
NXP Employee
NXP Employee

Hello,

Please check whether this node is available in your DaVinci Configurator:

namnguyenviet_0-1617690941302.png

After enabled SpiPhyUnitAlternateClockRef and refer to the MCU clock reference point, I can see SPI_DUAL_CLOCK_MODE is STD_ON. 

namnguyenviet_1-1617691028681.png

However, I'm not sure the same thing happens with DaVinci, cause I don't have DaVinci on hands.

Best Regards,

Nam

 

 

0 项奖励
回复
2,261 次查看
namnguyenviet
NXP Employee
NXP Employee

Yes, by calling Spi_SetClockMode(SPI_ALTERNATE), the SPI baud-rate can be changed to alternate baud-rate value during runtime.

 

0 项奖励
回复
2,245 次查看
biyangdong
Contributor II

Thanks for your reply.

but i also have a question,the configuration tools of EB tresos or davinci configurator haven't the configure item SpiEnableDualClockMode in SpiNonAUTOSAR group,the config code in Spi_Cfg.h this functon is off, i cann't to enable it and use,if this to say it is not support in S32K146 chips?

EBTresos configurator item.pngEBTresos configurator.png

 

Davinci configurator item.png

 

 

0 项奖励
回复
2,244 次查看
biyangdong
Contributor II

EBTresos configurator code.png

0 项奖励
回复