AN1917D Freescale Semiconductor / Motorola, AN1917D Datasheet - Page 17

no-image

AN1917D

Manufacturer Part Number
AN1917D
Description
3-Phase PM Synchronous Motor Control with Quadrature Encoder Using DSP56F80x
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
MOTOROLA
5.2.2 Interrupts
The interrupt handlers have the following functions:
— set Count Mode to Quadrature Count
— set Input Source to Input 0
— set Input Polarity to Normal
— set Secondary Input Source to Input 1
— set Count Frequency to Repeatedly
— set Count Length to Until Compare
— set Count Direction to Down
— disable Capture Mode
Initializes QuadTimerA - 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 1
— set Count Frequency to Repeatedly
— set Count Length to Past Compare
— set Count Direction to Up
— set Capture Mode = RisingEdges
— 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
PWM Reload reads the actual rotor position, calculates the 3-phase sinewave output and spin
direction and updates PWM Value Registers.
Input Capture Interrupt Handler (Timer A1) reads the time between the two subsequent IC
edges 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.
3-Phase PMSM Control with Quadrature Encoder
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
Software Design
17

Related parts for AN1917D