Motorola M68HC08 manual Main Software Flowchart

Models: M68HC08

1 168
Download 168 pages 716 b
Page 84
Image 84

Freescale Semiconductor, Inc.

Freescale Semiconductor, Inc.

Software Design

RESET

MCU INITIALIZATION:

– SYSTEM REGISTERS INITIALIZATION

– PORTS INITIALIZATION

– PLL — CPU CLOCK INITIALIZATION

– PC MASTER SOFTWARE (PORT) INITIALIZATION

APPLICATION INITIALIZATION:

– CURRENT OFFSET CALIBRATION

– SYSTEM REGISTERS INITIALIZATION

– PWM INITIALIZATION

– TIMER 1 CURRENT SENSING TO PWM SYNCHRONIZATION

– ADC MEASUREMENT INITIALIZATION

MAIN S/W LOOP:

– SEE FIGURE 5-5

Figure 5-4. Main Software Flowchart

In the Stand-Bystate function, the start/stop switch is checked using StSWReadStart () function. The DecideStaSto () function is called to decide if the application should start. The start condition differs if manual or PC master software mode is set. When in manual mode (PCMode = 0), the start condition is the switch in the start position. When PC master software mode (PCMode = 1), the start condition is a start request from PC master software (StartCtrl = 1). In both modes, Stop_F is cleared when the software evaluates the start condition. When Stop_F is cleared, the software checks the over-voltage condition and the application starts.

The system Alignment and Starting (Back-EMF Acquisition) states are provided by Alignment() and Start () functions in the code_start.c file, both are called from main(). The functionality during the start and running state is described in 3.3.1 Sensorless Commutation Control. During the starting (back-EMF acquisition) state, the commutation time

Designer Reference Manual

 

DRM028 — Rev 0

 

 

 

84

Software Design

MOTOROLA

 

For More Information On This Product,

 

 

Go to: www.freescale.com

 

Page 84
Image 84
Motorola M68HC08 manual Main Software Flowchart