此帖出自微控制器 MCU论坛
最新回复
P3SEL |= BIT5+BIT6; // P3.5-7.6 option select
P3DIR |= BIT5+BIT6; // P3.5-7.6 outputs
P5SEL |= BIT7; // P5.7 option select
P5DIR |= BIT7; // P5.7 outputs
P7SEL |= BIT4+BIT5+BIT6; // P7.4-7.6 option select
P7DIR |= BIT4+BIT5+BIT6; // P7.4-7.6 outputs
TBCCR0 = 512-1; // PWM Period
TBCCTL1 = OUTMOD_7; // CCR1 reset/set
TBCCR1 = 383; // CCR1 PWM Duty Cycle
TBCCTL2 = OUTMOD_7; // CCR2 reset/set
TBCCR2 = 128; // CCR2 PWM duty cycle
TBCCTL3 = OUTMOD_7; // CCR3 reset/set
TBCCR3 = 64; // CCR3 PWM duty cycle
TBCCTL4 = OUTMOD_7; // CCR4 reset/set
TBCCR4 = 32; // CCR4 PWM duty cycle
TBCCTL5 = OUTMOD_7; // CCR5 reset/set
TBCCR5 = 16; // CCR5 PWM duty cycle
TBCCTL6 = OUTMOD_7; // CCR6 reset/set
TBCCR6 = 8; // CCR6 PWM duty cycle
TBCTL = TBSSEL_2+MC_1; // SMCLK, upmode
TB 和TA是一样配置PWM
详情
回复
发表于 2014-8-6 16:57
| ||
|
||
此帖出自微控制器 MCU论坛
赞赏 | ||
|
||
此帖出自微控制器 MCU论坛
| ||
|
||
EEWorld Datasheet 技术支持