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.

ADS122C04: any have example code of ADS122C04 with interface STM32 Microcontroller ?

Part Number: ADS122C04
Other Parts Discussed in Thread: ADS1115

any have example code of ADS122C04 with interface STM32 Microcontroller ?

  • Hi Aditya,

    Welcome to the E2E forum! Unfortunately we do not have any example code specific to the ADS122C04 at this time.  The ADS122C04 uses standard I2C protocol and 7-bit addressing mode.  The details for communication are shown in the ADS122C04 datasheet.  If you have specific questions on any issues you may be having with the ADS122C04 I would be glad to help.  However if you need help in setting up the micro peripheral I unfortunately cannot help you with a competitor device.

    Best regards,

    Bob B

  • Thanks for your reply 

    I Am confused in four config register , how to set the config register

  • Hi Aditya,

    The register write sequence is given in the ADS122C04 datasheet in Figure 59.  Where the WREG command may be confusing is that each register must be addressed with the WREG command separately.  The sequence shown in the figure shows multiple registers being written, so as long as there is no STOP condition you can write from one to up to four registers in a single sequence.  The easiest method to start with is to just write one register at a time.  For each of the four registers you do the following:

    • I2C START condition
    • Slave Address with a WRITE
    • Write register 0 by sending byte 0x40
    • Write desired register configuration data
    • I2C STOP condition
    • I2C START condition
    • Slave Address with a WRITE
    • Write register 1 by sending byte 0x44
    • Write desired register configuration data
    • I2C STOP condition
    • I2C START condition
    • Slave Address with a WRITE
    • Write register 2 by sending byte 0x48
    • Write desired register configuration data
    • I2C STOP condition
    • I2C START condition
    • Slave Address with a WRITE
    • Write register 3 by sending byte 0x4C
    • Write desired register configuration data
    • I2C STOP condition

    Note that in the information above I gave the register write command needed for each of configuration registers.  Also, you only need to write to the registers you wish to change.  You do not necessarily need to write every register.

    Best regards,

    Bob B

  • Thank You For Your Reply 

    This is same Like ADS1115 Right ?????

  • Hi Aditya,

    It is similar to the ADS1115 in that both use I2C communication.  However the ADS122C04 is command based.  For example, to read/write to the ADS1115 you first set the position for the register pointer that you wish to read/write and then you would issue the read or write to that register.  Also, the registers for the ADS1115 are 16-bit registers.

    The ADS122C04 uses 8-bit registers and is command based in that you write a command first before reading/writing registers or retrieving the data.

    Best regards,

    Bob B