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.

对于msp430g2553定时器的一些不理解的地方。



#define OUTMOD2 (0x0080u) /* Output mode 2 */
#define OUTMOD1 (0x0040u) /* Output mode 1 */
#define OUTMOD0 (0x0020u) /* Output mode 0 */

#define OUTMOD_0 (0*0x20u) /* PWM output mode: 0 - output only */
#define OUTMOD_1 (1*0x20u) /* PWM output mode: 1 - set */
#define OUTMOD_2 (2*0x20u) /* PWM output mode: 2 - PWM toggle/reset */

这二者之间的区别,一直不明白。求帮忙。

下面的输出模式不是很理解,为什么输出模式 2,3,6 和 7 对输出单元 0 无效,因为在这些模式下,EQUx = EQU0??求帮忙,谢谢。。。

输出模式输出模式由 OUTMODx 位来确定,如表 8-2。对于所有模式来说(出来模式 0),OUTx 信号随着定时器时钟的上升沿而改变。输出模式 2,3,6 和 7 对输出单元 0 无效,因为在这些模式下,EQUx = EQU0。

  • wenzhi xie,

    Q1:

    OUTMOD0,OUTMOD1和OUTMOD2分别对应Timer TAxCCTLn寄存器中的OUTMOD(Bit5~7)的各个BIT;

    OUTMOD_0,OUTMOD_1,OUTMOD_2……是指TAxCCTLn寄存器中的OUTMOD的值对应为0,1,2……时TAxCCTLn的值。

    故其关系如下:

    OUTMOD_3=OUTMOD0+ OUTMOD1;

    OUTMOD_7=OUTMOD0+ OUTMOD1 + OUTMOD2

    Q2:

    输出模式 2,3,6 和 7是用于输出PWM波的,在EQUn的时候输出状态发生变化,在EQU0的时候也发生变化,故是CCr0决定PWM的周期,CCRx决定PWM的占空比,故其对输出单元0,CCR0无效。

    希望对你有帮助!O(∩_∩)O~