sir,
I am using SPI of 28335 to take data from ADS8332. Using a timer to generate an interrupt @200ms to read the two channels of ADC . In the ISR, first I am selecting channel 1 trying to read the result then selecting channel3, reading its value and coming out. Here I am getting result of only one channel i.e. result of analog input of channel1 in channel3 output. I am not able to debug the problem. Kindly help me. I am using Manual trigger and manual channel selection (0xE6FD). My ISR code is:
GpioDataRegs.GPBCLEAR.bit.GPIO41=1;//start of conversion
delay_loop();//260ns
GpioDataRegs.GPBSET.bit. GPIO41=1;
while(GpioDataRegs.GPBDAT.bit.GPIO42==0);//wait for EOC
delay_loop();
delay_loop();
SpiaRegs.SPITXBUF = 0xD000;
while (SpiaRegs.SPISTS.bit.INT_FLAG == 0);
Analog01=SpiaRegs.SPIRXBUF;
//****************adc channel 03********************//
delay_loop();
SpiaRegs.SPITXBUF = 0x3000;//channel 0
while (SpiaRegs.SPISTS.bit.INT_FLAG == 0) ;
GpioDataRegs.GPBCLEAR.bit.GPIO41=1;//start of conversion
delay_loop();
GpioDataRegs.GPBSET.bit. GPIO41=1;
while(GpioDataRegs.GPBDAT.bit.GPIO42==0);// EOC
delay_loop();
delay_loop();
SpiaRegs.SPITXBUF = 0xD000;
while (SpiaRegs.SPISTS.bit.INT_FLAG == 0);
Analog03=SpiaRegs.SPIRXBUF;