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!
Solved! Go to Solution.
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
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?
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