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.

ADS1148: Sample code example for ADC channel multiplexin

Part Number: ADS1148
Other Parts Discussed in Thread: , ADS1248

Hi Team,

One of our customer is using ADS1148 for industrial water quality sensing application. Customer is doing some fine tune works and requested help for any sample code example for ADC channel multiplexing. Does the code used in ADS1148EVM-PDK include multiplexing, if is available, can you share the sample code ? Thanks in advance.

  • Hi Don,

    There is example code for the ADS1148 in the following example project:

    http://www.ti.com/lit/zip/SBAC144

    This is not the EVM code, but rather code that can be easily adapted to any project and can be adjusted for any of the ADS1x4x devices in the ADS1248 or ADS1148 family.  The primary code used would be in the folder ADS1248 within the zip project.  To change the mux setting you would make a register write to the MUX0 register (register address 0x00) as shown in section 9.6.4.1 of the ADS1148 datasheet.  Bits 5:3 select the AINP input and bits 2:0 select the AINN input.  The function to use is ADS1248WriteRegister(int StartAddress, int NumRegs, unsigned * pData)) as shown in the file ADS1248.c in the example.

    StartAddress is the first address to be written, NumRegs is the number of registers you intend to write in this command, and pData is a pointer to the data to be transmitted.  The default settings for the MUX0 register is 0x01, so to change the mux to AINP=AIN2, and AINN=AIN3 (as an example), you would need to write the value 0x13 to the register.  You can see an example of the usage of the ADS1248WriteRegister command in the ADS1248InitConfig() function within the same .c file.  The function would be called like this to write the value 0x13 to the MUX0 register:

    unsigned int regArray[16];
    
    regArray[0] =  ADS1248_AINP2 |  ADS1248_AINN3;            //which is the equivalent to writing the value 0x13
    
    ADS1248WriteRegister(ADS1248_0_MUX0, 0x01, &regArray);    // Start at the first register and write one register the value in regArray

    Best regards,

    Bob B

  • Hi Bob,

    Thanks and appreciate for the detail feedback.

    We will share with customer accordingly.

    Regards,

    Don