AnsweredAssumed Answered

AD7171: data conversion never ready

Question asked by jomag on Jun 26, 2017
Latest reply on Jun 29, 2017 by JellenieR

Hi

I'm incorporating AD7171 on a new board. I've so far assembled two of these with same result:

 

My problem is that the DOUT/RDY-pin never goes low after reset/power up. This is what I do:

 

 * Configure pins on the microcontroller (PDRST and SCLK as outputs on the microcontroller, DOUT/RDY as input)

 * Perform a reset: set PDRST hi for 300 ms, low for 300 ms, and hi again for 300 ms

 * Wait for DOUT/RDY to go low

 

But DOUT/RDY stays high no matter what.

 

If I leave the AD7171 in reset mode (PDRST lo) the DOUT/RDY goes into tristate as expected, causing the wait for DOUT/RDY to finish and garbage bits to be read. This makes me believe that the chip is not dead at least.

 

I'm currently bitbanging very slowly to be sure what happens. The microcontroller is an Atmel ATmega328P. Here's the code I'm using:

 

#define AD7171_RDY (PINB & (1 << 4))
#define AD7171_SCLK_LO PORTB &= ~(1 << 5)
#define AD7171_SCLK_HI PORTB |= (1 << 5);
#define AD7171_PDRST_LO PORTC &= ~(1 << 3)
#define AD7171_PDRST_HI PORTC |= 1 << 3

void ad7171_init()
{
    uint8_t i;
    uart0_send_string("ad7171 init\n");

    // !PDRST on PC3
    DDRC |= 1 << 3;

    // DOUT/!RDY on PB4
    // SCLK on PB5
    DDRB &= ~(1 << 4);
    DDRB |= 1 << 5;

again:
    uart0_send_string("toggle reset\n");
    AD7171_PDRST_HI;
    avr_delay_ms(300);
    AD7171_PDRST_LO;
    avr_delay_ms(300);
    AD7171_PDRST_HI;
    avr_delay_ms(300);

    uart0_send_string("await rdy\n");
    while (AD7171_RDY) {
        avr_delay_ms(1);
    }

    uart0_send_string("bits:\n");

    for (i = 0; i < 24; i++) {
        AD7171_SCLK_HI;
        avr_delay_ms(1);
        AD7171_SCLK_LO;
        avr_delay_ms(1);
        if (AD7171_RDY) {
            uart0_send('1');
        } else {
            uart0_send('0');
        }
    }

    uart0_send('\n');
    goto again;
}

I'll gladly post any additional info...

Outcomes