page1
ISR:Sensor update
End
ISR:ADC read complete
End
Extract Gray-Code bits from port value
Convert Gray-Code value to position index
Convert position index to angle
Convert angle to phase amplitudes.
This includes the amplitude scaling
Output amplitudes
Get PortD binary value
Save ADC CH0 for amplitude scaling