|
TI MSP430 TimerA的输出从P1.0输出,TimerB的输出从P1.1输出.怎么设定?
[复制链接]
TI MSP430问题:
我想把TimerA的输出从P1.0输出,TimerB的输出从P1.1输出.
可是430怎么才知道是TimerA 给P1.0 而不是P1.1呢? P1SEL设了1,然后呢?
P1DIR = 0x3; //P1.0 ouput
P1SEL = 0x3; //timerA output P1.0
TBCTL = TBSSEL1 + TBCLR; // SMCLK, clear
TBCTL = MC_1+CNTL_0+TBCLGRP_0; //up,16 bits
TBCCTL0 = CCIE; //timer seting
TBCCTL1 = OUTMOD_7+CLLD_1; //mode 7
TBCCR0 = 511; //PWM freq
TBCCR1 = 128; //duty cycle
|
|