peak detection using Microcontroller

Thread Starter

aniket07

Joined Jan 8, 2011
14
i have written a program in C for peak detection. the program works very well for the positive peak, but it doesn't work for the negative peak detection. it is unable to detect the negative peak.
please suggest me where m going wrong....
 

Attachments

thatoneguy

Joined Feb 19, 2009
6,359
Do you have a schematic?

For fast varying signals, you may want to use an op-amp based "peak hold" to capture very narrow peaks if needed. It also gives the PIC a little more time to sample and process signals for peaks if the change is over about 10kHz.
 

be80be

Joined Jul 5, 2008
2,072
The Op using ADC for this
Positive your testing for a 1 or better basically

Negative your testing for 0

Do you really think that will happen?

ADC will never read 0 unless you hold it at gnd and it will all ways be higher then 1
 

Thread Starter

aniket07

Joined Jan 8, 2011
14
hi all...
it seems that pic microcontroller i m using is not bipolar. Hence the program works well for postive peak detection,but not for the negative. So i am going to clamp the signal first and then apply it to controller. I think it will work.
 
Top