This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ADS8332 in manual trigger and manual channel selection

Other Parts Discussed in Thread: ADS8332

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;

  • Hi sanoj,

    Can you read CFR register with 0xC000 command? just check if your programming CFR register is successful. Was the data code is correct for the conversion on CH1? 200ms is really slow, I guess it just was used for test purpose, what's your SCLK frequency? It's better to get the data by monitoring the falling of EOC with an interrupt ISR.

    Thanks.

    Regards

    Dale

  • sir,

    I am able to read CFR with 0xC000 command only when I m doing nothing except reading CFR. But if in the 200ms timer ISR if I write the channel selection through SPI , reading the result, then if I try to read CFR it is showing junck values. If I use any single channel the result is ok, two or more channel is creating problem. I tried to get the EOC through Interrupt ISR then also Problem is there. my SPI clock freq is 3.4Mhz.

    The spi settings are:

    SPICCR=0x000F

    SPICTL=0x0006

    SPIBRR=10

    SPICCR= 0x008F     //reset=1

  • Firstly, I apologize for late response and just came back. For CFR register, only need to program once after power-on if no configurations are required to change. Reading CFR can be done after writing CFR register to check if the register programming  is correct or not. If the register programming works well, I suggest the test steps as below (applying the different level DC signals on the input of Channel 0 and Channel 1):

    1.  Write CFR register with 0xE6FD on SDI

    2.  Select Channel 0 with 0x0000 on SDI and Convert the signal on Channel 0  for a couple of times and Read these data with 0xD000 command

    3.  Switch to Channel 1 with 0x1000 on SDI and Convert the signal on Channel 1  for a couple of times and Read these data with 0xD000 command

    4.  Check if the conversion data on Channel 0 are correct

    5.  Check if the conversion data on Channel 1 are correct

    The key point is to make sure that the channel switch is successful. Please check the timing and make sure the timing is correct as well. Thanks.

    Regards

    Dale