R13, R16, R17 are the top side and R12, R14, R15 are the bottom side of a voltage divider to get the motor voltage into the range of the ADC.
R20, R21, R22 take the average of the three motor phase voltages, and they mimic the "star" point of the motor
The microcontroller can now compare the phase voltages (A0, A1, A2) with the "star point (D6) to get very close to the zero crossing.
ATMEGA328 has an analog comparator. Is this comparator connected to D6 (and configurable to have any of the analog inputs for the other side?