sir,
i need to write a program like by varying the input voltage i can change the pulse width .For that i used the following code,but i dont know how to see the output and how should i coonnect potentiometer to change the input voltage.Plz help me.
#include <io430x22x4.h>
#include <intrinsics.h>
void main (void)
{
WDTCTL = WDTPW | WDTHOLD;
P2SEL = BIT6;
P2OUT = 0;
P2DIR = BIT6|BIT7;
P1OUT = BIT5;
P1DIR = BIT3|BIT5|BIT6|BIT7;
TACCR0 = BITA;
TACCTL0 = CCIE;
TACCR1 = BIT9;
TACCTL1 = OUTMOD_7;
TACTL = TASSEL_2 | ID_3 | MC_1 | TACLR;
ADC10CTL0 = SREF_0 | ADC10SHT_0 | ADC10ON;
ADC10CTL1 = INCH_1 | SHS_0 | ADC10DIV_0 | ADC10SSEL_0 | CONSEQ_0;
ADC10AE0 = BIT1;
ADC10CTL0_bit.ENC = 1;
for (;;)
{
__low_power_mode_0 ();
}
}
#pragma vector = TIMERA0_VECTOR
__interrupt void TIMERA0_ISR (void)
{
TACCR1 = ADC10MEM;
ADC10CTL0_bit.ADC10SC = 1;
}
regards
chandrika.