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.

ADS8684: Could not programm register

Part Number: ADS8684

SDI running at 15MHz. I get AD values from device, but I am not able to change GAIN.

After Reset (Hardware) I try to initialize device by sending gain (+/- 0.6125Vref) for chan0...3

Then I like to set AUTO_Chan to chan 0,1,2

    for(i=0;i<CHAN;i++)                                                         // set gain for all 3 channels                                                      // configure chan0...2 GAIN to 0.625*Vref => +/-2.56V
    {    
        SS2_Clear();       
        SPI2BUF =  (uint8_t)(wrCH0gain[0])+(i*2);   // starting from 0x0B,0x0D,0x0E
        SPI2BUF =  (uint8_t)wrCH0gain[1];           // 0x02
        SPI2BUF =  (uint8_t)wrCH0gain[2];           // 0x00
        IFS1bits.SPI2TXIF = 0;        
        while(IFS1bits.SPI2TXIF == 0);
        SS2_Set();
        Nop();
        Nop();
        Nop();        
    }
    SS2_Clear();                                                                // configute auto chan sequencing 0,1,2
    SPI2BUF =  (uint8_t)wrCHANen[0];                // 0x03
    SPI2BUF =  (uint8_t)wrCHANen[1];                // 0x03
    SPI2BUF =  (uint8_t)wrCHANen[2];                // 0x00
    IFS1bits.SPI2TXIF = 0;    
    while(IFS1bits.SPI2TXIF == 0);
    SS2_Set();   

When adding "Standby" before code above there is no output amymore even I send a AUTO_RESTART (0xA0000000) every third sample request.

SPI2CONbits.STXISEL = 0;
SS2_Clear(); // set standby
SPI2BUF = 0x82;
SPI2BUF = 0;
SPI2BUF = 0;
SPI2BUF = 0;
IFS1bits.SPI2TXIF = 0;
while(IFS1bits.SPI2TXIF == 0);
SS2_Set();

Please advice by gining me a stepwise esbplanation

What do I have to send .... step by step from Reset to sample request,,,,

Thanks

  • I found the problem; I did not release reset before trying to configure. Anyhow the data sheet was a little bit unclear for me. Using a SPI interface that is able to transmit 32 bit, it was not transparent for me if I can use it to transmit 16 and 24bit frames as well in 32 bit format (by padding with 0 at the right place)

    So I changed to non interrupt 8 bit transfer. It would be great to make it more clear by adding some lines  in c or pseudo c explaining how to configure....

    Aslo when telling register address.... eg 5 which it B in write mode !! Make it more simple to read and add some examples !!! That help the user to understand faster examples, exampels, exampels

  • Hi Rupert,

    Thanks for the feedback and happy to hear that the issue is resolved.