Document "8-bit ARM Microcontrollers" give you the knowledge AVR452 Sensor-based Control of Three Phase Brushless DC Motors Using AT90CAN128/64/32: Theory of Operation, Operation of Fundamental BLDC Motor, Implementation, Hall sensor based control of BLDC motor,.