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.

ads8166 read operation process

Other Parts Discussed in Thread: ADS8166

Hello, supporter

       i want to use auto sequence mode to scan AIN0~AIN7 in every 1ms duration(with AUTO_REPEAT = 0), from the Figure 46: 

    

on my understanding, the first time(the first 1ms), we should send AUTO-SEQ_CH and SEQ-START command, and readout 8 channels AD value in sequence.

but I am not clear, the next time(the second 1ms), shall we need send AUTO_SEQ_CH and SEQ_START command again to start a new AD read process?

  • Hello,

    Yes, you will need to clear the SEQ_START bit (set to 0) after the first time(the first 1ms) and then set SEQ_START to 1 when you want to scan the next time (second 1ms).  If you do not clear (set to 0) and then set to 1, after the first sequence of 8 channels, you will always read data from AIN0.

    You do no need to send the AUTO_SEQ_CH (SEQ_MODE[1:0]=10b) for the second 1ms scan, and can leave this configured for Auto sequence mode.

    Please let me know if your are able to get this to work.

    Regards,
    Keith Nicholas
    Precision ADC Applications

  • thanks for your answer,  my customer board is not got, and I just do write the ADC code,  and later, we can test it in our develop board.

    every time I read 14 channels and  it is divided into 1st 8 channels and 2nd 6 channels, it means 6 channels should use the same AIN0~AIN5, we design a switch MUX to realize it.  my application is as following, can you give some comments

     

    1. init ADC, send  AUTO_SEQ_CH (SEQ_MODE[1:0]=10b)

    2. in 1MS interrupt:

    2.1 , read 1st 8 channels

    MuxSwitch_8_Channels();


    AdcWriteReg(SEQ_START, 0x01); //start channel sequence

    WaitForAdcBusySignal();

    Read_8_Channels() ;

    AdcWriteReg(SEQ_START, 0x00);  //stop channel sequence

    2.2 , read 2nd 6 channels

    MuxSwitch_6_Channels();

    AdcWriteReg(SEQ_START, 0x01); //start channel sequence

    WaitForAdcBusySignal();

    Read_6_Channels() ;

    AdcWriteReg(SEQ_START, 0x00);  //stop channel sequence

    // AdcWriteReg(SEQ_ABORT, 0x01); //stop channel sequence via SEQ_ABORT

    2.3

    repeat to 2. 1MS interrupt

    With your advice, after read 8 or 6 Channels, I  send 0x00 to SEQ_START. And send 0x01 to SEQ_START for next.

    I am not sure in 2.2, I just read 6 channels (AIN0~AIN5), and directly stop the channel sequence, if this operation can be right? 

    And I check whether ADC converting is finished via ADC_Busy uprising signal.

    so, please give me some comments about my idea.

    thanks !

  • Hello,

    I assume you have an additional 2:1 multiplexer for each of the first 6 channels (AIN0 through AIN5). 

    Please note that there is not an internal FIFO inside of ADS8166, and that you must read the result for each channel.  The auto-sequence only changes the internal multiplexer channel.  After /CS goes high, the ADS8166 will increment to the next channel and start the conversion process for the previous channel.  Also, after /CS goes high, you can monitor the READY pin for a low to high, and then pull /CS low and read the conversion result of the previous channel.  You will need to monitor the READY pin each time /CS goes high before reading the conversion result data.  Another option instead of monitoring the READY pin is to keep /CS pin high for the maximum conversion time of ADS8166, t-conv-max=2500ns.  After this delay, the ADC conversion process will be complete and you can take /CS low to ready the results.

    Example to read first set of 8 channels:

    SET /CS low;
    Send 0x081C02h; Write DEVICE_CFG register, SEQ_MODE=10b for Auto sequence mode
    SET /CS high;

    SET /CS low;
    Send 0x081E01h; Write SEQ_START register, SEQ_START=1b to start channel scanning
    SET /CS high;

    Loop;  9 times for AIN0 through AIN7

    {

    Wait 2500ns; (maximum time need for a conversion to complete)

    SET /CS low;

    Send 0x0000h; Write NOP command and read 16b ADC conversion result; first conversion will be AINx, then AIN0, AIN1, AIN2, AIN3, AIN4, AIN5, AIN6, AIN7

    Store or Process 16b data received in SPI module;

    SET /CS high;

    }

    SET /CS low;
    Send 0x081E00h; Write SEQ_START register, SEQ_START=0b to clear bit
    SET /CS high;

    When you read through the second set of channels (6 channels) I suggest you read a total of 8 channels and discard the data from the unused channels (AIN6 and AIN7).  If not, the sequencer will get out of sync.  If you do not want to read the additional 2 channels, then you will need to set and clear the SEQ_ABORT bit to stop the current scanning sequence.

    Example to read 2nd set of 6 channels

    SET /CS low;
    Send 0x081E01h; Write SEQ_START register, SEQ_START=1b to start channel scanning
    SET /CS high;

    Loop;  7 times for AIN0 through AIN5

    {

    Wait 2500ns; (maximum time need for a conversion to complete)

    SET /CS low;

    Send 0x0000h; Write NOP command and read 16b ADC conversion result; first conversion will be AIN0, then AIN0, AIN1, AIN2, AIN3, AIN4, AIN5

    Store or Process 16b data received in SPI module;

    SET /CS high;

    }

    SET /CS low;
    Send 0x081E00h; Write SEQ_START register, SEQ_START=0b to clear bit
    SET /CS high;

    SET /CS low;
    Send 0x081F01h; Write SEQ_ABORT register, SEQ_ABORT=1b to stop channel scanning
    SET /CS high;

    SET /CS low;
    Send 0x081F00h; Write SEQ_ABORT register, SEQ_ABORT=0b to clear bit
    SET /CS high;

    Regards,
    Keith