tom_hanks
Full Member level 5
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:
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];}