Discussion in "PIC Microcontroller Discussion" started by    ponnus    Jan 30, 2014.
Thu Jan 30 2014, 01:50 AM
#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, 02:12 AM ]
Thu Jan 30 2014, 03:34 PM
#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, 07:56 AM
#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, 01:39 AM
#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, 06:20 AM
#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, 11:13 AM
#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

Conversation

Wed Mar 25 2020, 09:39 AM
Tajammul
Sir kindly send the code file i2c for 8051
ExperimenterUK
Fri Mar 13 2020, 06:36 PM
@ Rohitnani,ABEBE..which project ?
Fri Mar 13 2020, 08:55 AM
ABEBE
how can get hadwere of this project
Rohitnani
Sat Mar 07 2020, 12:11 PM
Sir, Could you please send me the zip file input password....
Wed Feb 26 2020, 11:58 AM
Peter Parker
Is it possible to send multiple messages using only 1 GSM module?
Sat Feb 01 2020, 05:12 AM
Pearl Olin
Hello,
Wed Jan 22 2020, 01:16 PM
MINU CHAUDHARY
I m getting errors while simulation process during interfacing socket output and lcd... Can i get the report of ur project which is same as us.
Tue Jan 14 2020, 02:08 AM
shubham kharade
when i am trying to simulate the program in Proteus 8 professional, I am getting some errors as cannot find module file dhtxx.md can u help me
Tue Dec 17 2019, 08:44 AM
Devangi
hello..i am programming industrial timer using 8051 with 24lc64 eeprom. i have query in storing the 3 diff value in eeprom with enter button. can anyone share c code ?
Tue Dec 17 2019, 05:30 AM
Andrius
Hello. Can anyone share the code in Bascon and scheme in Proteus?

Downloads

Comments

ukkorikerist
Thu Apr 09 2020, 12:05 AM
Oswaldrib
Wed Apr 08 2020, 11:08 PM
Rachelsig
Wed Apr 08 2020, 04:57 PM
Franksig
Wed Apr 08 2020, 03:38 AM
OliverKiz
Mon Apr 06 2020, 07:54 PM
Nikolaynom
Mon Apr 06 2020, 09:13 AM
Paulinewop
Sun Apr 05 2020, 10:33 PM
NormanJeops
Sun Apr 05 2020, 03:26 AM

Online

Guests: 74, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 01:37 AM

Members: 38149
Newest member: ukkorikerist
Forum Activity
PHANTOM28 Avatar
Posted By PHANTOM28
Fri Feb 28 2020, 10:25 AM
Hi.I hope you all can help me. I am relatively ne...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Feb 21 2020, 05:05 PM
ajay_bhargav Avatar
Posted By ajay_bhargav
Fri Feb 21 2020, 04:45 AM
Yes you can do that.1. Create a channel @Thingspea...
ananyagupta Avatar
Posted By ananyagupta
Thu Feb 20 2020, 03:58 AM
With regards to the particular characters sent to ...
sarrahjuzar Avatar
Posted By sarrahjuzar
Wed Feb 19 2020, 04:24 AM
I have a gsm module sim900a and dht22 connected to...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Feb 18 2020, 04:52 PM
figureyang Avatar
Posted By figureyang
Tue Feb 18 2020, 04:59 AM
figureyang Avatar
Posted By figureyang
Tue Feb 18 2020, 04:50 AM
wounder Avatar
Posted By wounder
Mon Feb 10 2020, 03:32 AM
From below sample code for nuvoton 8051 timer0 mod...
Just4Fun Avatar
Posted By Just4Fun
Sat Feb 01 2020, 09:20 AM
If you want to use a CH55x MCU there isn't any adv...