2440PWMTimer启动流程

来源:互联网 发布:程序员该怎么建立博客 编辑:程序博客网 时间:2024/05/01 14:42
start_pwm:
  1. Enable the auto re-load function
  2. Set the TCNTBn to  and the TCMPBn
  3. Set the manual update bit and configure the inverter bit (on/off). (The manual update bit sets TCNTn and TCMPn to the values of TCNTBn and TCMPBn)
  4. set the TCNTBn and the TCMPBn, to determine the next reload value
  5.  Set the start bit, provided that manual_update is 0 and the inverter is off and auto reload is on. The timer starts counting down after latency time within the timer resolution.
  6. Start end。

 Interrupt Service Routine (ISR)
  1.  TCNTBn and the TCMPBn are set for the next duration。
  2. auto reload and interrupt request are disabled to stop the timer。