EPIT Timer - LR and CMP but no Event on both?

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

EPIT Timer - LR and CMP but no Event on both?

跳至解决方案
924 次查看
benhenricksen
Contributor III

Hi, I have an iMX6-Solo dev board running Linux 3.10.17.

I'm looking to generate a pulse wave with the EPIT timer and the event output pin. The EPIT has a load register so you can choose an overall time and a compare register so you can choose another point within this time. But it seems you can only generate an event (pin state change) on the compare matching the count, not at the zero/reload point. If you want to have an interrupt at the reload point you have to set the compare to the reload value. So what's the point of having both these registers? Am I missing something?

Currently it looks like I have to swap reload values and output mode on every interrupt to get a pulse wave. Is this what is expected?

The GPT has a 1 clock length pulse option but it is being used as the Linux system timer.

标签 (1)
标记 (2)
0 项奖励
回复
1 解答
662 次查看
alejandrolozan1
NXP Employee
NXP Employee

Hi,

The behavior you are facing is correct:

According to the RM:

If an interrupt is required at rollover (when the counter value reaches 0x0000_0000 and the new value is loaded) then

the compare register value should be set equal to the load register value in set-and-forget

mode, or equal to 0xFFFF_FFFF in free-running mode.

Best Regards,

Alejandro

在原帖中查看解决方案

2 回复数
663 次查看
alejandrolozan1
NXP Employee
NXP Employee

Hi,

The behavior you are facing is correct:

According to the RM:

If an interrupt is required at rollover (when the counter value reaches 0x0000_0000 and the new value is loaded) then

the compare register value should be set equal to the load register value in set-and-forget

mode, or equal to 0xFFFF_FFFF in free-running mode.

Best Regards,

Alejandro

662 次查看
benhenricksen
Contributor III

OK, thanks for confirming the operation.

I have it working generating the pulse wave by swapping reload values and output mode on every interrupt.

0 项奖励
回复