DRM059
DRM059
MC68HC908LJ12
and MC33970
Designer Reference
Manual
M68HC08
Microcontrollers
DRM059/D
Rev. 0
3/2004
MOTOROLA.COM/SEMICONDUCTORS
Motorola and the Stylized M Logo are registered trademarks of Motorola, Inc.
DigitalDNA is a trademark of Motorola, Inc.
This product incorporates SuperFlash® technology licensed from SST.
All brand names and product names appearing in this document
are registered trademarks or trademarks of their respective holders. © Motorola, Inc., 2004
MOTOROLA 3
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Revision History
Revision History
Revision Page
Date Description
Level Number(s)
March,
N/A Initial release N/A
2004
Freescale Semiconductor, Inc...
Table of Contents
Section 1. Introduction
1.1 Application Intended Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.2 Benefits of Our Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Freescale Semiconductor, Inc...
Appendix B. Glossary
Section 1. Introduction
In addition, the Cluster for Motorbikes can be used as a hardware platform for
software development. For this purpose, the board is equipped with an
interface for reprogramming, and the MCU is programmed with the Developer’s
Serial Bootloader for M68HC08 devices. This tool allows the MCU memory to
be reprogrammed in-circuit, using the standard serial asynchronous port.
The module is designed to be housed in a standard 3 3/8-inch case.
MOTOROLA Introduction 11
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Introduction
Freescale Semiconductor, Inc...
12 Introduction MOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
2.1 Introduction
This section describes the main procedures required to set up and start the
Cluster for Motorbikes Demo Kit. The demo is designed to show the basic
Freescale Semiconductor, Inc...
functionality of the Cluster for Motorbikes. The document also describes the
specific steps and provides additional reference information.
The Cluster for Motorbikes Demo Kit can operate in two modes: Local or
Remote. In Remote mode, the application is controlled from a user-friendly
graphical environment, running on a PC.
The Cluster for Motorbikes Demo Kit is distributed with the following
components:
• Cluster demo module
• CD ROM
• 12-V power supply
• Parallel port cable
The Cluster Control panel application can run on any computer using Microsoft
Windows XP, Windows NT, 98, or 95 operating systems with Internet Explorer
V4.0 or higher installed.
Control Panel
Tachometer
Speedometer
/ Odometer
Freescale Semiconductor, Inc...
ODO/TRIP
Switch Button
Remote Control
Application from
Reprogramming Control Panel
(Serial Port) Local Control (Parallel Port)
Each function can run in either Local or Remote control mode. The Mode
selection is made through switches as shown in Figure 2-2
Freescale Semiconductor, Inc...
Setting up the demo to the Local mode does not require any special action. Just
connect the power supply and set all switches to the “LOC” position. All cluster
functions can be controlled by the appropriate knob.
Step 1
Switch OFF the Cluster Demo module PWR switch. See Figure 2-2
CAUTION: To avoid possible damage to the PC parallel port, the power to the Cluster
Demo module must be switched OFF before connecting or disconnecting a
straight-through parallel cable from the PC to the Cluster Demo module.
Step 2
Set up all switches to the “REM” position.
Step 3
Connect a straight-through parallel cable from the PC to the Cluster Demo
module “REMOTE CONTROL” connector.
Freescale Semiconductor, Inc...
Step 4
Start the Cluster Control Panel.
Step 5
Switch ON the Cluster Demo module PWR switch.
Step 6
Control the application remotely from the Cluster Control Panel (see Figure
2-3) by simply clicking on the selected needle and dragging it to a new
position.
CAUTION: To avoid possible damage to the PC parallel port, the power to the Cluster
Demo module must be switched OFF before connecting or disconnecting a
straight-through parallel cable from the PC to the Cluster Demo module.
Step 1
Switch OFF the Cluster Demo module Power supply.
CAUTION: To avoid possible damage to the PC serial port, the power to the Cluster Demo
module must be switched OFF before connecting or disconnecting a
straight-through serial cable from the PC to the Cluster Demo module.
Step 2
Connect a straight-through serial cable from the PC to the Cluster Demo
module “BOOTLOADER” connector.
Step 3
Start the cmd.exe file from Windows.
Step 4
Start the hc08sprg.exe file with the required parameters from the
Command window. The command line for the hc08sprg.exe file has the
following syntax:
hc08sprg port[:][S|D|?] [speed] file
Freescale Semiconductor, Inc...
Step 5
Switch ON the Cluster Demo module Power supply. The program performs
some actions and will prompt a message:
“Are you sure to program part? [y/N]:” (see Figure 2-5).
Step 6
To program the device, answer “y” (see Figure 2-6).
Freescale Semiconductor, Inc...
CAUTION: To avoid possible damage to the PC serial port, the power to the Cluster Demo
module must be switched OFF before connecting or disconnecting a
straight-through serial cable from the PC to the Cluster Demo module.
ODO/TRIP toggle
Each push of the switch button for a time shorter then 1s will toggle between
the ODO or TRIP modes.
in the memory.
3.1 Introduction
This reference design of the Cluster for Motorbikes provides these basic
modules: speedometer, odometer, tachometer, and fuel gauge for the
Freescale Semiconductor, Inc...
motorbike’s cluster. In addition to this, the Cluster for Motorbikes can be used
as a hardware platform for the software development. It also enables the
implementation and testing of user’s software. For this purpose, the board is
equipped with an interface for reprogramming.
Refer to Figure 3-1 for a block diagram of the module.
The reference design is based on the Gauge Driver Integrated Circuit (GDIC)
MC33970, or MC33991, or Single Gauge Driver Integrated Circuit (SGDIC)
MC33971, which are analogue products controlling one (MC33971) or two
2-phase instrumentation stepper motors. The application is supported by
HC08LJ12 MCU, which is a part of the 8-bit MCU Family.
The speedometer used on motorbikes indicates the speed of the motorbike and
records the distance the motorbike has travelled. Speedometers are calibrated
in kilometres and/or in miles per hour. The instrument also records the traveled
distance, recorded in kilometres or miles. This part of the instrument is known
as the odometer. Most odometers record the total distance travelled. Some
also record the distance of individual trips. These can be reset to zero.
Freescale Semiconductor, Inc...
3.2.2 Tachometer
In the fuel tank, a float moves a simple arm which rubs against a variable
resistor. A small current flows through the resistor, just enough to give a voltage
across the wire — zero volts at the earth and maximum volts at the other end.
As the arm moves across the resistor according to fuel level, it sends a differing
voltage to the fuel gauge. The microcontroller measures the sensing voltage
and drives the fuel gauge indicator.
Features:
• High-performance M68HC08 architecture
• Maximum internal bus frequency
– 8 MHz at 5 V operating voltage
• 32-kHz crystal oscilator clock input with 32-MHz internal
Freescale Semiconductor, Inc...
phase-lock-loop
• Memory:
– 12K byte FLASH memory
– 512 bytes of RAM
– Resident routines for in-circuit programming and EEPROM
emulation
• 6-channel Analog-to-Digital Converters (ADC)
– 10-bit resolution
• Two 16-bit, 2-channel timer interface modules with selectable input
capture, output compare, and PWM capability on each channel
• Real time clock with clock, calendar, alarm, and chronograph functions.
• Serial interfaces:
– Asynchronous Serial Communications Interface (SCI) with infrared
encoder/decoder
– Synchronous Serial Peripheral Interfaces (SPI) module
• 8-bit keyboard wakeup port with programmable pullup
• 32 general-purpose input/output (GPIO) pins
• 4/3 backplanes and static with a maximum of 27 frontplanes liquid
crystal display driver
– CRG (low current oscillator, PLL, reset, clocks, COP watchdog, real
time interrupt, clock monitor)
– MEBI (Multiplexed External Bus Interface)
– MMC (Module Mapping Control)
– INT (Interrupt control)
– BKP (Breakpoints)
– BDM (Background Debug Mode)
• 64-Pin QFP package, or 64-Pin LQFP package, or 52-Pin LQFP
package
Features:
• MMT-licensed two-phase stepper motor compatible
Freescale Semiconductor, Inc...
3.4 Functionality
The Cluster for Motorbikes is dedicated for use in the Mid-End Motorbike
market.
3.5 Architecture
Schematics of the Cluster for Motorbikes are provided in Appendix A. Bill of
Materials and Schematics. The Cluster for Motorbikes schematic can be seen
in A.2 Cluster for Motorbikes Schematics.
The Cluster for Motorbikes can be logically divided into the following four basic
blocks:
• Microcontroller
• Gauge driver
• Input signal conditioning
• Power supply
Data transfer between the Microcontroller and Gauge driver is ensured by the
SPI protocol.
3.5.1 Microcontroller
Freescale Semiconductor, Inc...
The main function of this part of the Cluster for Motorbikes is to control the
application. A Motorola 8-bit MC68HC908LJ12 high-performance
microcontroller unit (MCU) was selected to control the application. The MCU
(U7) uses enhanced central processor unit and embedded peripheral modules.
The MCU controls the GDIC device through the SPI channel. The SPI module
allows full-duplex, synchronous, and serial communication between the MCU
and peripheral devices. The SPI shares four I/O pins with four parallel I/O ports.
When the SPI system is enabled, the four associated SPI port pins are
dedicated to the SPI function as:
• Serial clock (SPSCK)
• Master out/slave in (MOSI)
• Master in/slave out (MISO)
• Slave select (SS) — see NOTE
NOTE: During an SPI transmission, data is transmitted (shifted out serially) and
received (shifted in serially) simultaneously. The serial clock (SPSCK)
synchronizes shifting and sampling of the information on the two serial data
lines (MOSI, MISO). A slave select (SS) line allows selection of an individual
slave SPI device; slave devices that are not selected do not interfere with SPI
bus activities.
The SPI can be configured to operate as a master or as a slave. The master
mode must be selected for the SPI module to control the GDIC, because only
a master SPI module can initiate transmissions.
The Cluster for Motorbikes uses one channel (ADC3) of the Analog-to-Digital
Converter (ADC) to perform fuel level sensing. The resolution of the ADC is
10 bits, but only 8 bits are used by the application.
A simple switchable current source of 20 mA (Q3, D4, D6, R17, R13) supplies
the external fuel level sensing resistor (maximum value is 100 Ohm). The
Freescale Semiconductor, Inc...
The general-purpose I/O (PTA1 to PTA5) is used to drive the fuel gauge
indicator. A simple LED bar was used as a fuel gauge indicator for the demo
purpose.
The general-purpose I/O (PTC5 to PTC7) emulates the I2C interface to control
the external EEPROM. This external EEPROM is used to store Odometer and
Tripmeter data.
The embedded LCD driver module can drive a maximum of 27 frontplanes and
4 backplanes of an LCD display. The application uses an LCD display with 11
frontplanes and 4 backplanes. Because of the 4 backplanes, a 1/4 duty of the
output waveform is set up. When the LCD driver module is enabled, the
backplane waveforms for the selected duty are driven out through the
backplane pins. The backplane waveforms are periodic.
The standard SCI interface, together with the bootloader embedded code, is
used to communicate with the PC for reprogramming the application.
NOTE: The bootloader can be used only for reprogramming, not for in-circuit
debugging. The bootloader is a low-cost, in-circuit programming solution.
terminated by a Stop condition after an Ack for Write, and after a NoAck for
Read. See Figure 3-2.
SCL
SDA
SDA SDA
START STOP
INPUTS CHANGE
CONDITION CONDITION
SCL 1 2 3 7 8 9
START
CONDITION
SCL 1 2 3 7 8 9
STOP
CONDITION
Write Control (WC) input signal is useful for protecting the entire memory
content from inadvertent write operations. Write operations are disabled to the
entire memory array when WC is driven high.
The GDIC MC33970 is able to control two instrumentation stepper motors. One
of the stepper motors is a part of the speedometer board (U4), another is
connected through the connector J1. See Figure 3-3.
The microcontroller controls the GDIC through the SPI channel. RST signal is
controlled from the microcontroller and resets the device, or places the device
into a sleep state, if driven to a logic 0. The RTZ output signal gives information
about a Return to Zero event to the microcontroller.
Freescale Semiconductor, Inc...
U4
1 4
1A SIN– COS–
4A
SIN– COS–
2 3
SIN+ COS+ 3A
2A
SIN+ COS+
STEPPER MOTOR
TP4 TP3 TP1 TP2
U3 HEADER 4
1 24 1
COS0+ COS1+
2 23 2 TACHO
COS0– COS1–
3 22 3 STEPPER MOTO
SIN0+ SIN1+
4 21 4 CONNECTION
SIN0– SIN1–
5 20
PGND1 PGND8
6 19
PGND2 PGND7
7 18
PGND3 PGND6
8 17 VBAT
PGND4 PGND5
9 16
CS VPWR
10 15 VCC
SCLK RST
SPI 11 14
SO VDD C11
12 13
SI RTZ C10 0.1 µF
0.1 µF 25 V
MC33991DW
25 V
RST
RTZ
R2
10k
OUTPUT TO T1CH0
R1 C2
1 µF/50v C
Speed_sns 27k
1 + 2 B Q1
BC847B
1 1
C3 E
D1 R14
1 nF
1N4148 100k
25V
2 2
R8
10k
OUTPUT TO T1CH1
R18 C5
R3 C
10k 1 µF/50V
Revolution_sns 39k
1 2 1 + 2 B Q2
BC847B
1 1
C12 E
1 nF D5 R15
25V BZ X94C9V1 100k
2 2
The Cluster is supplied from the 12-V motorbike battery. A simple linear voltage
regulator MC7805 is used to provide a 5-V power supply for the Cluster
devices.
VBAT VCC
U2
R16 3R9 MC78058T
1 2 1 3
VIN VOUT
1
+ + + C4
D8 C1 C15 GND
100µF/6.3V
Freescale Semiconductor, Inc...
VBAT+ U3
MA4007T3
R4
D7
15k
1N4148
IRQ
1 C5
R5
10k 0.1µF
2 25V
It is necessary to save Odometer and Tripmeter data if the power supply from
the battery is switched off. The resistor dividers R4 and R5 monitor the battery
power supply and generate an interrupt signal in case a power off occurs. The
capacitors C1 and C15 hold a voltage long enough for the microcontroller to
perform an interrupt service routine to save the data.
4.1 Introduction
This section of the reference design provides a complete documentation of the
Cluster for Motorbikes software.
Freescale Semiconductor, Inc...
Software content of the project can be divided into two basic groups. In the first
group, there are all the initialization routines necessary to configure both the
MCU peripherals and all of the system the sub-modules, while the second part
consists of routines for the Cluster for Motorbikes application. Therefore,
separate descriptions will be given for the initialization routines and for the
application. As mentioned in previous chapters, the Cluster for Motorbikes is a
modular system with implemented functions of a speedometer, odometer,
tachometer, and fuel gauge.
Here is a list of routines for the first group, responsible for initialization and
configuration of the Cluster for Motorbikes Using the MC68HC908LJ12 and
MC33970. Details of each item on the list will be given in the 4.3 Software
Implementation.
• PLL module initialization
• LCD module initialization
• Timer module initialization
• Analog-to-Digital converter (ATD) module initialization
• Keyboard module initialization
• Serial Peripheral Interface (SPI) periphery module initialization for
communication with GDIC device
• Initialization and configuration of the GDIC via the SPI channel
• I2C communication channel emulator initialization
The project was written using the Metrowerks CodeWarrior for Motorola 8- and
16-bit MCU CW08 V2.1. In this subsection, a list of all source code files of the
CodeWarrior project can be found.
All MCU peripheral components used in the project are briefly described here.
It gives an overall summary picture of the necessary MCU resources.
Usage of the Timer Interface Modules is given in Table 4-1 and Table 4-2.
A description of the General Purpose I/O (GPIO) usage is given in Table 4-4.
Table 4-4. GPIO Module
Symbolic
MCU ISR
Name Purpose
Pin Function
of the Signal
PTC0 TACHO_ON_SW Input for TACHO_ENABLE Dip switch —
PTC1 SPEEDO_ON_SW Input for SPEEDO_ENABLE Dip switch —
PTC2 SPEEDO_PULS_SW Input for PULSES Dip switch —
PTC3 TACHO_FREQ_SW Input for FREQ Dip switch —
PTA1 FUEL_1_2FULL_IND Output for Fuel 1/2 full tank indicator —
Freescale Semiconductor, Inc...
Usage of the Analog to Digital (ATD) converter module is given in Table 4-5.
Only ADC3 channel is used.
Table 4-5. ATD Module
Symbolic
MCU ISR
Name Purpose
Pin Function
of the Signal
ADC3 FUEL Data conversion of FUEL signal —
All interrupts used within the Cluster for Motorbikes project are briefly listed in
Table 4-8.
conversion
Long time support for speedo and
TIM1 Int_Timer1OVF Timer1 overflow
tacho signals conversion
TIM2 Int_Timer2CH0 Output compare Internal timer — speedo watch dog
TIM2 Int_Timer2CH1 Output compare Internal timer — tacho watch dog
ODO/TRIP button service and
KBI Int_Keyboard Keyboard interrupt
power down service
In this section a brief description of main project variables and flags is given.
These variables are related to the basic cluster functions.
volatile tU32 speed_delta_time; /* Input capture delta time related to the speed
Speed_delta_time = Speed_second_edge_time - Speed_first_edge_time */
Freescale Semiconductor, Inc...
volatile tU16 speed_first_edge_time; /* Time value of the first edge input capture related
to the speed */
volatile tU16 speed_second_edge_time; /* Time value of the second edge input capture related
to the speed */
volatile tU32 rpm_delta_time; /* Input capture delta time related to the RPM
Rpm_delta_time = Rpm_second_edge_time - Rpm_first_edge_time */
volatile tU16 rpm_first_edge_time; /* Time value of the first edge input capture related
to the RPM */
volatile tU16 rpm_second_edge_time; /* Time value of the second edge input capture related
to the RPM */
volatile tU08 speed_second_edge_flag; /* Flag indicating that second edge input capture event
related to speed will follow */
volatile tU08 speed_capture_done; /* Flag indicating that input capture of the speed was
done */
volatile tU08 rpm_second_edge_flag; /* Flag indicating that second edge input capture event
related to RPM will follow */
volatile tU08 rpm_capture_done; /* Flag indicating that input capture of the RPM
was done */
volatile tU08 trip_flag; /* TRIP value indication flag */
volatile tU08 fuel_empty_flag; /* Fuel empty indication flag */
#define SAMPLE_PERIOD 8 /* Sample period in [us] for the input capture impulses */
#define MAX_STEPS 3200L /* Max # of steps of the stepper motor for max angle
indication */
#define MAX_SPEED 240L /* Max speed in [km/ho] to be indicated by speedometer */
#define WHEEL_PERIMETER 133 /* Wheel perimeter in [cm] */
#define PULSES_TURN 4 /* # of pulses per wheel revolution */
#define SPEEDO_CONST
(((3600*MAX_STEPS)/(PULSES_TURN*SAMPLE_PERIOD*(MAX_SPEED-10)))*10)*WHEEL_PERIMETER
/* Speedometer constant */
#define ODOMETER_CONST (10000L*PULSES_TURN)/WHEEL_PERIMETER
/* # of pulses per 100m */
#define SPEEDO_WATCH_PERIOD 65535 /* Max. period in [#*8us] for the speedo input watching */
#define MAX_STEPS_RPM 3114L /* Max # of steps of the stepper motor for max angle
indication */
#define MAX_RPM 12L /* Max RPM in 1000*[rev/min] to be indicated by
tachometer */
#define PULSES_REV_RPM 1 /* # of pulses per motor revolution */
#define RPM_CONST
(((6000*MAX_STEPS_RPM)/(PULSES_REV_RPM*SAMPLE_PERIOD*((2*MAX_RPM)-1)))*20)
/* RPM constant */
#define RPM_WATCH_PERIOD 65535 /* Max. period in [#*8us] for the Rpm input watching */
Table 4-9 shows the Cluster for Motorbikes software memory usage.
4.3.1 Application
This subsection summarizes the Cluster for Motorbikes application for the
reference design.
The application main routine (speedo.c) can be divided from the functionality
point of view in two parts: introductory part and main loop. The introductory part
is executed just once after the program start and the main loop is an endless
one. The introductory part performs hardware initialization and hardware
functionality presentation tasks. The main loop performs the other tasks. The
flow chart of the application can be seen in Figure 4-1.
RESET
INTRODUCTORY PART
HARDWARE
INITIALIZATION
HARDWARE
FUNCTIONALITY
PRESENTATION
MAIN LOOP
Freescale Semiconductor, Inc...
SPEEDOMETER
TASK
ODOMETER
TASK
TACHOMETER
TASK
FUEL GAUGE
TASK
SIGNAL FROM
THE SENSOR
INTERRUPT
216 –1
Freescale Semiconductor, Inc...
INTERRUPT
TIMER
VALUE
0
Int_Timer1CH0() Int_Timer1CH0()
speed_first_edge_time speed_second_edge_time
Apart from speed, there are other factors that have an impact on the period of
the pulses. They are:
• number of magnets attached to the wheel (number of pulses per wheel
revolution) — (PULSES_TURN)
• the circumference of the wheel (WHEEL_PERIMETER)
/******************************************************************************/
/* S P E E D O M E T E R D E F I N E S */
/******************************************************************************/
/* public defines for user's reconfiguration */
#define SAMPLE_PERIOD 8 /* Sample period in [us] for the input capture impulses */
//#define MAX_DELTA 65535 /* Max delta of input capture pulses */
#define MAX_STEPS 3200L /* Max # of steps of the stepper motor for max angle indication */
#define MAX_SPEED 240L /* Max speed in [km/hod] to be indicated by speedometer */
#define WHEEL_PERIMETER 133 /* Wheel perimeter in [cm] */
#define PULSES_TURN 4 /* # of pulses per wheel revolution */
Freescale Semiconductor, Inc...
#define SPEEDO_CONST
(((3600*MAX_STEPS)/(PULSES_TURN*SAMPLE_PERIOD*(MAX_SPEED-10)))*10)*WHEEL_PERIMETER /*
Speedometer constant */
#define ODOMETER_CONST (10000L*PULSES_TURN)/WHEEL_PERIMETER /* # of pulses per 100m */
The calculated speed pointer position is sent to the GDIC with the following
macro command:
POS0R_CMD(speed)
For more details about the macro command refer to 4.3.3 MC33970 Device
Control.
The odometer records the distance that the motorbike has travelled; it is
recorded in kilometres or miles. The odometer in the application records the
total distance travelled, and also the distance of individual trips. These can be
reset to zero.
/*****************************************************************************
* Function: Odometer_service (void)
*
* Description: Odometer service function
*
* Returns: none
*
* Notes: This function calculates data on the distance traveled and displays it.
* It uses global variables:
* - Odobase
*
* execution time 760us if TRIP display
* execution time 828us if ODO display
* executed every 1,5 sec
*****************************************************************************/
The tachometer gives the engine speed in revolutions per minute (rpm). The
digital tachometer is operated by a revolution sensor or engine control unit that
outputs electrical pulses to be processed by the microcontroller. The
microcontroller measures the frequency or period of the pulses and uses them
to calculate the rpm. The rpm is converted into the number of steps to be sent
to the stepper motor driving the rpm pointer. The functional diagram of the
tachometer task can be seen in Figure 4-3.
SIGNAL FROM
THE SENSOR
INTERRUPT
216 –1
Freescale Semiconductor, Inc...
INTERRUPT
TIMER
VALUE
0
Int_Timer1CH1() Int_Timer1CH1()
rpm_first_edge_time rpm_second_edge_time
The period of the pulses is affected by the number of pulses per motor
revolution (PULSES_REV_RPM). This factor is taken into consideration in the
“RPM_CONST” constant defined in the speedo.h file. See the code listing
below.
/******************************************************************************/
/* R P M D E F I N E S */
/******************************************************************************/
#define MAX_STEPS_RPM 3114L /* Max # of steps of the stepper motor for max angle
indication */
#define MAX_RPM 12L /* Max RPM in 1000*[rev/min] to be indicated by tachometer */
#define PULSES_REV_RPM 1 /* # of pulses per motor revolution */
#define RPM_CONST
(((6000*MAX_STEPS_RPM)/(PULSES_REV_RPM*SAMPLE_PERIOD*((2*MAX_RPM)-1)))*20) /* RPM constant */
The rpm, in the number of pointer steps driven by the stepper motor, is
calculated by the following equation:
rotation= (RPM_CONST/rpm_delta_time)
The calculated rpm pointer position is sent to the GDIC with the following macro
command:
Freescale Semiconductor, Inc...
POS1R_CMD(rotation)
For more details about the macro command refer 4.3.3 MC33970 Device
Control.
In the fuel tank, a float moves a simple arm which rubs against a variable
resistor according to fuel level. The microcontroller measures the sensing
voltage across the resistor and drives the fuel gauge indicator. The
Fuel_ind_service () routine serves the fuel gauge task.
For the SPI communication, the polling approach was chosen so that the SPI
interrupt is disabled.
/******************************************************************************
* Function: SPI_Init(void)
*
* Description: SPI initialization
*
*
* Returns: none
*
* Notes:
*
******************************************************************************/
void SPI_Init(void)
Freescale Semiconductor, Inc...
There are a couple of different SPI channel settings applicable for devices. The
first of them is the SPI format; for the GDIC-MC33970, the most significant bit
is transferred first. The second divergence is in the SPI Clock phase bit
settings; for the MC33970 device, this value has to be equal to one (the first
SCLK edge is issued at the beginning of the 8-cycle transfer operation). The
device uses a 16-bit long SPI format of communication.
/******************************************************************************
* Function: SPI_SendRecv16(tU16 data)
*
* Description: SPI send and receive data
*
*
* Returns: SPI received data
Freescale Semiconductor, Inc...
*
* Notes:
*
******************************************************************************/
The MC33970 device is controlled from the microcontroller via the 16-bit SPI
protocol and reports back the status information. The MC33970 uses six
registers to control the device. The registers are addressed via D15:D13 of the
SPI word. See Table 4-10. For more details refer to the MC33970 Data Sheet
(Motorola document order number MC33970/D).
The control of the device is done by macros defined in the GDIC970.h file. The
macro creates a 16-bit SPI data word and calls SPI_SendRecv16(tU16 data)
function. The symbolic constants for the parameters of the macros are defined
in GDIC970.h. A short description of all macro syntaxes is made in the following
subsections.
PECCR_CMD(nullcmd,statusselect,gaugepos,rtzloc,aircore,clkcalsel,clkcal,o
scadj,gauge1,gauge0)
• nullcmd
– Enables or disables the Null Command for the device Status read.
NULL_CMD_ENA
NULL_CMD_DIS
• statusselect
– Selects the information that is clocked out of the MISO bit
STATUS_OUT
ACCUM_OUT
POS_OUT
SPEED_OUT
• gaugepos
– Selects the gauge for which the zero position will be determined by
“rtzloc” parameter
GAUGE1_POSITION
GAUGE0_POSITION
• rtzloc
– Determines the zero position for the gauge selected by “gaugepos”
parameter
CW_ZERO_POSITION
CCW_ZERO_POSITION
• aircore
Freescale Semiconductor, Inc...
VELR_CMD(gauge1vel,gauge0vel,maxvel)
• gauge1vel
– Specifies whether the maximum velocity specified in the “maxvel”
parameter will apply to gauge 1 or not.
VEL_NOTAPPLY_G1
VEL_APPLY_G1
• gauge0vel
Freescale Semiconductor, Inc...
This macro controls “Gauge Return to Zero Register”. Syntax of the macro is
the following:
RTZR_CMD(rtzevent,rtzdir,rtzenable,gaugesel)
• rtzevent
– This parameter selects between Unconditional or Automatic return
to zero events
RTZ_AUTO
RTZ_UNCON
• rtzdir
Freescale Semiconductor, Inc...
RTZCR_CMD(fsmul,preloadval,rtzblnk,rtzfullstp)
• fsmul
– This parameter determines the multiplier “M” of the equation .
FS_MUL1
Freescale Semiconductor, Inc...
FS_MUL2
FS_MUL4
FS_MUL8
• preloadval
– Determines the value that is used for the calculation of the preloaded
value into the RTZ integration accumulator, to adjust the detection
threshold. Value ranges from 0 to 63.
• rtzblnk
– This parameter determines the RTZ blanking time “blanking(t)” of the
equation .
RTZBLNK512
RTZBLNK768
• rtzfullstp
– Determines the time variable “Delta(t)” of the equation .
FST0
FST4096
FST8192
FST12288
FST16384
FST20480
FST24576
FST28672
FST32768
FST36864
FST40960
FST45056
FST49152
FST53248
FST57344
FST61440
The LCD display used in the application contains six 7-segment digits and four
labels; ODO, TRIP, A, B. Symbolic labels for each segment of the 7-segment
digit can be seen in Figure 4-5
f b
g
e c
Freescale Semiconductor, Inc...
The LCD symbols coding is done through the coding table. See Figure 4-6.
/******************************************************************************
* Function: Lcd_init(void)
*
* Description: LCD initialization
*
*
* Returns: none
*
* Notes:
*
******************************************************************************/
void Lcd_init(void)
{
LCDCLK = LCD_CTL_INIT;
LDAT1 = 0;
LDAT2 = 0;
LDAT3 = 0;
LDAT4 = 0;
LDAT5 = 0;
LDAT6 = 0;
LDAT7 = 0;
LCDCR_LCDE = 1; /* LCD enable */
}
The MCU has an embedded Keyboard Interrupt module (KBI) that can provide
eight independently maskable external interrupts. When a port pin is enabled
for keyboard interrupt function, an internal 30 kOhm pull-up device is enabled
on the pin. The application uses two pins only: KBI0, and KBI4. The KBI0 pin
serves the “ODO/TRIP” switch, and the KBI4 serves power down sensing
function.
/******************************************************************************
* Function: Keyboard_init(void)
*
* Description: keyboard initialization
*
*
* Returns: none
*
* Notes:
*
******************************************************************************/
void Keyboard_init(void)
{
KBSCR_IMASKK = 1; /* Mask keyboard interrupts */
KBIER_KBIE0 = 1; /* Enable KBIE0 pin */
KBIER_KBIE4 = 1; /* Enable KBIE4 pin */
KBSCR_ACKK = 1; /* Clear any keyboard interrupts */
KBSCR_IMASKK = 0; /* NOT Mask keyboard interrupts */
}
The MCU provides Timer Interface Module (TIM), which is a two-channel timer
that provides a timing reference with input capture, output compare, and
pulse-width modulation functions. The application uses both timers. Timer 1 is
used in the input capture mode to measure periods of the pulses from the
speed and revolution sensors. Timer 2 is used in the output compare mode to
perform watchdog periods for the speedometer and tachometer functions.
/******************************************************************************
* Function: Timer1_init(void)
*
* Description: timer initialization
*
*
Freescale Semiconductor, Inc...
* Returns: none
*
* Notes:
*
******************************************************************************/
void Timer1_init(void)
{
T1SC = TIMER_PRESC_32; /* Setup Timer for bus clock 4MHz/32 = 8 usec/count */
T1SC0 = TIMER_INP_CAP_FALLING; /* Capture on falling edge of ch0 */
T1SC1 = TIMER_INP_CAP_FALLING; /* Capture on falling edge of ch1 */
}
The Timer2_init() routine initializes both channels of the TIM2 module for the
output compare function.
/******************************************************************************
* Function: Timer2_init(void)
*
* Description: timer initialization
*
*
* Returns: none
*
* Notes:
*
******************************************************************************/
void Timer2_init(void)
{
T2SC = TIMER_PRESC_32; /* Setup Timer for bus clock 4MHz/32 = 8 usec/count */
T2SC0 = TIMER_OUT_PRESET0;
T2CH0H = 0;
T2CH0L = 0;
T2SC1 = TIMER_OUT_PRESET0;
T2CH1H = 0;
T2CH1L = 0;
}
The Analog to Digital Converter (ADC) measures the signal from the fuel level
sensor. The ADC has a 6-channel 10-bit linear successive approximation. The
application uses only one channel of the ADC with 8-bit resolution.
Freescale Semiconductor, Inc...
/*****************************************************************************
* Function: unsigned char Ad_convert(unsigned char chan)
*
* Description: services A/D conversion in a 8-bit truncation mode
*
* Returns: unsigned char - content of the ADRL register
*
* Notes:
*
*
*
*****************************************************************************/
The SCI module is not utilized within the application, it is used by the
Developer’s Serial Bootloader for M68HC08. It allows an in-circuit
reprogramming of Motorola’s M68HC08 FLASH devices using standard
communication media (e.g., a serial asynchronous port). For further
information, refer to application note entitled Developer’s Serial Bootloader for
M68HC08 (Motorola document order number AN2295). The serial bootloader
offers a zero-cost solution for applications already equipped with a serial
interface and that have SCI pins available on a connector.
Dstributor
Item Quantity Reference Part
Freescale Semiconductor, Inc...
Number
1 2 C1,C15 470µF/35V Farnell 320-1600
2 2 C5,C2 1µF/50V Farnell 556-312
3 2 C12,C3 1nF C0805
4 1 C4 100µF/6.3V Farnell 556-130
C6,C9,C10,C11,C13,
5 7 100nF C0805 Farnell 499-687
C14,C16
6 2 C7,C8 27pF C0805
C17,C18 10nF C0805
7 2
C19 33nF C0805
8 1 D2,D3 MRA4007T3 ON Semiconductor
9 4 D1,D4,D6,D7 1N4148
10 2 D2,D3 MRA4007T3 ON Semiconductor
11 1 D5 BZX84C9V1 ON Semiconductor
12 2 D9,D10 BZX84C4V3 ON Semiconductor
13 1 D8 1SMA5939BT3 ON Semiconductor
14 1 JP1 HDR 5X1 Molex Molex 39-30-2050
15 1 JP2 HDR 3X2 Farnell 511-780
16 1 J1 HEADER 4 Molex Molex 43650-0401
17 1 J3 HDR8 Molex Molex 43045-0812
18 1 L1 BEAD Steward
19 2 Q1,Q2 BC847B Farnell 932-980
20 1 Q3 BCP52 Farnell 932-954
21 1 R1 27k R0805
R2,R5,R8,R9,R10,R11,
22 10 10k R0805 Farnell 911-975
R12,R13,R18,R22
23 1 R3 39k R0805
Dstributor
Item Quantity Reference Part
Number
24 1 R4 15k R0805
25 1 R6 330k R0805
26 1 R7 10M R0805
27 2 R14,R15 100k R0805
28 1 R16 3R9
29 1 R17 33R R0805
30 1 R19 1k5 R0805
31 2 R20,R21 4k7 R0805
Freescale Semiconductor, Inc...
5 4 3 2 1
VCC
FUEL INDICATOR
DRM059
1
VCC Connection
D4
R21
2
VCC J3 C16 4k7
1 5 .1uF
1
25V U5
1
2
R17 1N4148
MOTOROLA
2 6
33 D6 1 5
A0 SDA
1N4148 3 7 2
A1
2
D D
4 8 6
SCL
E R13 10k HDR8 7
Q3 B WP
BCP52
C1 C M24C04-MN6
R20 4k7
1 2 R12 R11 R10 R9 VCC
10K 10K 10K 10K
1
KBI0
C13 D9 D10 VCC
RTZ
.1uF
1
1
1
1
RSTB
2
50V
2
2
BZX84C4V3 BZX84C4V3 C9 C14
.1uF L1 BEAD .1uF
25V 25V U7
1
1
48
47
46
45
44
43
42
41
40
39
38
37
36
35
34
33
MC68HC908LJ12CPB SW1
2
2
2
2
CAL0
CAL1
VREFL
VREFH
CAL2
PTD0/SS
PTA3/KBI3
PTA2/KBI2
PTA1/KBI1
PTA0/KBI0
49 32 CAL3
PTC7/FP26
PTC6/FP25
PTC5/FP24
PTB7/ADC5
PTB6/ADC4
PTA7/ADC3
PTA6/ADC2
PTA5/ADC1
PTA4/ADC0
C7 VDDA RST
XT/C 0.032TC
2 1 50 31
VDD IRQ SWITCH-4
1
X1 51 30
27pF R7 VSS PTC4/FP23
25V 10M 52 29 CAL3
OSC1 PTC3/FP22
53 28 CAL2
C8 R6 OSC2 PTC2/FP21
C19 33nF R22 10k
2
2 1 1 2 1 2 54 27 CAL1
CGMXFC PTC1/FP20
1 2 55 26
27pF 330k C18 10nF PTB0/TxD PTD1/MISO
25V PROGRAMMING CONNECTOR 56 25
VCC JP2 HDR 3X2 PTB1/RxD PTD2/MOSI
CAL0 U4
C 1 2 57 24 C
PTB2/T1CH0 PTC0/FP19
3 4 1 4
KEY SIN- COS-
5 6 58 23 1A 4A
PTB3/T1CH1 FP18 SIN- COS-
TP7 59 22 2 3
F343-742/2,5W/Silicone Coated Wirewound PTB4/T2CH0 FP17 SIN+ COS+
2A 3A
R16 3R9 VBAT VCC SIN+ COS+
U2 60 21
TP8 PTB5/T2CH1 FP16
MC7805BT
1 2 1 VIN 3 1 2 TP9 COM0 61 20 STEPPER MOTOR
VOUT BP0 FP15
R19 1k5 COM1 TP4 TP3 TP1 TP2
62 19
1
D8 GND BP1 FP14
C1 + + C15 + C4 COM2 63 18 SEG11
2
BP2 FP13 HEADER 4
D2 1SMA5939BT3 100uF/6.3V
470uF/35V 470uF/35V IRQ 64 17 U3
2
MRA4007T3 PTD4/KBI4 PTD3/SPSCK TACHO
1 24 1
COS 0+ COS 1+ STEPPER MOTOR
2 23 2
COS 0- COS 1- Connection
HDR 5X1 3 22 3
FP0/BP3
PTD5/KBI5
FP1
FP2
FP3
FP4
FP5
FP6
FP7
FP8
PTD6/KBI6
PTD7/KBI7
FP9
FP10
FP11
FP12
SIN 0+ SIN 1+
D3 4 21 4
VBAT+ SIN 0- SIN 1-
5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
4 SPEED SNS 5 20
FUEL SNS MRA4007T3 PGND1 PGND8
3 6 19 J1
RPM SNS PGND2 PGND7
2 7 18
VBAT- R4 PGND3 PGND6 VBAT
1 8 17
15k PGND4 PGND5
JP1 9 16
CSB VPWR
COM3
SEG0
SEG1
SEG2
SEG3
SEG4
SEG5
SEG6
SEG7
SEG8
SEG9
SEG10
D7 1N4148 10 15 VCC
MAIN CINNECTOR IRQ SCLK RSTB
11 14
1
SO VDD C11
12 13
1
25V
2
25V
1
R5
10k C6
2
.1uF
25V
RTZ
RSTB
B B
VCC
SEG0
SEG1
SEG2
SEG3
SEG4
SEG5
SEG6
SEG7
SEG8
SEG9
SEG10
SEG11
R2
10k
Odometer
+
1 2 B Q1 COM1
SEG10
SEG11
1
1
Go to: www.freescale.com
C3 E COM2
1nF D1 R14 COM2
1
25V 1N4148 100k C17 COM3
2
10nF COM3
2
2
25V
1
Odometer
S1
VCC KSC241J
3
BUTTON
TP5
R8
10k
Freescale Semiconductor, Inc.
+
1 2 1 2 B Q2
BC847B
1
1
C12 D5 E
1nF BZX84C9V1 R15
A 25V 100k A
2
2
MCSL Roznov
1. maje 1009
756 61 Roznov p.R., Czech Republic, Europe
Title
CLUSTER
Author: Jaromir Chocholac
Size Schematic Name: Speedo Rev
C D:\CCWORK\R28107_PLM_VIEW_LATEST\APD\APD114\HW\PRICOL\00176_03\00176_03.DSN
0.2
Design File Name:
Modify Date: Friday, December 12, 2003 Sheet 1 of 1
Copyright Motorola 2001 POPI Status: MOTOROLA General Business
5 4 3 2 1
67
Designer Reference Manual
Freescale Semiconductor, Inc...
68
5 4 3 2 1
LCD_PRICOL
U10
D D
COM0
COM1
COM2
SEG0
SEG1
SEG2
SEG3
SEG4
SEG5
SEG6
SEG7
SEG8
SEG9
SEG10
SEG11
COM3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
COM3
B B
Go to: www.freescale.com
For More Information On This Product,
Freescale Semiconductor, Inc.
MCSL Roznov
1. maje 1009
756 61 Roznov p.R., Czech Republic, Europe
A Title A
CLUSTER
Author: Jaromir Chocholac
Size Schematic Name: Odometer Rev
A 0.2
Design File Name: D:\CCWORK\R28107_PLM_VIEW_LATEST\APD\APD114\HW\PRICOL\00176_03\00176_03.DSN
5 4 3 2 1
MOTOROLA
DRM059
Freescale Semiconductor, Inc...
DRM059
5 4 3 2 1
MOTOROLA
D D
FUEL INDICATOR
Connection TP8 U1
1 DI1 DO1 18
J3
2 DI2 DO2 17
1 5 3 DI3 DO3 16
TP4 4 15 1 2
TP7 TP2 DI4 DO4 R5 680R
C 2 6 5 DI5 DO5 14 1 2 C
TP1 6 13 1 2 R4 0.05
TP3 TP3 DI6 DO6 R3 390R
3 7 7 DI7 DO7 12 1 2
TP5 8 11 1 2 R2 390R
TP1 TP8 DI8 DO8 R1 270R
4 8 9 10
10
9
8
7
6
5
4
3
2
1
+VS GND
G
G
G
Y
Y
Y
Y
R
R
R
HDR8 D4
TP2 UDN2981A HDSP4832
TP7
TP4
11
12
13
14
15
16
17
18
19
20
TP5
B B
Go to: www.freescale.com
For More Information On This Product,
Freescale Semiconductor, Inc.
A MCSL Roznov A
1. maje 1009
756 61 Roznov p.R., Czech Republic, Europe
Title
CLUSTER
Author: Jaromir Chocholac
Size Schematic Name: Fuel Indicator Rev
B D:\CCWORK\R28107_PLM_VIEW_LATEST\APD\APD114\HW\PRICOL\FUEL\FUELIND.DSN
0.2
Design File Name:
Modify Date: Tuesday, October 14, 2003 Sheet 1 of 1
Copyright Motorola 2001 POPI Status: MOTOROLA General Business
5 4 3 2 1
69
Designer Reference Manual
Freescale Semiconductor, Inc.
Bill of Materials and Schematics
Freescale Semiconductor, Inc...
Glossary
accumulators (A and B or D) — Two 8-bit (A and B) or one 16-bit (D) general-purpose registers in the
CPU. The CPU uses the accumulators to hold operands and results of arithmetic and logic
Freescale Semiconductor, Inc...
operations.
acquisition mode — A mode of PLL operation with large loop bandwidth. Also see ’tracking mode’.
address bus — The set of wires that the CPU or DMA uses to read and write memory locations.
addressing mode — The way that the CPU determines the operand address for an instruction. The
M68HC12 CPU has 15 addressing modes.
arithmetic logic unit (ALU) — The portion of the CPU that contains the logic circuitry to perform
arithmetic, logic, and manipulation operations on operands.
asynchronous — Refers to logic circuits and operations that are not synchronized by a common
reference signal.
ATD — See “analogue-to-digital converter”.
baud rate — The total number of bits transmitted per unit of time.
binary number system — The base 2 number system, having two digits, 0 and 1. Binary arithmetic is
convenient in digital circuit design because digital circuits have two permissible voltage levels, low
and high. The binary digits 0 and 1 can be interpreted to correspond to the two digital voltage
levels.
binary-coded decimal (BCD) — A notation that uses 4-bit binary numbers to represent the 10 decimal
digits and that retains the same positional structure of a decimal number. For example,
MOTOROLA Glossary 71
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Glossary
branch instruction — An instruction that causes the CPU to continue processing at a memory location
other than the next sequential address.
break module — The break module allows software to halt program execution at a programmable point
in order to enter a background routine.
breakpoint — A number written into the break address registers of the break module. When a number
appears on the internal address bus that is the same as the number in the break address registers,
the CPU executes the software interrupt instruction (SWI).
break interrupt — A software interrupt caused by the appearance on the internal address bus of the
Freescale Semiconductor, Inc...
central processor unit (CPU) — The primary functioning unit of any computer system. The CPU controls
the execution of instructions.
clock generator module (CGM) — The CGM module generates a base clock signal from which the
system clocks are derived. The CGM may include a crystal oscillator circuit and/or phase-locked
loop (PLL) circuit.
comparator — A device that compares the magnitude of two inputs. A digital comparator defines the
equality or relative differences between two binary numbers.
computer operating properly module (COP) — A counter module that resets the MCU if allowed to
overflow.
condition code register (CCR) — An 8-bit register in the CPU that contains the interrupt mask bit and
five bits that indicate the results of the instruction just executed.
control bit — One bit of a register manipulated by software to control the operation of the module.
72 Glossary MOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Glossary
control unit — One of two major units of the CPU. The control unit contains logic functions that
synchronize the machine and direct various operations. The control unit decodes instructions and
generates the internal control signals that perform the requested operations. The outputs of the
control unit drive the execution unit, which contains the arithmetic logic unit (ALU), CPU registers,
and bus interface.
which clock drives SYSCLK for the main system, including the CPU and buses. When EXTALi
drives the SYSCLK, the CPU or bus clock frequency (fo) is equal to the EXTALi frequency divided
by 2.
CPU cycles — A CPU cycle is one period of the internal bus clock, normally derived by dividing a crystal
oscillator source by two or more so the high and low times will be equal. The length of time
required to execute an instruction is measured in CPU clock cycles.
CPU registers — Memory locations that are wired directly into the CPU logic instead of being part of the
addressable memory map. The CPU always has direct access to the information in these
registers. The CPU registers in an M68HC12 are:
A (8-bit accumulator)
B (8-bit accumulator)
D (16-bit accumulator formed by concatenation of accumulators A and B)
IX (16-bit index register)
IY (16-bit index register)
SP (16-bit stack pointer)
PC (16-bit program counter)
CCR (8-bit condition code register)
decimal number system — Base 10 numbering system that uses the digits zero through nine.
duty cycle — A ratio of the amount of time the signal is on versus the time it is off. Duty cycle is usually
represented by a percentage.
EEPROM — Electrically erasable, programmable, read-only memory. A nonvolatile type of memory that
can be electrically erased and reprogrammed.
EPROM — Erasable, programmable, read-only memory. A nonvolatile type of memory that can be erased
by exposure to an ultraviolet light source and then reprogrammed.
MOTOROLA Glossary 73
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Glossary
enhanced capture timer (ECT) — The HC12 Enhanced Capture Timer module has the features of the
HC12 Standard Timer module enhanced by additional features in order to enlarge the field of
applications.
exception — An event such as an interrupt or a reset that stops the sequential execution of the
instructions in the main program.
free-running counter — A device that counts from zero to a predetermined number, then rolls over to
zero and begins counting again.
Freescale Semiconductor, Inc...
full-duplex transmission — Communication on a channel in which data can be sent and received
simultaneously.
hexadecimal — Base 16 numbering system that uses the digits 0 through 9 and the letters A through F.
index registers (IX and IY) — Two 16-bit registers in the CPU. In the indexed addressing modes, the
CPU uses the contents of IX or IY to determine the effective address of the operand. IX and IY
can also serve as a temporary data storage locations.
input/output (I/O) — Input/output interfaces between a computer system and the external world. A CPU
reads an input to sense the level of an external signal and writes to an output to change the level
on an external signal.
instructions — Operations that a CPU can perform. Instructions are expressed by programmers as
assembly language mnemonics. A CPU interprets an opcode and its associated operand(s) and
instruction.
inter-IC bus (I2C) — A two-wire, bidirectional serial bus that provides a simple, efficient method of data
exchange between devices.
interrupt — A temporary break in the sequential execution of a program to respond to signals from
peripheral devices by executing a subroutine.
interrupt request — A signal from a peripheral to the CPU intended to cause the CPU to execute a
subroutine.
I/O — See “input/output (I/0).”
latch — A circuit that retains the voltage level (logic 1 or logic 0) written to it for as long as power is applied
to the circuit.
74 Glossary MOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Glossary
latency — The time lag between instruction completion and data movement.
mark/space — The logic 1/logic 0 convention used in formatting data in serial communication.
Freescale Semiconductor, Inc...
mask — 1. A logic circuit that forces a bit or group of bits to a desired state. 2. A photomask used in
integrated circuit fabrication to transfer an image onto silicon.
MCU — Microcontroller unit. See “microcontroller.”
memory location — Each M68HC12 memory location holds one byte of data and has a unique address.
To store information in a memory location, the CPU places the address of the location on the
address bus, the data information on the data bus, and asserts the write signal. To read
information from a memory location, the CPU places the address of the location on the address
bus and asserts the read signal. In response to the read signal, the selected memory location
places its data onto the data bus.
modulo counter — A counter that can be programmed to count to any number from zero to its maximum
possible modulus.
Motorola interconnect bus (MI-Bus) — The Motorola Interconnect Bus (MI Bus) is a serial
communications protocol which supports distributed real-time control efficiently and with a high
degree of noise immunity.
Motorola scalable CAN (msCAN) — The Motorola scalable controller area network is a serial
communications protocol that efficiently supports distributed real-time control with a very high
level of data integrity.
multiple serial interface — A module consisting of multiple independent serial I/O sub-systems, e.g. two
SCI and one SPI.
MOTOROLA Glossary 75
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Glossary
multiplexer — A device that can select one of a number of inputs and pass the logic level of that input
on to the output.
nibble — A set of four bits (half of a byte).
object code — The output from an assembler or compiler that is itself executable machine code, or is
suitable for processing to produce executable machine code.
open-drain — An output that has no pullup transistor. An external pullup device can be connected to the
power supply to provide the logic 1 output voltage.
operand — Data on which an operation is performed. Usually a statement consists of an operator and
Freescale Semiconductor, Inc...
an operand. For example, the operator may be an add instruction, and the operand may be the
quantity to be added.
oscillator — A circuit that produces a constant frequency square wave that is used by the computer as
a timing and sequencing reference.
OTPROM — One-time programmable read-only memory. A nonvolatile type of memory that cannot be
reprogrammed.
overflow — A quantity that is too large to be contained in one byte or one word.
parity — An error-checking scheme that counts the number of logic 1s in each byte transmitted. In a
system that uses odd parity, every byte is expected to have an odd number of logic 1s. In an even
parity system, every byte should have an even number of logic 1s. In the transmitter, a parity
generator appends an extra bit to each byte to make the number of logic 1s odd for odd parity or
even for even parity. A parity checker in the receiver counts the number of logic 1s in each byte.
The parity checker generates an error signal if it finds a byte with an incorrect number of logic 1s.
phase-locked loop (PLL) — A clock generator circuit in which a voltage controlled oscillator produces
an oscillation which is synchronized to a reference signal.
PLL — See "phase-locked loop (PLL)."
pointer — Pointer register. An index register is sometimes called a pointer register because its contents
are used in the calculation of the address of an operand, and therefore points to the operand.
polarity — The two opposite logic levels, logic 1 and logic 0, which correspond to two different voltage
levels, VDD and VSS.
polling — Periodically reading a status bit to monitor the condition of a peripheral device.
76 Glossary MOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Glossary
prescaler — A circuit that generates an output signal related to the input signal by a fractional scale factor
such as 1/2, 1/8, 1/10 etc.
program — A set of computer instructions that cause a computer to perform a desired operation or
operations.
program counter (PC) — A 16-bit register in the CPU. The PC register holds the address of the next
instruction or operand that the CPU will use.
pull — An instruction that copies into the accumulator the contents of a stack RAM location. The stack
RAM address is in the stack pointer.
pullup — A transistor in the output of a logic gate that connects the output to the logic 1 voltage of the
Freescale Semiconductor, Inc...
power supply.
pulse-width — The amount of time a signal is on as opposed to being in its off state.
pulse-width modulation (PWM) — Controlled variation (modulation) of the pulse width of a signal with
a constant frequency.
push — An instruction that copies the contents of the accumulator to the stack RAM. The stack RAM
address is in the stack pointer.
PWM period — The time required for one complete cycle of a PWM waveform.
RAM — Random access memory. All RAM locations can be read or written by the CPU. The contents of
a RAM memory location remain valid until the CPU writes a different value or until power is turned
off.
RC circuit — A circuit consisting of capacitors and resistors having a defined time constant.
reserved memory location — A memory location that is used only in special factory test modes. Writing
to a reserved location has no effect. Reading a reserved location returns an unpredictable value.
reset — To force a device to a known condition.
serial peripheral interface module (SPI) — A module that supports synchronous communication.
set — To change a bit from logic 0 to logic 1; opposite of clear.
shift register — A chain of circuits that can retain the logic levels (logic 1 or logic 0) written to them and
that can shift the logic levels to the right or left through adjacent circuits in the chain.
MOTOROLA Glossary 77
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Glossary
signed — A binary number notation that accommodates both positive and negative numbers. The most
significant bit is used to indicate whether the number is positive or negative, normally logic 0 for
positive and logic 1 for negative. The other seven bits indicate the magnitude of the number.
software interrupt (SWI) — An instruction that causes an interrupt and its associated vector fetch.
SPI — See "serial peripheral interface module (SPI)."
stack — A portion of RAM reserved for storage of CPU register contents and subroutine return
addresses.
stack pointer (SP) — A 16-bit register in the CPU containing the address of the next available storage
Freescale Semiconductor, Inc...
start bit — A bit that signals the beginning of an asynchronous serial transmission.
stop bit — A bit that signals the end of an asynchronous serial transmission.
subroutine — A sequence of instructions to be used more than once in the course of a program. The last
instruction in a subroutine is a return from subroutine (RTS) instruction. At each place in the main
program where the subroutine instructions are needed, a jump or branch to subroutine (JSR or
BSR) instruction is used to call the subroutine. The CPU leaves the flow of the main program to
execute the instructions in the subroutine. When the RTS instruction is executed, the CPU returns
to the main program where it left off.
synchronous — Refers to logic circuits and operations that are synchronized by a common reference
signal.
timer — A module used to relate events in a system to a point in time.
toggle — To change the state of an output from a logic 0 to a logic 1 or from a logic 1 to a logic 0.
tracking mode — A mode of PLL operation with narrow loop bandwidth. Also see ‘acquisition mode.’
two’s complement — A means of performing binary subtraction using addition techniques. The most
significant bit of a two’s complement number indicates the sign of the number (1 indicates
negative). The two’s complement negative of a number is obtained by inverting each bit in the
number and then adding 1 to the result.
unbuffered — Utilizes only one register for data; new data overwrites current data.
unimplemented memory location — A memory location that is not used. Writing to an unimplemented
location has no effect. Reading an unimplemented location returns an unpredictable value.
78 Glossary MOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Glossary
vector — A memory location that contains the address of the beginning of a subroutine written to service
an interrupt or reset.
voltage-controlled oscillator (VCO) — A circuit that produces an oscillating output signal of a frequency
that is controlled by a dc voltage applied to a control input.
waveform — A graphical representation in which the amplitude of a wave is plotted against time.
wired-OR — Connection of circuit outputs so that if any output is high, the connection point is high.
write — The transfer of a byte of data from the CPU to a memory location.
Freescale Semiconductor, Inc...
MOTOROLA Glossary 79
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc.
Glossary
Freescale Semiconductor, Inc...
80 Glossary MOTOROLA
For More Information On This Product,
Go to: www.freescale.com
Freescale Semiconductor, Inc... Freescale Semiconductor, Inc.
JAPAN:
Motorola Japan Ltd.
SPS, Technical Information Center
3-20-1, Minami-Azabu, Minato-ku
Tokyo 106-8573, Japan
81-3-3440-3569
ASIA/PACIFIC:
Motorola Semiconductors H.K. Ltd.
Freescale Semiconductor, Inc...
HOME PAGE:
http://motorola.com/semiconductors
Information in this document is provided solely to enable system and software implementers to use Motorola products.
There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or
integrated circuits based on the information in this document.
Motorola reserves the right to make changes without further notice to any products herein. Motorola makes no warranty,
representation or guarantee regarding the suitability of its products for any particular purpose, nor does Motorola assume
any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability,
including without limitation consequential or incidental damages. “Typical” parameters that may be provided in Motorola
data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All
operating parameters, including “Typicals”, must be validated for each customer application by customer’s technical experts.
Motorola does not convey any license under its patent rights nor the rights of others. Motorola products are not designed,
intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications
intended to support or sustain life, or for any other application in which the failure of the Motorola product could create a
situation where personal injury or death may occur. Should Buyer purchase or use Motorola products for any such
unintended or unauthorized application, Buyer shall indemnify and hold Motorola and its officers, employees, subsidiaries,
affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising
out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even
if such claim alleges that Motorola was negligent regarding the design or manufacture of the part.
MOTOROLA and the Stylized M Logo are registered in the US Patent and Trademark Office. All other product or service
names are the property of their respective owners. Motorola, Inc. is an Equal Opportunity/Affirmative Action Employer.
DRM059/D
Rev. 0
3/2004
For More Information On This Product,
Go to: www.freescale.com