azarutz
Member level 2
Hi , i just started to measure power using microcontroller and i need some help . using zero crossing detector i sends two signal to microcontroller which was detected by ZCD zero crossing voltage and current. I stuck in programming part after that i dont know what to do . i read pic 16f877a microcontroller data sheet and i saw timer module , so i thought my work will be in that timer module and i got some idea when 1st signal(zero crossing by voltage) arrives to controller it starts to count and 2nd signal (zero crossing by current) arrives to controller it stops the count , my doubt is how to program the timer module to count the difference . is it need interrupt?. please tell me how to use timer for my application .