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.

Comparator to hold the higher value

Status
Not open for further replies.

tom_hanks

Full Member level 5
Joined
Aug 28, 2003
Messages
243
Helped
14
Reputation
28
Reaction score
1
Trophy points
1,298
Activity points
1,571
uC is sampling at 20 KSPS a ADC signal (i.e volage i/p) in continous mode.

In every 200ms cycle, uC is storing the maximum value and passing it on I2C bus.

but sometime uC is not able to capture a peak of Analog voltage i/p succesfully.

i am using a simple compare method of the read value with store value.

Can you suggest some sophisticative method to store the maximum value in every 200ms.

Example:
Code:
if ( AD.values.present.words[0] > AD.values.maximum[0])
// if the A-D value is bigger than the current maximum value 
{AD.values.maximum[0] = AD.values.present.words[0];}
 

it's more simple to put an analog peak detector on the analog signal and to sample at lower speed
 

Hello tom_hanks

first thing you should check is the ADC input circuit, to be sure that no saturation occurs in presence of highest peak of the sampled signal. This could be easily verified with an oscilloscope by checking the OTR (Out of the Range) pin of the device (if any).

Regards
Mowgli
 

check with the simple condiational loop to compare the values. store the values in RAM. After checking the values send the highest value to EEPROM.



If(present value > stored value ? (Stored value = present value ): (Stored value = Stored value);
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top