I use the sample project under this path(C:\NXP\AUTOSAR\S32K_AUTOSAR_OS_4_0_98_RTM_1_0_0\sample),so i have one question:
A SYSTEMTIMER counter is used in OsCounter in AUTOSAR OS,how to calculate the time of one tick?(This counter uses FTM0,what is the clock source of FTM0?)
What does the OsCounterTicksPerBase parameter do?
Solved! Go to Solution.
Hello,
FTM ticks can be calculated as below:
FTM ticks = Prescaler / Input Frequency.
While Prescaler can be chosen in EB tresos:
Prescaler = 2^(OsValue), e.g. OsValue= 2 => Prescaler = 2^2 = 4.
FTM input Frequency is pretty much depended on SystemInit, in the sample application, FTM input Frequency is FIRC: 48MHz.
OsCounterTicksPerBase is implementation specific and as I know, not used in this package.
Best Regards,
Nam
Hello,
FTM ticks can be calculated as below:
FTM ticks = Prescaler / Input Frequency.
While Prescaler can be chosen in EB tresos:
Prescaler = 2^(OsValue), e.g. OsValue= 2 => Prescaler = 2^2 = 4.
FTM input Frequency is pretty much depended on SystemInit, in the sample application, FTM input Frequency is FIRC: 48MHz.
OsCounterTicksPerBase is implementation specific and as I know, not used in this package.
Best Regards,
Nam
Thanks for your information.
Regarding your description of "FTM input Frequency is pretty much depended on SystemInit...", do you mean that, in this example, FTM0 input Frequency depends on the configuration for FTM0 in MCU Peripheral Clock Frequency?
By the way, it seems only FTM can be used as SystemTimer in HWCOUNTER. Does it means, the System Tick can not serve as the SystemTimer source in NXP Autosar OS? Thanks!
Regarding your description of "FTM input Frequency is pretty much depended on SystemInit...", do you mean that, in this example, FTM0 input Frequency depends on the configuration for FTM0 in MCU Peripheral Clock Frequency?
-> Yes, it will depends on SDK configuration
By the way, it seems only FTM can be used as SystemTimer in HWCOUNTER. Does it means, the System Tick can not serve as the SystemTimer source in NXP Autosar OS? Thanks!
-> choose System timer as SWCOUNTER and System Tick can serve as the SystemTimer
Because SysTick doesn't support as Hardware counter
Actually, you can config tick duration( in nanoseconds ) like the picture below:
Sysgen will help you calculate clock divider value automatically
Check the generated output folder and you can see the define OSTICKDURATION