This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I configure xA, output controlled by CMPA,CMPB,CNT
My configuration as follow:
TBCTR Period Counter = 100, CNT = 0 Set xA output high , CMPA = 50 , Set output Low , CMPB = 50 , Do nothing
-> what happen while Counter = 50 ? will output xB be pull low or Still High?
优先级是基于某个时间进行排列的(CBU、CAU、ZERO等等),不是基于某事件对应的动作(SET、clear、do nothing).
所以,若果你的计数模式是UP-DOWN并处于up计数时,或者计数模式是UP,那么CBU - Do nothing 优先级就高于 CAU - Clear;
否则CBU - Do nothing 优先级就低于 CAU - Clear。
感谢答复, 请帮忙确认下:
我这么问吧, 配置 xA 输出配置, Zero -> SET CAU = 50 -> Clear , CBU = 50 -> Do nothing , PRD = 100 -> Do nothing
请问 当 Counter = 50 时, 输出是拉高 还是 拉低
按照 您的解释 CBU 的优先级高于CAU, Counter = 50 时 ,输出应该是CBU 控制,是 Do nothing , 从手册描述, Do nothing 是保持输出不变,就是
持续保持高电平不变 ,对吗?
你这么一说,让我有些不确定的。
要确认“Do nothing ”这个设定是“放弃控制权”还是“控制输出是保持上一时刻的电平”,至少我之前理解的是“保持上一电平”。
你可以用你的代码测试一下,CBU=“Do nothing ”,CAU = “SET”和“Clear”两种情况,看看输出如何。
我节后找个板子也试试,确认一下。
Hi,
Output of xA will output high on 0, then low on CMPA = 50. CMPB will have no affect since it's configured to do nothing so the output should still be high.