AUTOSAR OS

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

AUTOSAR OS

跳至解决方案
5,305 次查看
liuruowen
Contributor I

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?

 

0 项奖励
回复
1 解答
5,282 次查看
namnguyenviet
NXP Employee
NXP Employee

Hello,

FTM ticks can be calculated as below:

FTM ticks = Prescaler / Input Frequency.

While Prescaler can be chosen in EB tresos:

FTM1.JPG

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

在原帖中查看解决方案

0 项奖励
回复
4 回复数
5,283 次查看
namnguyenviet
NXP Employee
NXP Employee

Hello,

FTM ticks can be calculated as below:

FTM ticks = Prescaler / Input Frequency.

While Prescaler can be chosen in EB tresos:

FTM1.JPG

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

0 项奖励
回复
4,881 次查看
icypistol
Contributor I

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!

0 项奖励
回复
4,870 次查看
nxf31947
NXP Employee
NXP Employee

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

 
 
 
 
0 项奖励
回复
5,100 次查看
nxf31947
NXP Employee
NXP Employee

Actually, you can config tick duration( in nanoseconds ) like the picture below:

nxf31947_0-1611818696866.png

Sysgen will help you calculate clock divider value automatically
Check the generated output folder and you can see the define OSTICKDURATION 

0 项奖励
回复