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.

I have to provide extra delay after DRDY LOW goes low-ADS1262

Other Parts Discussed in Thread: MSP430F6779, ADS1262

Hello,

             i  am using msp430F6779 and communicating with ADS1262 over SPI. i have an encountered an issue.

i apply an input signal to adc and wait for DRDY to go low . when DRDY goes low just after that if i issue a command to read data   it  read 0.

i have to provide a millisecond delay after DRDY goes low to read accurately.

why i have to provide delay after DRDY goes LOW??????

i used pulse and continuous  conversion mode both required delay but both shows different issues if i diddn't provide delay

  • Hi Sasuke,

    There should not be a need to include a delay after /DRDY goes low...

    - Perhaps your code is not waiting for /DRDY to go low, as you might expect.
    - There may be some other timing issue that delay is resolving. For example, a small delay (50 ns) is required between /CS low and the first SCLK.

    Have you tried looking at the SPI communication on an oscilloscope?

    Best Regards,
    Chris
  • hello chris,

    in my code after issuing START conversion command  i simply wait for DRDY to go low.

    do nothing when it goes low then issue command to read data . there i am facing this issue. if i remove delay it reads zero.

    i checked SPI communication over SPI it seems ok to me.

    //  in pulse conversion mode
    
    while(1)
    {
    cs_low;
    _delay_cycles(100);
    transfer_bytes(START1);
    
    wait for conversion to complete();     // this is an while(DRDY_HIGH)loop which wait till DRDY goes low.
    
    delay(250);    //genrate 250 ms delay       i am talking about this delay
    
    
    x[]= read_adc_data();
    
    
    switch_input_at_adc_channel();
    
    transfer_byte(STOP1);                     // stop start command to start bpulse conversion again
    
    }

    now in above code if i remove delay(250)  when i run first time drdy goes low but read zero  but it does not go HIGH again when loop runs second time. means issuing STOP START SEQUENCE doesn't start the conversion 2nd time (checked on oscilloscope).

    if i use delay it runs ok

    behaviour is different for continious conversion mode

  • Hi Sasuke,

    Likely, things will work better if you move the delay before the While loop.

    Waiting for /DRDY with a while loop can be very error prone, as you have very little control over the loop timing, especially if other processes are running on your microcontroller...If you can, try to utilize a fall-edge triggered interrupt.

    Best Regards,
    Chris

  • hi chris,

                         ithink i had did the same as you are suggesting. in wait for DRDY there is flag which is set in falling edge triggered ISR of DRDY [i have taken drdy as external interrupt].

    while(!DRDY_FLAG);
    
    external interrupt ISR()
    {DRDY_FLAG=1;}

    IS there any chance of this happening because i cant find any reason. is this hardware problem or something with my code

  • Hi Sasuke,

    You might double check that DRDY_FLAG is reset back to zero before enetering the while loop
    ...if you're skipping over the while loop you won't read valid data.

    Would you be able to provide a schematic and possibly an oscilloscope screenshot?
    ...It's hard to say whether the issue is in the software or if the hardware is preventing the software from caring out the instructions correctly.

    Best Regards,
    Chris
  • hi chris,
    thanks for your help, problem was in my code , actually in my program flow. now adc is working fine in both modes.