2024-05-20 04:14 AM
Hello everyone! I would like to ask about the DSPI baud rate setting for the SPC582BE1 microcontroller. As shown in the following figure, when using the SPC5828XX-RLA DSPI Test Application for Discovery routine, I found that the default setting for Baud Rate Prescaler is PRE5 and Baud Rate Divider is DIV2 The Baud Rate (Bit/s) is 8000000, and I used a logic analyzer to collect the SCK signal line of DSPI and found it to be 1.25MHz! I would like to ask how did this 1.25MHz come about? Can you tell me?
Solved! Go to Solution.
2024-05-20 05:42 AM
Hello,
the test SPC582Bxx_RLA DSPI Test Application for Discovery configures three configurations:
in the main loop, the first two configurations are used in alternate way.
So, I suspect you are capturing the second DSPI transaction which is at 125000 bps.
Here the code in the application main loop:
Regards,
2024-05-20 04:58 AM - edited 2024-05-20 04:59 AM
Hi,
i dont know your cpu...but:
> how did this 1.25MHz come about?
Obviously your clk setting is wrong.
You have 40M clk in ? But you have prediv 2 , so 20M ; and you set 80M as PLLin , but is 20M...set 20M here.
+
To check real clock, activate Clkout , check whats coming - and what it should be. Adjust your settings, until ok.
2024-05-20 05:42 AM
Hello,
the test SPC582Bxx_RLA DSPI Test Application for Discovery configures three configurations:
in the main loop, the first two configurations are used in alternate way.
So, I suspect you are capturing the second DSPI transaction which is at 125000 bps.
Here the code in the application main loop:
Regards,
2024-05-20 06:03 AM
Just for info:
the formula to calculate the baud rate:
br = double_br * (DSPICLK0_CLK / (br_prescaler * br_divider));
where
Best Regards
2024-05-20 06:40 AM
Thank you very much!