Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Use ADC to wakeup on analog input over threshold

I'm hoping someone can tell me if I'm on the right track. Do I understand correctly that on an nrf51, the LPCOMP can be configured to wake the processor on an analog input, only if that input exceeds a user specified threshold, then continue sending interrupts only for analog inputs above that threshold?  We will also be using a softdevice for Bluetooth.  

My goal is a low power device that runs for about 2 years on 4 AA lithium batteries.  It will wake to count pulses on an analog input (from 0.1 to 1 sec apart), then go back to sleep after a period of inactivity.  For battery life, it should only wake when the analog input is above a user selectable threshold (that can be adjusted in the field), and needs to start counting input pulses as quickly as 0.1 sec after waking up.  Am I on the right track with an nrf51 and expecting to be able to configure LPCOMP to wake the processor when an analog input exceeds a preset value, then starting processing analog input triggered interrupts as quickly as 0.1 sec after the signal that wakes it up? 

Parents
  • Hi,

    Am I on the right track with an nrf51 and expecting to be able to configure LPCOMP to wake the processor when an analog input exceeds a preset value, then starting processing analog input triggered interrupts as quickly as 0.1 sec after the signal that wakes it up? 

    Yes, that is correct. You can set the LPCOMP to generate interrupt based on either an external reference, or scaling of VDD (from 1/8*VDD to 7/8*VDD), and you can generate an event on rising, falling, or both.

    100 ms is long enough to start processing. The 16M RC oscillator starts up in the matter of ~10 microseconds, and if you need more precise clock, you can start up the external 16M crystal (~1.5 ms).

    Cheers,

    Håkon

Reply
  • Hi,

    Am I on the right track with an nrf51 and expecting to be able to configure LPCOMP to wake the processor when an analog input exceeds a preset value, then starting processing analog input triggered interrupts as quickly as 0.1 sec after the signal that wakes it up? 

    Yes, that is correct. You can set the LPCOMP to generate interrupt based on either an external reference, or scaling of VDD (from 1/8*VDD to 7/8*VDD), and you can generate an event on rising, falling, or both.

    100 ms is long enough to start processing. The 16M RC oscillator starts up in the matter of ~10 microseconds, and if you need more precise clock, you can start up the external 16M crystal (~1.5 ms).

    Cheers,

    Håkon

Children
Related