Slow Run Mode and Normal Mode Togheter

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

Slow Run Mode and Normal Mode Togheter

757 次查看
p_decesare
Contributor III

Hi,

I have a question about the clock of s32k144. If I select the slow run mode I chose as clock FIRC clock that means CORE_CLOCK, BUS_CLOCK and SYS_CLOCK equal to 48MHz. So in my code I configured the ADC. In particular, the clock of ADC:

p_decesare_0-1601029717542.png

At the same time in my code I configured the CAN-Bus. The CAN has as clock SOSCDIV2 (NormalRunMode). The configuration of CAN and its clock:

p_decesare_1-1601029788184.png

To measure the Core Clock Cycles of ADC, I used the library #include <elapsed_time.h> and the functions: void elapsed_time_init(), void elapsed_time_start (uint32_t i), void elapsed_time_stop(uint32_t i).
In the main function, to quantify the time interval, necessary to have the conversion of ADC, I wrote (yellow line):
 

p_decesare_2-1601029998308.png

 

So if the difference is 992 and for the fact that there are configured both SlowRunMode and NormalRunMode, what could I do? I perform the ratio between 992 and 48MHz for the fact that the ADC works with FIRC clock?
It is possible to configure FlexCAN in order to have as clock FIRC clock?
Thanks for your help.
Sorry if this question is trivial, but I don't comprehend well the clock of the board.
Best regards,

Paola

0 项奖励
1 回复

741 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Paola,

The SlowRunMode and MormalRunMode are not modes of the MCU.

The MCU has the following run modes: RUN, HSRUN, VLPR.

If you use DWT to measure the execution time and the count difference is 992, then the elapsed time is 992 / CORE_CLK (SYS_CLK).

But it has nothing to the with the ADC clock.

The FlexCAN module can use either SYS_CLK or SOSCDIV2_CLK.

danielmartynek_0-1601376210648.png

 

Regards,

Daniel

 

0 项奖励