page1
Reset timers and hold in reset
START
End
Increment shaft angle
amount from ADC CH0 read
ISR:Shaft Move Tick
End
Set PWM amplitudes for 3 phase class-D inputs
Initialise UART, Stats and ADCs
Set up timer prescalers,
modes and initial values
Release timer reset so
PWMs are synchronised
Save ADC CH0 for shaft angle increment
ISR:ADC read complete
End
Calculate angles of U, V and W phases from shaft angle
Calculate amplitudes of U, V and W PWMs from phase angles