Hello.
I´m knew to this forum and I´m knew working with picbasic pro, so I´m sorry if I don´t understand something quite simple...
I´m trying to measure power factor, and my ideia is to measure pulse width.
My hardware gives me an output whitch is a pulse at the AC frequency, in my case 50Hz, whose width is inversely proportional to the power factor. My doubt is that if can I use PULSIN and have a good accuracy? My ideia is that:
with 50Hz I have a T=20ms, using a 4MHz oscillator the pulse width is returned in 10us increments. So 20ms/10us=2000. My question is: if my variable returns with 2000 can I assume that all 50Hz the pin was high, and for example if my variable returns 1000 can I assume that was 10ms high, and so on...???

I have another ideia to measure power factor:
the diference, in time, between voltage and current in zero crossing gives me the power factor.
My doubt is I don´t know how to measure with excellent accuracy times, specially those in the unity of us or ms!

If you have anything or any ideia more simple how to measure power factor, please help me.

Regards
Leonel