Hi NXP community
I'm trying to configure LPSPI0 master to transmit at 4,8MBaudrate in RUN mode, but I have some issues that I explain below. I'm working with the s32k148 EVB and S32DS IDE (Version 3.4).
First of all I try to set LPSPI0 master at 2,4MBaudrate. The applied settings can be seen in the following images.
When I check it in oscilloscope it seems that the transmitted frame contains the correct information I wanted to send, but at a lower baud rate than I set. The actual baud rate being applied is 2MBaudrate.
Then I try to set LPSPI0 at 4,8MBaudrate with LPSPI0_CLK_SEL = 24MHz (FIRCDIV2 / 2). When I check it in oscilloscope the sent frame was altered and the baud rate of the transmission was lower than that set (4MBaudrate).
I seem to be applying incorrect settings to the LPSPI source clock but I don't see what's going on. Any suggestion?
Thanks in advance.
take a look at the function : LPSPI_SetBaudRate();
this function takes in the desired baud rate and calculates the nearset possible baud rate,and retures the calculated baud rate in bits-per-second.
in other words, this function will change the set baudrate to the nearset possible baud rate.
BR!
Jim,
Hi @Senlent,
Thanks for the reply!
I checked the return value of the function LPSPI_SetBaudRate() and coincides with the devition I was saying.
But there’s still one thing I don’t understand. When I set LPSPI0 at 4,8MBaudrate with LPSPI0_CLK_SEL = 24MHz (FIRCDIV2 / 2), there seems to be a pause in the middle of the 4 bytes I’m sending.
Then I tried to sending the same frame with the same baud rate but switching to to HSRUN mode. This pause disappears, do you know what it might be due to?
I haven't had this problem before, but I feel that it has something to do with the clock configuration of some modules. Without more information, I can't judge the possible reasons.can you tell me which routine you use?
BR!
Jim,
Hi @Senlent
Sorry for the late response.
To isolate the problem as much as possible I have done a project that only sets LPSPI0 as master with the parameters discussed in the previous post. The program makes an infinite loop that only makes transmissions and wais. That way you can see the problem I'm talking about with the oscilloscope.
If you need to clarify anything about the management or configuration I do in the LPSPI interface, please let me know.
Best regards,
ok, i probably won't have time to test for you until next week
Hi @Senlent
Any news?