(Dashboard) Using S12HZ256 as a Single

Cluster (Dashboard)
Using S12HZ256 as a
Single-Chip Solution
Designer Reference Manual
HCS12
Microcontrollers
DRM084
Rev. 0
10/2006
freescale.com
Cluster (Dashboard) Using S12HZ256
as a Single-Chip Solution
Designer Reference Manual
by: Kenny Lam
8/16-Bit Applications Engineering, APTSPG
Freescale Semiconductor, Inc.
To provide the most up-to-date information, the revision of our documents on the World Wide Web will be
the most current. Your printed copy may be an earlier revision. To verify that you have the latest
information available, refer to:
http://www.freescale.com
The following revision history table summarizes changes contained in this document. For your
convenience, the page number designators have been linked to the appropriate location.
Revision History
Date
Revision
Level
October,
2006
0
Description
Page
Number(s)
Initial release
N/A
Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc.
This product incorporates SuperFlash® technology licensed from SST.
© Freescale Semiconductor, Inc., 2006. All rights reserved.
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
Freescale Semiconductor
3
Revision History
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
4
Freescale Semiconductor
Table of Contents
Chapter 1
Introduction
1.1
1.2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
System Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Chapter 2
Benefits and Features of the 9S12HZ256 Controller
2.1
2.2
2.3
2.3.1
2.3.2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Basic Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Modes of Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
User Modes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Low-Power Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Chapter 3
Stepper Motor Drive Theory
3.1
3.2
3.3
3.4
3.5
3.6
3.7
3.8
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Stepper Motor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Stepper Motor Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Stepper Motor Micro-Stepping Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Stepper Stall Detection (SSD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LCD Driver for LCD Display Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LCD2 Panel Initialization and Checking. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LCD2 Panel Firmware (API) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13
13
14
17
19
21
22
23
Chapter 4
Software Integration
4.1
4.2
4.3
4.4
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Micro-Stepping Control Using Internal Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Motor Running and LCD2 Panel Display Demonstration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Cluster System Demonstration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
25
25
27
28
Chapter 5
Hardware Schematics
Chapter 6
Bill of Materials
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
Freescale Semiconductor
5
Table of Contents
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
6
Freescale Semiconductor
Chapter 1
Introduction
1.1 Introduction
This manual describes the design of a cluster board (dashboard) using Freescale’s S12HZ256
microcontroller unit (MCU). This is a single-chip design for the whole system.
The traditional cluster board uses a cross coil motor to drive the analog pointers (actuator) which move
either clockwise or counterclockwise to indicate the car speed, engine rotation speed, fuel level, engine
temperature, etc. This technology is well established and widely used throughout the world. However,
when the cross coil motor is being assembled, it requires an alignment process. The cross coil motor
displacement linearity is also a drawback in regards to the displacement accuracy (linearity), as it may
need motor fine tuning during cluster board manufacturing. In view of this, stepper motors can be one
alterative solution in this application. In addition, the Moving Magnet Technology (MMT) is more mature
for stepper motors nowadays.
The following are some advantages in having the magnet of a stepper motor move relative to a stationary
coil set.
1. The stationary drive coils are beneficial to a motor structure, as they can deal effectively with heat
dissipation.
2. There are no “flying” leads since the coils are stationary which leads to improved longevity of the
motor.
3. The weight of the stationary coils does not affect the maximum velocity of the motor.
4. There is no frictional wear out because the moving magnet concept does not make contact with
any of the stationary elements of motor.
For cluster applications in the automotive segment, Freescale offers the S12H family of devices which
can support up to six stepper motors. These devices also include, as a single-chip solution, a 32 x 4
segment LCD driver to show time and mileage updates on a LCD panel. The designers have also
integrated Stepper Stall Detection (SSD) in the new derivative of the S12HZ family. This derivative
supports up to four stepper motors with SSD.
This manual is based on the 9S12HZ256 features for designing a cluster application.
NOTE
This document is written for the user who is familiar with the S12H256
family and CodeWarrior for S12 and cluster applications. All hardware
schematic diagrams and firmware source codes are available as reference
materials.
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
Freescale Semiconductor
7
Introduction
1.2 System Overview
Figure 1-1 provides a pictorial overview of the system.
5V Vcc
Vreg
*
I/C0
Vehicle Speed
Engine RPM
Engine Temp.
Batt. Voltage
Fuel Level
Input
Signal
Cond’n
(as req’d)
LM2902
MC33174
MC33184
TL064
PWM
Gauge
Drivers
I/C1
ADC2
LCD
DRIVER
ADC3
I/O
Keys
PWM
LED
SCI
RS232
ADC4
CAN
ADC5
• Integrated LCD Driver
• 32x4
MC9S12Hx
16 Bit MCU
(112 QFP package)
• Integrated Drive for 4 Stepper Motors
With Motor Stall Detection (MSD)
(16 hi-current PWM outputs)
CAN Physical
Interface
• Easier PCB Routing
• Fewer Components
• Higher Reliability
• Cost Effective
Figure 1-1. S12HZ256 Dashboard System
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
8
Freescale Semiconductor
Chapter 2
Benefits and Features of the 9S12HZ256 Controller
2.1 Introduction
As shown in this chapter, the S12HZ family of devices offers an excellent complement of peripherals and
a broad range of memory and packages.
2.2 Basic Features
Some of the S12HZ family benefits are shown below. Features have been broken down by type for your
convenience.
HCS12 Core:
• 16-bit HCS12 CPU
– Upward compatible with M68HC11 instruction set
– Interrupt stacking and programmer’s model identical to M68HC11
– 20-bit ALU
– Instruction queue
– Enhanced indexed addressing
• Multiplexed external bus interface (MEBI)
• Module mapping control (MMC)
• Interrupt control (INT)
• Debugger and breakpoints (DBG)
• Background debug mode (BDM)
Memory:
• 256K, 128K, 64K Flash EEPROM
• 2K, 1K byte EEPROM
• 12K, 6K, 4K byte RAM
CRG:
•
•
•
•
•
•
Low current oscillator
Phase locked loop (PLL)
Reset, clocks
Computer operating properly (COP) watchdog
Real time interrupt
Clock monitor
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
Freescale Semiconductor
9
Benefits and Features of the 9S12HZ256 Controller
Analog-to-digital converter (ADC):
• 16 channels, 10-bit resolution
• External conversion trigger capability
• Two 1M bit per second, CAN 2.0 A, B software compatible modules:
• Five receive and three transmit buffers
• Flexible identifier filter programmable as 2 x 32 bit, 4 x 16 bit, or 8 x 8 bit
• Four separate interrupt channels for Rx, Tx, error, and wake-up
• Low-pass filter wake-up function
• Loop-back for self test operation
Timer:
• 16-bit main counter with 7-bit prescaler
• Eight programmable input capture or output compare channels
• Two 8-bit or one 16-bit pulse accumulators
Six PWM channels:
• Programmable period and duty cycle
• 8-bit 6-channel or 16-bit 3-channel
• Separate control for each pulse width and duty cycle
• Center-aligned or left-aligned outputs
• Programmable clock select logic with a wide range of frequencies
• Fast emergency shutdown input
Serial interfaces:
• Two asynchronous serial communication interfaces (SCI)
• Synchronous serial peripheral interface (SPI)
• Inter-integrated circuit interface (IIC)
Liquid crystal display driver with variable input voltage:
• Configurable for up to 32 frontplanes and 4 backplanes or general purpose input or output
• Five modes of operation allow for different display sizes to meet application requirements
• Unused frontplane and backplane pins can be used as general purpose input or output
16 high current drivers suited for PWM motor control:
• Each PWM channel switchable between two drivers in an H-bridge configuration
• Left, right, and center aligned outputs
• Support for sine and cosine drive
• Dithering
• Output slew rate control
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
10
Freescale Semiconductor
Modes of Operation
Four stepper stall detectors (SSD):
• Full step control during return to zero
• Voltage selector and integrator/sigma delta converter circuit
• 16-bit accumulator register
• 16-bit modulus down counter
112-Pin LQFP and 80-Pin QFP packages:
• 85 I/O lines with 5-V input and drive capability
• 5-V A/D converter inputs
• Eight key wake up interrupts with digital filtering and programmable rising/falling edge trigger
• Operating speed:
• Operation at 50 MHz equivalent to 25 MHz bus speed
Development support:
• Single-wire background debug™ mode (BDM)
• Debugger and on-chip hardware breakpoints
2.3 Modes of Operation
2.3.1 User Modes
User modes include:
• Normal and emulation operating modes
– Normal single-chip mode
– Normal expanded wide mode
– Normal expanded narrow mode
– Emulation expanded wide mode
– Emulation expanded narrow mode
• Special operating modes
– Special single-chip mode with active background debug mode
– Special test mode (Freescale use only)
– Special peripheral mode (Freescale use only)
2.3.2 Low-Power Modes
Low-power modes include:
• Stop mode
• Pseudo stop mode
• Wait mode
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
Freescale Semiconductor
11
Benefits and Features of the 9S12HZ256 Controller
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
12
Freescale Semiconductor
Chapter 3
Stepper Motor Drive Theory
3.1 Introduction
The stepper motor (MMT) is an excellent choice for cluster applications. This application employs high
current drives suited for pulse width modulator (PWM) motor control, which supports sine and cosine
drive, using the 9S12HZ256 device. Software running on the 9S12HZ256 device implements:
• Micro-stepping to achieve precise linear position
• Reduced noise
• Vibration during stepper motor running.
3.2 Stepper Motor
In theory, although a micro-stepping controller offers hundreds of intermediate positions between steps,
but it has some drawbacks. It is worth noting that micro-stepping does not generally offer great precision.
This is because of both linearity problems and the effects of static friction.
The utility of micro-stepping is limited by several considerations:
1. The angular precision achievable with micro-stepping will be limited if there is any static friction in
the system.
2. It involves the non-sinusoidal character of the torque versus shaft-angle curves on real motors.
Sometimes, this is attributed to the detent torque on permanent magnet and hybrid motors. But, in
fact both detent torque and the shape of the torque versus angle curves are products of poorly
understood aspects of motor geometry. Specifically the shapes of the teeth on the rotor and stator,
these teeth are almost always rectangular.
3. Problems arise because most applications of micro-stepping involve digital control systems. Thus,
the current through each motor winding is quantized, controlled by a digital-to-analog converter
(PWM). Furthermore, if typical PWM current limiting circuitry is used, the current through each
motor winding is not held perfectly constant, but rather, oscillates around the current control
circuit's set point. As a result, the best a typical micro-stepping controller can do is approximate the
desired currents through each motor winding.
In view of these considerations, note that the drive stepper motor running smoothly in micro-stepping
depends on the motor characteristics. The number of the steps in micro-stepping selection is also based
on the stepper motor. We chose 24 micro-stepping / step in this reference design manual as an example.
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
Freescale Semiconductor
13
Stepper Motor Drive Theory
3.3 Stepper Motor Control
Figure 3-1 shows a 2-phase step motor control signal. This signal switches on and off in turn and is driven
by an H-bridge as shown in Figure 3-2.
CCW
CW
A
/A
B
/B
A
Store
trip
Figure 3-1. 2-Phase Step Motor Control Signal
+
A
/A
Supply
-
Phase A
Figure 3-2. H-Bridge
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
14
Freescale Semiconductor
Stepper Motor Control
As shown in Figure 3-3, phase A and B are driven by a square wave to move the rotor. It can be locked
at a desired position when the phase supply (square wave) stops to alter.
Rotate
Gnd
+
Vdd
Phase B
-
A
Phase A
Vdd
Gnd
Figure 3-3. Basic Driving Circuit for Two Phase Step Motor
In order to drive a moving stepper motor, the S12H family offers a simple instruction to control step
movement. The example below, uses motor channel 0 to control the stepper motor moving forward. The
phase supply sequences are as follows:
Phase
A
0
0
1
B
1
0
0
void eat_time(int time)
{
while(time--!=0){}
}
//eat time
void step_move()
//step move
{
MCDC0H &=~0x80;
//channel
MCDC1H |=0x80;
//channel
eat_time(0x2000);
//delay
MCDC0H &=~0x80;
//channel
MCDC1H &=~0x80;
//channel
eat_time(0x2000);
//delay
MCDC0H |=0x80;
//channel
MCDC1H &=~0x80;
//channel
eat_time(0x2000);
//delay
MCDC0H |=0x80;
//channel
MCDC1H |=0x80;
//channel
eat_time(0x2000);
//delay
}
0 (A = 0, /A = 1) Step 0
1 (B = 1, /B = 0)
0 (A = 0, /A = 1) Step 1
1 (B = 0, /B = 1)
0 (A = 1, /A = 0) Step 2
1 (B = 0, /B = 1)
0 (A = 1, /A = 0) Step 3
1 (B = 1, /B = 0)
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
Freescale Semiconductor
15
Stepper Motor Drive Theory
Please refer to the firmware project (1. StepMove) for more detailed information. See Figure 3-4.
Figure 3-4. StepMove Screen
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
16
Freescale Semiconductor
Stepper Motor Micro-Stepping Control
3.4 Stepper Motor Micro-Stepping Control
The utility of micro-stepping is limited by at least three considerations.
1. Motor static friction
2. Non-sinusoidal character of the torque versus shaft-angle, each motor
3. Winding is quantized, controlled by a digital-to-analog converter (PWM)
The most common control algorithm is adopted to use sinusoidal current to drive micro-stepping. One
complete sinusoidal wave is equivalent to four steps in a 2-phase motor.
Phase A is driven by a PWM as sinusoidal to move the rotor. It can also be locked at a desired position
when the phase supply stops to alter. The stepper motor can be held by the supply current from the driver
as static holding torque.
Phase A and B are driven by a sinusoidal wave to move the rotor. It can be locked at a desired position
when the phase supply (sinusoidal wave) stops to alter.
To drive stepper motor moving, the S12H family can use a simple look-up table to implement a sinusoidal
signal to drive micro-stepping movement.
Refer to Figure 3-5 and Figure 3-6.
CW
CCW
A
/A
B
/B
A
S
t
Figure 3-5. Micro-Stepping Sinusoidal Control
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
Freescale Semiconductor
17
Stepper Motor Drive Theory
Store trip
+
Supply
/PWM
PWM
Phase
Phase
PWM
/PWM
A
B
Figure 3-6. Micro-Stepping Sinusoidal Control with PWM
Please refer to the firmware project (2. MicroStepMove) for more detailed information. See Figure 3-7.
Figure 3-7. MicroStepMove Screen
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
18
Freescale Semiconductor
Stepper Stall Detection (SSD)
3.5 Stepper Stall Detection (SSD)
This module provides a built-in circuit to detect the induced voltage on the non-driven coil of a stepper
motor. The back EMF can be measured by an internal ADC module, which can integrate the induced
voltage on the non-driven coil, and store its results to a16-bit accumulator register. The internal 16-bit
modulus down counter can be used to monitor the blanking time and the integration time. The value in
the 16-bit accumulator represents the change in linked flux. It can be compared to a stored threshold to
distinguish whether the motor reaches the home position. Values above the threshold indicate a moving
motor, in which case the pointer can be advanced another full step in the same direction and integration
repeated. Values below the threshold indicate a stalled motor, home position is reached.
See Figure 3-8.
Advanced Motor Pointer
Initialized SSD
Start Blinking
End of Start Blinking
No
Yes
Start Integration
End of Integration
No
Yes
No
Stall Detection
Disabled SSD
Figure 3-8. Stepper Stall Detection Flowchart
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
Freescale Semiconductor
19
Stepper Motor Drive Theory
Please refer to the firmware project (3. StepperStallDetection) for more detailed information. See
Figure 3-9.
Figure 3-9. StepperStallDetection Screen
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
20
Freescale Semiconductor
LCD Driver for LCD Display Panel
3.6 LCD Driver for LCD Display Panel
The S12HZ256 internal LCD driver module has 32 frontplane drivers and 4 backplane drivers. A
maximum of 128 LCD segments are controllable. Each segment is controlled by a corresponding bit in
the LCD RAM, located at address 0x120–0x137.
Four multiplex modes (1/1, 1/2, 1/3, 1/4 duty) and three bias (1/1, 1/2, 1/3) methods are available. The
voltage generator, connected to the VLCD pin, generates voltage levels for the timing and control logic to
produce the frontplane and backplane waveforms. Please refer to InitLCD project.
Please refer to the firmware project (4. InitLCD2) for more detailed information. See Figure 3-10 and
Figure 3-12.
Figure 3-10. InitLCD2 Screen
Figure 3-11. Turn On All LCD Segments
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
Freescale Semiconductor
21
Stepper Motor Drive Theory
3.7 LCD2 Panel Initialization and Checking
In this reference design, the 4*18 segment LCD panel is selected. The LCD characters can be turned
on/off by writing to the internal LCD registers, which are located at address 0x128–0x137. The LCD2.lib
is also available for use. Users need to link to the LCD2.lib in their project.
Please refer to the firmware project (5. LCD2DisplayCheck) for more detailed information. See
Figure 3-12 and Figure 3-13.
Figure 3-12. LCD2DisplayCheck Screen
Figure 3-13. Verify LCD2 Segments
and Their Connections
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
22
Freescale Semiconductor
LCD2 Panel Firmware (API)
3.8 LCD2 Panel Firmware (API)
Users can use the API to display clock and mileage in the LCD2 panel. Examples are shown in
Figure 3-14 and Figure 3-15. Please refer to LCD2DisplayEx project.
Please refer to the firmware project (6. LCD2DisplayEx) for more detailed information.
Figure 3-14. LCD2DisplayEx Screen
Figure 3-15. API Testing for LCD2
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
Freescale Semiconductor
23
Stepper Motor Drive Theory
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
24
Freescale Semiconductor
Chapter 4
Software Integration
4.1 Introduction
The previous chapter explained several modules to drive individual application (stepper running in single
step, micro-stepping control, LCD driver, motor stall detection, etc.). Now, we have to integrate those
modules to implement a Cluster board application. It is a well-known fact that stepper motor vibration is
commonly a drawback during motor running, although it only needs simple driving techniques. Thus,
micro-stepping is a typical solution when a stepper motor is chosen in an application. In addition, we also
need to overcome stepper motor inertia, which plays an important role in driving motor starting smoothly.
4.2 Micro-Stepping Control Using Internal Timer
The gauge pointer is driven by a stepper motor, which can directly reflect how good the Cluster
performance is. Thus, some control parameters may be beneficial when introduce in stepper motor
control, such as acceleration and maximum velocity even in micro-stepping. The acceleration and
maximum velocity parameters can be done by the S12HZ256 internal 16-bit timer module. In this
reference design, the acceleration can be pre-calculated as a lookup table (StepProfileBase[]), which is
stored in the internal Flash. It can also be retrieved from internal Flash to internal RAM for run time
modification in different speed profiles. The maximum speed setting can also prevent the motor from
running beyond the limit.
Speed
v = u + at
Max Speed (v)
Acceleration (a)
Time
Figure 4-1. Speed Profile
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
Freescale Semiconductor
25
Software Integration
Please refer to the firmware project (7. MicroStepRamp) for detail.
Figure 4-2. MicroStepRamp Screen
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
26
Freescale Semiconductor
Motor Running and LCD2 Panel Display Demonstration
4.3 Motor Running and LCD2 Panel Display Demonstration
The demonstration code for Stepper Stall Detection (SSD), micro-stepping moving, and LCD2 panel
display were done for the user reference. Please refer to MotorLCD2Demo project for details. The
software flowchart is shown Figure 4-3.
Start
Wake Up Motor to Move
Invoke SSD (Step SSD)
Stepper Stall?
No
Yes
Move to Home Position
System Initialization
Motor Move
Forward/Backward
Blinking and Display
Internal Clock
with Mileage to LCD2
Figure 4-3. Flowchart of Motor Running
and LCD2 Panel Display
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
Freescale Semiconductor
27
Software Integration
Please refer to the firmware project (8. MotorLCD2Demo) for more detailed information.
Figure 4-4. MotorLCD2Demo Screen
4.4 Cluster System Demonstration
This demonstration code is designed to show the following basic required features of a Cluster system
application:
• Motors move and perform stall detection after power up
• Motors go back to the home position after a detected stall position
• Speedometer movement follows to tachometer movement
• Fuel and temperature meters move forward and backward
• Mileage updates according to the speedometer reading
• Lamp turns on (dimming) when fuel is close to empty (low fuel)
• Internal clock display
• Mileage can be stored to the internal EEPROM
The software flowchart is shown in Figure 4-5.
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
28
Freescale Semiconductor
Cluster System Demonstration
Start
LCD2 Initialization
for SSD
Invoke SSD for 4 Motors
Stepper Stall?
No
Yes
Move to Home Position
System Initialization
Motors Movement Follow
the Demo Sequence
Display Mileage and
Internal Clock to LCD2
No
S1 Pressed?
S2 Pressed?
Yes
Power On
No
S3 Pressed?
Yes
Store Trip Mileage
to EEPROM
Power Off
No
Demo On
Yes
Trip A/B selection
S2 Held Over
1 Second?
No
Demo Off
No
S3 Pressed?
Yes
No
Yes
S1 Pressed?
Selected Trip Clear
Yes
Figure 4-5. ClusterDemo Flowchart
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
Freescale Semiconductor
29
Software Integration
Please refer to the firmware project (9. ClusterDemo) for more detailed information.
S1
S2
S3
S1 — Toggle Switch for Power On / Off
S2 — Mileage Selection for Trip A, Trip B, and ODO
S3 — Toggle Switch for Demo
Figure 4-6. Cluster Demonstration Board
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
30
Freescale Semiconductor
Chapter 5
Hardware Schematics
Detailed schematics for this reference design and provided in this chapter.
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
Freescale Semiconductor
31
Chapter 6
Bill of Materials
Item
Quantity
Reference
Part
1
3
C1, C10, C18
2
23
C2, C4, C6, C7, C8, C15, C17, C19, C20, C21, C22,
C23, C24, C25, C26, C27, C28, C29, C30, C31,
C32, C49, C50
3
3
C3, C9, C16
4
1
C5
5
8
C11, C12, C13, C14, C45, C46, C47, C48
6
2
C34, C33
10P
7
1
C39
100P
8
1
C40
0U003
10UF/25V
0U1
0U001
47UF/25V
10UF
9
1
C41
0U033
10
1
C42
0U047
11
3
C43, C44, C51
0U01
12
1
D1
13
10
D2, D7, D9, D11, D12, D13, D14, D15, D16, D17
14
1
D3
15
8
D20, D21, D22, D23, D24, D25, D26, D27
16
14
JNC1, JNC2, JNC10, JNC11, JNC12, JNC13,
JNC14, JNC15, JNC16, JNC17, JNC18, JNC19,
JNC80, JNC82
JNC
17
20
M1, M2, JNO2, M3, JNO3, M4, JNO4, JNO5, JNO6,
JNO7, JNO8, JNO9, JNO10, JNO11, JNO12,
JNO13, JNO14, JNO15, JNO83, JNO84
JNO
18
4
JP1, JP6, JP8, JP10
19
1
JP2
JP2
20
1
J1
tc18
1N4001
LED3MM
BZX84C16T
LED0603
JP3_0
21
5
J2, J11, J13, J14, J15
CON\1X2PS
22
1
J4
CON\2X4PS
23
2
J20, J5
CON\1X4PS
24
4
J6, J7, J8, J9
CON\2X14PS
25
1
J12
BDM CONNECTOR
26
1
LCD1
LCD DISPLAY (32*4)
27
1
LCD2
LCD DISPLAY (18*4)
28
4
L1, L2, L3, L4
10UH
Continued on the next page
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
Freescale Semiconductor
37
Bill of Materials
Item
Quantity
29
2
P2, P1
Reference
Part
30
18
R1, R28, R30, R62, R63, R64, R65, R66, R67, R68,
R71, R72, R73, R74, R75, R76, R77, R78
330
CON\DB9FR
31
2
R4, R2
510
32
1
R3
120
33
2
R18, R5
10K
34
14
R6, R7, R21, R29, R31, R32, R33, R34, R43, R46,
R47, R48, R60, R61
47K
35
5
R9, R15, R23, R27, R59
1K
36
13
R19, R35, R36, R37, R38, R40, R41, R49, R50,
R51, R52, R54, R55
4K7
37
1
R24
1K2
38
1
R25
100
39
4
R39, R42, R53, R56
1M
40
4
R44, R45, R57, R58
30K
41
5
S1, S2, S3, S4, S5
42
1
U1
MC7805(DPAK)
SW/6X6MM
43
1
U2
MC33388
44
1
U3
PCA82C250
45
1
U4
MC34X64_SM
46
1
U5
MC9S12HZ128/256-112LQFP
47
1
U6
XTALOSC_DIP_8_14
48
1
U7
MC145407
49
1
U8
74AC125
50
1
U9
LM2901
51
1
Y1
8MHZ
Cluster (Dashboard) Using S12HZ256 as a Single-Chip Solution Designer Reference Manual, Rev. 0
38
Freescale Semiconductor
How to Reach Us:
Home Page:
www.freescale.com
E-mail:
support@freescale.com
USA/Europe or Locations Not Listed:
Freescale Semiconductor
Technical Information Center, CH370
1300 N. Alma School Road
Chandler, Arizona 85224
+1-800-521-6274 or +1-480-768-2130
support@freescale.com
Europe, Middle East, and Africa:
Freescale Halbleiter Deutschland GmbH
Technical Information Center
Schatzbogen 7
81829 Muenchen, Germany
+44 1296 380 456 (English)
+46 8 52200080 (English)
+49 89 92103 559 (German)
+33 1 69 35 48 48 (French)
support@freescale.com
Japan:
Freescale Semiconductor Japan Ltd.
Headquarters
ARCO Tower 15F
1-8-1, Shimo-Meguro, Meguro-ku,
Tokyo 153-0064
Japan
0120 191014 or +81 3 5437 9125
support.japan@freescale.com
Asia/Pacific:
Freescale Semiconductor Hong Kong Ltd.
Technical Information Center
2 Dai King Street
Tai Po Industrial Estate
Tai Po, N.T., Hong Kong
+800 2666 8080
support.asia@freescale.com
For Literature Requests Only:
Freescale Semiconductor Literature Distribution Center
P.O. Box 5405
Denver, Colorado 80217
1-800-441-2447 or 303-675-2140
Fax: 303-675-2150
LDCForFreescaleSemiconductor@hibbertgroup.com
Document Number: DRM084
Rev. 0
10/2006
Information in this document is provided solely to enable system and software
implementers to use Freescale Semiconductor 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.
Freescale Semiconductor reserves the right to make changes without further notice to
any products herein. Freescale Semiconductor makes no warranty, representation or
guarantee regarding the suitability of its products for any particular purpose, nor does
Freescale Semiconductor 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 Freescale Semiconductor 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. Freescale Semiconductor does not convey any license
under its patent rights nor the rights of others. Freescale Semiconductor 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 Freescale Semiconductor product
could create a situation where personal injury or death may occur. Should Buyer
purchase or use Freescale Semiconductor products for any such unintended or
unauthorized application, Buyer shall indemnify and hold Freescale Semiconductor 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 Freescale
Semiconductor was negligent regarding the design or manufacture of the part.
Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc.
All other product or service names are the property of their respective owners.
© Freescale Semiconductor, Inc. 2006. All rights reserved.
RoHS-compliant and/or Pb-free versions of Freescale products have the functionality
and electrical characteristics as their non-RoHS-compliant and/or non-Pb-free
counterparts. For further information, see http://www.freescale.com or contact your
Freescale sales representative.
For information on Freescale’s Environmental Products program, go to
http://www.freescale.com/epp.