i am using PIC 16F877A for Peak Detection. the analog signal is applied at Pin RA0. the program has been written in C. for frequency upto 60-65 Hz, the peak is properly detected. but for frequencies below that, peak is not detected properly, instead the pin goes high well before the peak. Please help me with this problem.