title: PIC wakeup on ADC trigger
body: <p>I am using PIC24F16KA101 for reading ADC. Adc signals will be coming randomly, so I am putting the Mcu in sleep mode.
      I like to wake up the mcu, when the signal crosses a threshold value.
      When I googled this, I found many topics related to this, but I like to get clarified in this problem.
      I found some solutions to this problem, but I want a solution with minimum power consumption.</p>
  
  <ol>
  <li><p>Sampling ADC at maximum frequency (as the signal is random,high frequency pulse). To use the Adc clock based on system clock
      (I'm using 32MHz FRCPLL) when the Mcu is awake and to change to ADRC internal clock before it goes to sleep, so that adc will be sampling in sleep mode.
      In this way,I hope, I can wake the module (by setting ADC interrupt priority greater than CPU priority),when the threshold is higher.
      But for this I've to continuously sample using adc.</p></li>
  <li><p>Provide the same Adc input to the comparator module and put the Mcu in sleep mode while not processing and turn off adc. Module can wake up
      when the input is higher than comparator threshold and starts the adc. I think, in this case, comparator will be working in sleep mode.
      But I'm afraid that I may miss some important signal information (as it will take time to turn ON adc after the comparator interrupt).</p></li>
  <li><p>Another is to sample adc at specified intervals using a timer, but as the signal is random, it may miss the signal.</p></li>
  </ol>
  
  <p>Which will be better or is there any other solution for this? Please help me....
  Also, I would like to know the frequency of internal ADRC oscillator.</p>