Re: How can I implement Phase sequence detection in PIC12F508 ?
The 12F508 doesn't have an ADC so it's a bit more complicated than sensing the input polarity.
Your method is correct and there are two ways to check the validity of the phases:
1. If you have a neutral or common connection, connect it to VSS and check for the correct time delay using three GPIO pins.
2. If you only have the three phases, wire VSS to one of them and the others to two GPIO pins.
Tip: for simplicity, wire a resistor (~2.2M) between the phase line and GPIO pin, the current will be low enough that the internal protection diodes on the pin will clamp the negative excursion and limit the positive excursion to ~VDD.
The important thing is to measure the delay between phases, using the method above you can just check the delay between one input and the next going high. Do not rely on the presence of an input signal alone as an open circuit phase feed may still register from voltage fed back from the load.
Note that you can not tell which phase is which without some kind of reference back to the power station.
Brian.