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

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

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

Jump to solution
787 Views
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 Kudos
Reply
1 Solution
763 Views
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

View solution in original post

0 Kudos
Reply
2 Replies
761 Views
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 Kudos
Reply
764 Views
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 Kudos
Reply