beautypg.com

Motorola M68HC08 User Manual

Page 77

background image

Software Design

Data Flow

DRM028 — Rev 0

Designer Reference Manual

MOTOROLA

Software Design

77

Type: S8- signed 8 bit, U8- unsigned 8 bit, S16- signed 16bit, U16-
unsigned 16bit, (union)- 16 bits access or 2*8bit access

The system registers Sys1 flags are described by definitions of
Sys3_Def:

typedef union

{

struct

{

unsigned int PC_F : 1; /* BIT0 Phase Commutation Flag */

unsigned int Off_F : 1; /* BIT1 Offset timeout flag

- Offset timeout can be measured */

unsigned int ICR_F : 1; /* BIT2 Input Capture

was succesfuly Received - Flag */

unsigned int Rmp_F : 1; /* BIT3 Speed Ramp Flag - motor

ramping */

unsigned int Stop_F : 1; /* BIT4 Motor is going or is

stopped */

unsigned int Strt_F : 1; /* BIT5 Start Phase Flag */

unsigned int Run_F : 1; /* BIT6 Motor Running with

back-EMF feedback Flag */

unsigned int FOK_F : 1; /* BIT7 Feedback within the righ

time Flag */

} B;

/*

|FOK_F|Run_F|Strt_F|Stop_F|Rmp_F|ICR_F|Off_F|PC_F| */

char R;

} Sys1_Def; /* System register #1 Definition */

Main data flow is displayed in

Figure 5-1

. The processes are described

in the following subsections.

5.3.2 Process Measurement

The process provides measurement of analog values using ADC. The
measured inputs are: dc-bus current, dc-bus voltage, and speed input.
The measurement is provided by the measurement handler. The state
diagram is explained in

State Diagram

.

5.3.3 Start/Stop Switch Reading and Start/Stop Decision

The process reads the start stop switch and provides start condition and
clear failure decisions, as explained in

Stand-By

and

Fault State

.

F

re

e

sc

a

le

S

e

m

ic

o

n

d

u

c

to

r,

I

Freescale Semiconductor, Inc.

For More Information On This Product,

Go to: www.freescale.com

n

c

.

..