|
这是TI提供的149里用TA作ADC12触发源的一个程序,既然选择OUTMOD_3模式,不明白为什么没有对TACCR0的设置?
#include "msp430x14x.h" // Standard Equations
void main(void){ WDTCTL = WDTPW+WDTHOLD; // Stop watchdog timer P6SEL |= 0x01; // Enable A/D channel A0 TACTL = TASSEL_2+MC_2; // Timer_A setup TACCTL1 = OUTMOD_3; // CCR1 setup TACCR1 = 0x0fff; // Compare value ADC12CTL0 = ADC12ON+SHT0_2; // Turn on ADC12, set sampling time ADC12CTL1 = SHS_1+SHP; // TAOUT.1 triggers sampling timer
while (1) { ADC12CTL0 |= ENC; // Enable conversions ADC12CTL0 |= ADC12SC; // Start conversion while ((ADC12IFG & ADC12BUSY)==0); ADC12CTL0 &= ~ENC; // Clear ENC bit, SET BREAKPOINT HERE } }
|
|