How to configure MPC5748G Master SPI2 to 40MHz using the SDK with Processor Expert?

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

How to configure MPC5748G Master SPI2 to 40MHz using the SDK with Processor Expert?

跳至解决方案
662 次查看
davidanderle
Contributor II

Hello,

I've been trying to configure SPI2 on the 176-pin package of the MPC5748G to 40MHz clock rate in S32DS v2.1. Although Processor Expert accepts this clock figure, the output clock is capped at 20MHz. What I mean by this is any baud rate I chose above 20MHz will be limited to 20MHz. Setting anything below that works perfectly fine. I am using the recommended external clocks and MPC5748G_SDK_Z4_0 3.0.0 SDK.

It is worth mentioning that I'm using DMA on both Tx and Rx and that my SPI mode is CPOL=0, CPHA=1.

Could someone please help me identify what might be wrong in my setup?

Thanks!

0 项奖励
回复
1 解答
638 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

check how CTAR register is finally configured and if it equals equations in CTAR description. Maybe just DBR is not set, I guess it is not set in the driver at all.

BR, Petr

在原帖中查看解决方案

0 项奖励
回复
2 回复数
636 次查看
davidanderle
Contributor II

Hi PetrS, 

You are right, the DBR bit is not set at all in the driver. I've created a simple patch for the clock prescale calculator and now I can see the 40MHz clock output. Thanks for highlighting this! Is there maybe an opensource git repository I could do a pull request for this code change?

 

0 项奖励
回复
639 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

check how CTAR register is finally configured and if it equals equations in CTAR description. Maybe just DBR is not set, I guess it is not set in the driver at all.

BR, Petr

0 项奖励
回复