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: Linux Driver for ADS8166

Part Number: ADS8166
Other Parts Discussed in Thread: AM4378,

Hello,

In our project, we have few sensors that will integrate with AM4378 SOC via ADS8166 ADC chip. We searched for the Linux driver of ADS8166, but we didn't find any driver for this ADC chip.

So is there any Linux driver available for ADS8166? Or we need to write it.

Thanks.

  • Hello,

    Welcome to the TI E2E community!

    We do not have any Linux drivers for the ADS8166.  The below pseudo-code may help you write your own driver.

    Regards,
    Keith Nicholas
    Precision ADC Applications

    The below example configuration will setup the ADS8166 to auto scan through AIN0, AIN1, AIN2, and AIN3.

    • The following configuration assume a 4-wire SPI interface, where the MCU is the controller
      • Plus a dedicated GPIO for hardware reset.
      • Total of 5 lines from MCU
      • SPI module signals (SCLK - host output, MOSI -host output, MISO - host input),
      • GPIO signals (/CS - host output,  /RST - host output).
    • Configure microcontroller for SPI mode 0 (CPOL=0, CPHA=0)
    • Configure microcontroller GPIO as output for /CS
    • Configure microcontroller GPIO as output for /RST
    • Reset ADC

    Example Pseudo Code for above operation:

     

    • Configure microcontroller for SPI mode 0 (CPOL=0, CPHA=0)
      • MOSI -> SDI pin
      • MISO <- SDO-0 pin
      • CLK -> SCLK pin (Recommend 10MHz to support Fs up to 100ksps)
    • Configure microcontroller GPIO as output for /CS
    • Configure microcontroller GPIO as output for /RST

     

    • Set  /RST low; Reset ADS816x with default values in all registers
      • Delay 100nS;  Minimum reset time pulse width
    • SET /RST high;
    • SET /CS low;
      • Send 0x081802h; Write OFST_CAL register, REF_SEL=010b for Vref=4.096V
    • SET /CS high;
    • SET /CS low;
      • Send 0x081C02h; Write DEVICE_CFG register, SEQ_MODE=10b for Auto sequence mode
    • SET /CS high;
    • SET /CS low;
      • Send 0x08800Fh; Write AUTO_SEQ_CFG1 register, Enable channels AIN3, AIN2, AIN1, AIN0Auto sequence mode
    • SET /CS high;
    • SET /CS low;
      • Send 0x088201h; Write AUTO_SEQ_CFG2 register, AUTO_REPEAT=1b for repeat scanning
    • SET /CS high;
    • SET /CS low;
      • Send 0x081E01h; Write SEQ_START register, SEQ_START=1b to start channel scanning
    • SET /CS high;

     

    • Configure MCU timer resource for Sample rate period, for example, 100uS repetition rate for 10ksps.
    • Loop;  Infinite loop for continuous conversions or fixed number for data block.

    {

    Wait for timer trigger; (sets desired sample rate)

    SET /CS low;

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

    Store or Process 16b data received in SPI module;

    SET /CS high;

    }