Discussion in "PIC Microcontroller Discussion" started by    ponnus    Jan 30, 2014.
Thu Jan 30 2014, 12:20 pm
#1
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 , 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


[ Edited Thu Jan 30 2014, 12:42 pm ]
Fri Jan 31 2014, 02:04 am
#2
How wide are the pulses you want to measure ?.
Do you want to get the shape of the pulse, or just its maximum value ?.
 ponnus like this.
Fri Jan 31 2014, 06:26 pm
#3
Hai,
Thank you for the reply.
Pulses will be in micro or milli seconds range,probably less than 3ms.
And yes I want to get the shape of the pulse, atleast if it is crossing lower and higher thresholds.

Thank you
Mon Feb 03 2014, 12:09 pm
#4
I believe comparator is better as you cannot keep sampling ADC and there is no such hardware trigger available for ADC. you will need to compare sample in software. Whereas as soon as threshold reaches, comparator can trigger interrupt and you can do ADC sampling at that time. Which Sleep mode are you going to use? if its not deep sleep mode then CPU will not take much time as clocks are enabled in Sleep mode.
 ponnus like this.
Fri Feb 07 2014, 04:50 pm
#5
Hai,
Thank you for the reply.
I am not using deep sleep mode. So, I will use it like you said, interrupt on comparator threshold.
Also, do you know what is the frequency of internal ADRC oscillator?Is it same as internal RC oscillator?

Thank you
Sun Feb 09 2014, 09:43 pm
#6
Actually RC oscillator in this PIC controller is selectable. You can either select 8MHz FRC or 500 KHz LPFRC or LPRC oscillator (31KHz). So it depends on you what you want to use or select.

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

ChrisLub
Tue Apr 23 2024, 05:21 pm
Davidbab
Tue Apr 23 2024, 10:41 am
Richardrit
Tue Apr 23 2024, 09:54 am
HenryLaf
Mon Apr 22 2024, 03:50 pm
bleradrar
Mon Apr 22 2024, 06:38 am
ppu-pro_ka
Sun Apr 21 2024, 07:39 pm
Infewow
Sun Apr 21 2024, 06:30 pm
HumanTak
Sun Apr 21 2024, 12:26 pm