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

LPCOMP sampling rate

Hi,

I want to sample lpcomp result at 50us, I'm doing so by using the following statements and set/clear a gpio based on the lpcomp result:

nrf_lpcomp_task_trigger(NRF_LPCOMP_TASK_SAMPLE); lpcomp_result = nrf_lpcomp_result_get();

This is done in 50us TIMER interrupt.

LPCOMP configuration : My LPCOMP configuration

We observe some differences in the gpio waveform when an external comparator chip (LM2901N) is used instead of the internal LPCOMP. The observed waveforms are attached below.(some samples seem to be skipped while using the LPCOMP)

waveform using LPCOMP: image description waveform using external comparator chip: image description

Can we sample the LPCOMP at 50us rate? What are the limitations of LPCOMP? Is there a specific way to achieve this?

Parents
    1. Currently we are not using a softdevice, but the final solution will have ble. 2.How was it verified that the LPCOMP worked fine?
    2. What was the signal input to the LPCOMP.
    3. We are taking over the code from an already working product where all these time parameters are tuned to detect motions accurately from the pir. The only thing that has changed from the previous circuitry is the comparator. Earlier we used comparator from the stm family MCU, which is now replaced with the nrf52 LPCOMP.
Reply
    1. Currently we are not using a softdevice, but the final solution will have ble. 2.How was it verified that the LPCOMP worked fine?
    2. What was the signal input to the LPCOMP.
    3. We are taking over the code from an already working product where all these time parameters are tuned to detect motions accurately from the pir. The only thing that has changed from the previous circuitry is the comparator. Earlier we used comparator from the stm family MCU, which is now replaced with the nrf52 LPCOMP.
Children
No Data
Related