Freescale Semiconductor, Inc.

Freescale Semiconductor, Inc.

INTERRUPT

PWM RELOAD

BEMF ZERO CROSSING

SENSING ISR:

SENSE ZERO CROSSING INPUT:

TAKE 3 ZC INPUT SAMPLES

BEMF STATE = S1&S2 S2&S3

0

BEMF state

1

 

YES

NO

V_TASC = ris. edge

V_TASC = fal. edge

NO

YES

 

SET ZERO CROSSING GET:

– SET ICR_F - ZERO CROS. GET

– T_ZCROS = TIMER2 TIME

RTI

 

Software Design

State Diagram

INTERRUPT

TIMER 1 (TIM A CH1)

CURRENT MEASUREMENT ISR:

START ADC DC-BUS CURRENT CHANNEL

SERVE VIRTUAL TIMER3

CURR = VALUE FROM ADC

IF CURR > CURR_MAX_FAULT:

SET OVC_F (OVERCUR.) FLAG

SET NEXT ADC CHANNEL NXT_CHNL

RTI

INTERRUPT

TIMER 2 (TIM A CH3)

COMMUTATION ISR:

IF CMTE_F (COMMUTATION ENABLED): DO MOTOR COMMUTATION STEP TIMER 1 CURRENT SENSING TO PWM SYNCHRONIZATION

SET PC_F (PHASE COMMUTATED) T_CMT = TIMER 2 ACTUAL TIME

ZERO CROSSING SELECTION

RTI

Figure 5-6. Software Flowchart — Interrupts

5.5 State Diagram

The motor control application can be in one of the eight states shown in

Figure 5-7. Each of these states is described in the subsections

following the figure.

DRM028 — Rev 0

 

Designer Reference Manual

 

 

 

MOTOROLA

Software Design

89

 

For More Information On This Product,

 

 

Go to: www.freescale.com

 

Page 89
Image 89
Motorola M68HC08 manual State Diagram, Software Flowchart Interrupts