STM8S207 PWM在TIM1_CH3输出怎么实现,我没用库,怎么选择输出通道,我的程序是:
TIM1_PSCRL = 0x00; //定时器1预分频系数为1
TIM1_PSCRH = 0x00;
TIM1_ARRH = 0x01;//0140,320分频,16M/320=50K,实测49.75K
TIM1_ARRL = 0x3e;//自动装载寄存器低位;实测013e正好为50.0K
TIM1_CCR3H = 0x00; //占空比高位
TIM1_CCR3L = 0x3d; //占空比低位
TIM1_CCMR3 = 0x60; //PWM1模式
TIM1_CCMR3 |= 0x08; //输出比较3预装载使能
TIM1_EGR = BIT0;
//TIM1_CCER2 = 0x01; //开启OC3信号输出脚
TIM1_CR1 = 0x01; //内部计数器使能;
请高手帮我修改下,谢谢各位了。 |