This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF52820 COMP issue

Hello everyone!

I have some issue with the comparator module on the nrf52820 chip.

We need to compare one of external analog signal the 1.8V internal reference source. (But other variants – 1.2V / 2.4V don’t work either)

When I set 0 Volt on the measurement contact – the result of comparison is correct (0).

But as soon as I increase voltage, even on 0.1V - the result immediately becomes incorrect (1).

 

Moreover, I tried to use differential mode (just for an experiment).

In that mode comparison is performed relative to the reference signal on the external pin.

So, in that mode comparisons are performed perfect.  

 

It seems for me there are some problems with internal reference source.

We develop the software for the nrf52820  mcu but at this moment we haven't received our boards and use the nrf52833 development kit for  debug.

Could the problem be caused by that?

Also I thought that the problem might be with my board and tried to use others. But unfortunetely  the result is the same. 

Could you please help me with it?

Many thanks in advance!

All the best!

Ernst

  • Hello Karl!

    f you want the reference level to be at exactly 1.8V with no hysteresis, please change them both to the value 63

    Yes!

    Thank you very very much!!  Now it works like a charm!

    Could you please explain a bit why definitely 63 if it's possible?

    I tried to find it in the documentation, but I couldn't do that.

    Many thanks Karl, for your time. It's really helpful for us!

    Best Regards,

    Ernst

  • Ernst Smirnov said:
    Thank you very very much!!  Now it works like a charm!

    No problem at all, Ernst! I am glad to hear that it is now working as intended :) 

    Ernst Smirnov said:

    Could you please explain a bit why definitely 63 if it's possible?

    I tried to find it in the documentation, but I couldn't do that.

    The VDOWN and VUP values are the thresholds the COMP peripheral uses as reference, which is set by configuring the THDOWN and THUP in the TH register. Each of them hold the value of 0-63, as indicated in the documentation. So, unless these are set to 63, you are not comparing it against the full chosen reference voltage, which is 1.8V.

    Ernst Smirnov said:
    Many thanks Karl, for your time. It's really helpful for us!

    I am happy to help, Ernst!

    Please do not hesitate to open a new ticket if you should encounter any issues or questions in the future.

    Good luck with your development!

    Best regards,
    Karl

Related