你上面加的那句代码:
FTM1->EXTTRIG |=FTM_EXTTRIG_INITTRIGEN_MASK;
If INITTRIGEN = 1, then the FTM generates a trigger when the FTM counter is updated
with the CNTIN register value in the following cases.
• The FTM counter is automatically updated with the CNTIN register value by the
selected counting mode.
可以看出,这个是会自动产生trigger的,每次FTM自动加载CNTIN的时候,就会产生trigger,这个就是你停不下来的原因。
因为FTM一直在跑,在trigger.
楼主你好!
你这样,不要用FTM_EXTTRIG_INITTRIGEN_MASK, 用通道trigger.
看看你用的是哪个通道,然后配置FTMx_EXTTRIG对应的CHnTRIG 位使能,因为那个为是:
Enables the generation of the channel trigger when the FTM counter is equal to the CnV register
而INITTRIGEN是:
Enables the generation of the trigger when the FTM counter is equal to the CNTIN register.
你选择通道CnV作为trigger,因为你的上升沿或者下降沿其实就是在counter等于CnV的时候实现的。
你可以试试看,如果还有问题,欢迎继续交流。
谢谢你及时的回复!因为我的项目对ADC采集速度要求比较高,以前考虑过用外部引脚中断或者FTM捕捉上升沿中断,然后在进入中断中软件触发ADC采集,这样的话可以实现但是进入中断需要时间,所以后面就考虑用FTM硬件触发,延时短。C:\Documents and Settings\Administrator\桌面
但是就跟你上面所说的,这种触发不受外部引脚的控制,我在想是不是自己对手册理解不到位所以在论坛上请教,现在看来需要另外想方法了