正式文档中有如下一段:
1.4.9 GP Timer Compare Output
The compare output of a GP timer can be specified active high, active low,
forced high, or forced low, depending on how the GPTCONA/B bits are configured.
It goes from low to high (high to low) on the first compare match when
it is active high (low). It then goes from high to low (low to high) on the second
compare match if the GP timer is in an up-/down-counting mode, or on period
match if the GP timer is in up-counting mode. The timer compare output becomes
high (low) right away when it is specified to be forced high (low).
我设置工作模式为up-/down-counting mode,请问是不是可以这样理解:
首先,输出设置为forced high ,此时管脚输出为高电平,然后设置为active low,然后开始计数,当计数器与比较器第一次匹配后,管脚输出变为低电平,以后每匹配一次,管脚输出电平翻转一次。
换句话说:当设置管脚输出为forced high(low)后,那么以后当计数器与比较器每匹配一次,管脚电平就反转一次;还是说根据active high(low)进行相应的翻转。
我的使用方式是:无论前一次管脚输出电平状态是什么,现在我想把管脚输出设置为低电平,然后后当计数器与比较器每匹配一次,管脚电平就反转一次,我应该按怎样的流程设置呢?
谢谢!