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.

ADS7142: ADS7142 manual mode dual channel single-ended for STM32

Part Number: ADS7142

Hi,

I am currently working on a STM32 library for the ADS7142. Communication and programming works fine, but polling conversion data doesn't work yet.

I can set the start conversion bit and verify it using the conversion status register, but the ADC only returns a constant (non-zero) value when polled (before verifying the status, afterwards it only returns zeroes).
I  would expect the data to change when a voltage is applied or for the least significant bits to at least fluctuate, but neither is the case.

What could be the problem?

  • Does a normal I2C read command with 4 cycles not suffice to read out one full conversion?
  • Do I need to wait for a certain time before starting the read command?
  • Do I need to provide continuous clock cycles and pick out the right data from there?

Please be aware that my organization has worked with STM32 for a long time, we are not looking to swap to a TI controller.

Thanks,
Lukas

  • Hi Lukas,

    Apologies for the delay.

    Are you polling the DATA_BUFFER_STATUS register? Also, what mode are you using the device in? It would be helpful if you can send over the register configurations. Is this something you can provide?

    Please find my comments to your questions below: 

    1. There should be 6 I2C cycles for reading the conversion register. The first three cycles contain the device address, the OPCODE, and the register(s) to read. The next three cycles will be setting the device address and then two bytes of data. 

    2. When checking the conversion register, you want to make sure a channel has been converted. This time depends on the nCLK parameter in teh nCLK register. How much time after initiation the conversion are you waiting before reading the conversion register?

    3. There should be continuous clock cycles provided. 

    Regards,
    Aaron Estrada

  • Hi Aaron,

    I found my problem a few days ago, I simply mixed up two opcodes in my #defines, even though i checked that repeatedly.

    I have not marked this question as resolved because I am currently working on releasing a stable driver for the STM32L476.
    The current version is missing error handling and is quite application specific, I need to fix that first.
    Once this is done, I will post another update.

  • Hi Lukas, 

    I am glad you found the problem. Look forward to your update. Slight smile

    Regards,

    Aaron Estrada