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

nRF52820 COMP module

Hello,

I would like to use a single COMP I/O pin to compare the pin voltage to multiple references during run-time. 

To do this, I was planning on initializing the COMP driver by using nrfx_comp_init and setting the appropriate reference voltage and starting the measurement by calling nrfx_comp_start, and then finally sampling the pin by calling nrfx_comp_sample.

If the I/O pin voltage is below the reference voltage, I plan on uninitializing the COMP driver by calling nrfx_comp_uninit, then re-initializing the COMP driver with a different reference voltage and running the comparison.

Is this a good way to "measure" the pin voltage?  Since there is no SAADC in nRF52820, I figured that this is a decent enough way to get rough voltage measurements.

Parents Reply Children
Related