Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC wake up on ADC trigger

Status
Not open for further replies.

ponnus

Full Member level 2
Full Member level 2
Joined
Mar 17, 2011
Messages
142
Helped
8
Reputation
16
Reaction score
8
Trophy points
1,298
Location
Cochin, INDIA
satheeshchalackal.blogspot.in
Activity points
2,226
PIC wake up on ADC trigger (NOT Duplicate post)

Hai Experts,
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 (even in this forum), 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.

1. 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.

2. 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).

3. Another is to sample adc at specified intervals using a timer, but as the signal is random, it may miss the signal.

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.

Thank you
 
Last edited:

I'm not an expert in PIC24 architecture but I don't think the ADC can wake the device from sleep when a certain voltage is present. It should be possible the set the comparator voltage threshold to the desired level then use the comparator to generate an interrupt when the external voltage equals it though. Just a thought...

Brian.
 

Hai,
Thank you for the reply.

In the datasheet of ADC, it says that it can wake up the Mcu on interrupt if CPU priority is less than ADC interrupt priority.
The A/D module can operate during Sleep mode if the A/D clock source is set to the internal A/D
RC oscillator (ADRC = 1).
and
If the A/D interrupt is enabled (AD1IE = 1), the device will wake-up from Sleep when the A/D
interrupt occurs. Program execution will resume at the A/D Interrupt Service Routine if the A/D
interrupt is greater than the current CPU priority. Otherwise, execution will continue from the
instruction after the PWRSAV instruction that placed the device in Sleep mode

But I am afraid that as I am sampling continuously, ADC will give interrupt every time, even when the input is zero.

Thanks
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top