i`ve been trying to interface an accelerometre using adc interrupts,,,all is well until the 3rd iteration of the 3-axis values.It outputs me the same values of all the three axis on putty after the 2nd iteration ..... let me post a screen shot of what exactly happens..plz observe the iteration carefully
this is my main....
void main()
{
k = 0;
portf();
adc();
ConfigureUART();
ADC0_ACTSS_R &= ~(ADC_ACTSS_ASEN1); //DISABLE SS1
ADC0_EMUX_R |= 0; //SOFTWARE TRIGGER
ADC0_SSMUX1_R |=0X0210; //1ST STEP A0(E3) : 2ND STEP A1(E2) : 3RD STEP A2(E1)
ADC0_SSCTL1_R |= (ADC_SSCTL1_END2|ADC_SSCTL1_IE0|ADC_SSCTL1_IE1|ADC_SSCTL1_IE2) ; //3RD SAMPLE IS END OF SEQUENCE
ADC0_ACTSS_R |=(ADC_ACTSS_ASEN1); //ENABLE
while(1)
{
if(((k%3) == 0) && (k>0))
{
k = 0;
UARTprintf("y?\t ");
delay();
UARTprintf("\n");
}
ADC0_PSSI_R = 0x0002;
while((ADC0_RIS_R&0x02)==0){};
result = ADC0_SSFIFO1_R;
ADC0_ISC_R = 0x0002;
if(k == 0){UARTprintf("x:");}
if(k == 1){UARTprintf("y:");}
if(k == 2){UARTprintf("z:");}
delay();
delay();
delay();
UARTprintf("%d ",result);UARTprintf("\t");
UARTprintf("\t");
k++;
ADC0_SSFIFO1_R = 0;
}
}
