AN1915D Freescale Semiconductor / Motorola, AN1915D Datasheet - Page 22

no-image

AN1915D

Manufacturer Part Number
AN1915D
Description
3-Phase BLDC Motor Control with Quadrature Encoder using DSP56F80x
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
22
Software Design
5.2.2 Interrupts
The interrupt handlers have the following functions:
Initializes Quad TimerA - channel A1
— set Count Mode to Count
— set Input Source to Bus Clock / 128
— set Input Polarity to Normal
— set Secondary Input Source to Input 2
— set Count Frequency to Repeatedly
— set Count Length to Past Compare
— set Count Direction to Up
— set Capture Mode = BothEdges
— associate Callback On Input Edge to CallbackOnNewEdge
— associate CallbackOnOverflow to CallbackOnOverload
Sets-up I/O ports (brake, switch, push buttons)
— Brake, LED, switch on GPIO
— Push buttons on interrupts IRQ0, IRQ1
Initializes the Analog-to-Digital Converter
— ADC set for sequential sampling, single conversion
— Channel 0 = DC-Bus voltage
Initializes control algorithm (speed controller, control algorithm parameters)
Enables interrupts
Starts ADC conversion
Compare Interrupt Handler (Timer A0) calculates the actual commutation sector. That value is
input to the commutation algorithm. The description of the commutation is in
and
Input Capture Interrupt Handler (Timer A1) reads the time between the two subsequent IC
edges in one phase of the Quadrature Encoder, which is used for speed calculation.
POSIX Timer Interrupt Handler generates the time base 1ms. The routine, called within this
time base, blinks the green LED diode, reads the result of the ADC conversion, calculates the
speed and provides the speed controller.
Push Button Interrupt Handler takes care of the push button service. The UpButton Interrupt
Handler increments the desired speed, the DownButton Interrupt Handler decrements the
desired speed.
PC and SCI Interrupt Handlers provide SCI communication and service routines for the PC
master software. These routines are fully independent of the motor control tasks.
Section
5.1.4.
3-Phase BLDC Motor Control with Quadrature Encoder
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
Section 3.1.3
MOTOROLA

Related parts for AN1915D