"Not working" is a broad topic. What Does it do? -------------- > TB0CCR0 = 100; // PWM Period With a PWM period of 100, any value you assign to CCR1 has to be ADCCTL0 |= ADCENC | ADCSC; // Sampling and conversion start > TB0CCR1=ADC_Result You're not waiting for the ADC to complete. Also, you're not enabling interrupts (GIE). I recommend you add > __bis_SR_register(LPM0_bits|GIE); // Enter LPM0, enabled between these two lines, so it waits for the ISR to run. -------------- Unsolicited: You're updating the PWM very fast, roughly once per cycle. This invites glitching. I suggest you also set CLLD, something like: > TB0CCTL1 = OUTMOD_7|CLLD_1; // CCR1 reset/set, update at start of cycle [Edit: Fixed wording slightly.]
↧