Hi,
please take a sheet of paper and a pencil.
Draw the 3 phases in one diagram of 360° in length.
now draw a vertical line every time when a signal crosses zero level. (rising or falling)
You get 6 x 60° sections.
in each section:
* either two signals are postive (H) and one signal is negative (L)
* or one signal is positive and two signals are negative
In my table I named the three phases "A", "B", "C", and "H" is for positive voltage, "L" is for negative voltage.
--> if you feed each phase to a comparator referenced to the star point (or neutral) then you will get HIGH (positive) and LOW (negative) outputs fed to your microcontroller.
****
now to the microcontroller logic:
let´s assume the status is:
A: L
B: H
C: L
then there are only two valid "next" status (stati) possible.
either:
A: L
B: H
C: H
for forward = CW
or:
A: H
B: H
C: L
for reverse = CCW
everything else is invalid.
Klaus