Hello,
I try to modify the lpcomp example from the Nordic SDK to trigger the sampling of the lpcomp manually. I have added the following code:
lpcomp_init();
NRF_LOG_INFO("LPCOMP driver usage example started.");
nrf_lpcomp_task_trigger(NRF_LPCOMP_TASK_START);
nrf_lpcomp_task_trigger(NRF_LPCOMP_TASK_SAMPLE);
while(!nrf_lpcomp_event_check(NRF_LPCOMP_EVENT_READY));
Result = NRF_LPCOMP->RESULT;
I use AIn3 (GPIO 5) as input for the lpcomp and the input voltage is 2.4 V. The limit is set to 4/8 Vcc, but the result is 0 and not 1 as expected.
What is the issue with this code?