This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ADC Counts are correct in debugging mode but not in normal mode

I am working on ADS1241 24 bit ADC. My ADC counts are correct in debugging mode but not in normal mode with or without breakpoints.I am using Keil uvision5 and STLink Debugger.

  • How, exactly, are they "wrong" ?

    How, exactly, do you determine that they are "wrong" ?

    Have you checked if the input to the ADC is actually changing ?

    Have you checked if the raw output from the ADC is changing ?

    etc, etc, etc, ...

  • The Vref for ADC is 1.23 V.
    I have given 0.822 V as input to ADC. The counts in debugging mode are AA83F4 (0.819 V upon conversion)and the counts in normal mode are E73CFA (1.111 V upon conversion).

    Yes, the counts are changing on changing the input.

    I am reading the counts from ADC through SPI and transferring to PC using UART.

  • You didn't answer the questions:

    How, exactly, do you determine that they are "wrong"? - ie, how do you view the counts?

    Have you checked if the input to the ADC is actually changing? - have you measured it independently? Be sure that you are measuring exactly what the ADC sees. Use a scope, not just a meter.

    Have you checked if the raw output from the ADC is changing? - have you looked at the SPI data independently?

    We can't debug this remotely for you; we can't see your setup - you're going to have to dig into it yourself!