Measure peak voltage
Posted: Mon Feb 13, 2012 4:50 pm
Hi
I would like to know how i would proceed to measure the peak voltage of the sine waveform. I am new to programming and flowcode. What i have thought so far is to use:
20MHz crystal/4 = 5MHz and then a prescale value of 8 brings the timer to 625kHz
FCV_COUNT = 625000/(256*tmr1h + tmr1l);
FCV_POS_PK_TM = (1/(FCV_COUNT/4)); //1/F=POS_PK_TM=Positive peak time
Which will give me the time until the peak of the waveform and then use the digital to analog converter to measure the voltage at this time. I have the analog to digital converter operating but cannot think of how to get the analog to digital converter to measure the peak voltage at the time calculated (POS_PK_TM=Positive peak time).
Any assistance would be appreciated.
Regards
Will
I would like to know how i would proceed to measure the peak voltage of the sine waveform. I am new to programming and flowcode. What i have thought so far is to use:
20MHz crystal/4 = 5MHz and then a prescale value of 8 brings the timer to 625kHz
FCV_COUNT = 625000/(256*tmr1h + tmr1l);
FCV_POS_PK_TM = (1/(FCV_COUNT/4)); //1/F=POS_PK_TM=Positive peak time
Which will give me the time until the peak of the waveform and then use the digital to analog converter to measure the voltage at this time. I have the analog to digital converter operating but cannot think of how to get the analog to digital converter to measure the peak voltage at the time calculated (POS_PK_TM=Positive peak time).
Any assistance would be appreciated.
Regards
Will