i want use measure the frequency of ac(normaly 50hz).since i have problem with common ground,i want to isolate the neural line. so i use a optocoupler to isolate the ac
my circuitis-------half wave rectifier---100k-1k voltage divider---then optocounpler to ccp2 ofpic16f877a. i use timer 1 to find the period. can any body spot, any problem with this logic. thanks in advance actually it is not working