SofTec Microsystems SK-S12 Series User manual

User’s Manual
Starter Kits for
Freescale HCS12(X) Family
SK-S12(X) Series
ZK-S12(X) Series


SK-S12(X) Series
ZK-S12(X) Series
Starter Kits for
Freescale HCS12(X) Family
User’s Manual
Revision 1.0
Copyright © 2005 SofTec Microsystems®
DC00891

We want your feedback!
SofTec Microsystems is always on the look-out for new ways to improve its
Products and Services. For this reason feedback, comments, suggestions or
criticisms, however small, are always welcome.
SofTec Microsystems
E-mail (general information): info@softecmicro.com
E-mail (marketing department): marketing@softecmicro.com
E-mail (technical support): support@softecmicro.com
Web: http://www.softecmicro.com
Important
SofTec Microsystems reserves the right to make improvements to the SK-S12(X) and ZK-S12(X) Series Starter Kits, their
documentation and software routines, without notice. Information in this manual is intended to be accurate and reliable.
However, SofTec Microsystems assumes no responsibility for its use; nor for any infringements of rights of third parties which
may result from its use.
SOFTEC MICROSYSTEMS WILL NOT BE LIABLE FOR DAMAGES RESULTING FROM LOSS OF DATA, PROFITS, USE OF
PRODUCTS, OR INCIDENTAL OR CONSEQUENTIAL DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
Trademarks
Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc.
Metrowerks and CodeWarrior are trademarks or registered trademarks of Metrowerks Corp.
Metrowerks is a wholly-owned subsidiary of Freescale Semiconductor.
Microsoft and Windows are trademarks or registered trademarks of Microsoft Corporation.
PC is a registered trademark of International Business Machines Corporation.
Other products and company names listed are trademarks or trade names of their respective companies.
Written by Loris Pacquola and Pietro Poletto. Edited by Paolo Xausa.

SK/ZK Series User's Manual
Contents
0Before Starting 5
0.1 Important Notice to Users 5
0.2 Required Skills 5
1Overview 7
1.1 Main Features 7
1.2 Background Debug Module (BDM) 8
1.3 CodeWarrior Development Studio Special Edition 9
1.4 Recommended Reading 9
1.5 Software Upgrades 10
1.6 Getting Technical Support 10
2Hardware Features 11
2.1 Standard Features 11
2.1.1 MCU Section 11
2.1.2 Power Supply Section 12
2.1.3 USB to BDM Interface 12
2.1.4 BDM Connector 12
2.1.5 Reset Section 12
2.1.6 Inputs Section 13
2.1.7 Outputs Section 13
2.1.8 RS-232 Section 13
2.1.9 Prototype Area 13
3Getting Started 15
3.1 Package Contents 15
3.2 Operating Mode 15
3.2.1 Standalone Mode 15
3.2.2 Host Mode 16
3.3 Host System Requirements 17

Contents
3.4 Installing the Software 17
3.4.1 Installing CodeWarrior Development Studio 18
3.4.2 Installing SofTec Microsystems Additional Components 18
3.5 Installing the Hardware 18
3.6 Application Tutorial 21
4Debugging Features 27
4.1 Creating Your Own Application 27
4.1.1 Using the Project Wizard to Create Your Application
Skeleton 27
4.1.2 Starting your First Debugging Session 27
4.2 GDI Target Interface Notes 28
4.3 Breakpoints and Trace 30
4.4 Notes and Tips 31
4.4.1 Reading Peripheral Status 31
4.4.2 Breakpoints and the “BGND” Instruction 31
4.4.3 “STOP” Assembly Instruction 31
4.4.4 “WAIT” Assembly Instruction 32
4.4.5 Microcontroller Peripheral Running when Execution is
Stopped 32
4.4.6 Real-Time Memory Update 32
4.4.7 PLL Usage 32
4.4.8 Hardware Breakpoints and Software Breakpoints 33
4.4.9 Advanced Debugging Features 33
4.5 DataBlaze Programming Utility 34
4.5.1 DataBlaze Notes 35
5Troubleshooting 37
5.1 Common Problems and Solutions 37
5.1.1 USB Driver Problems 37
5.1.2 Communication Can’t Be Established with the Board 38
5.1.3 Communication Errors when Using a BDM Tool 39
5.2 Getting Technical Support 39

0
SK/ZK Series User's Manual
Page 5
0 Before Starting
0.1 Important Notice to Users
While every effort has been made to ensure the accuracy of all information in
this document, SofTec Microsystems assumes no liability to any party for
any loss or damage caused by errors or omissions or by statements of any
kind in this document, its updates, supplements, or special editions, whether
such errors are omissions or statements resulting from negligence,
accidents, or any other cause.
0.2 Required Skills
In order to beneficially use the Starter Kit, you should be acquainted with
certain skills, ranging from hardware to software design. In particular, you
should possess knowledge of the following:
Microcontroller systems;
HCS12(X) architecture knowledge;
Programming knowledge (Assembly and C).


1
SK/ZK Series User's Manual
Page 7
1 Overview
1.1 Main Features
The SK-S12(X) and ZK-S12(X) Series Starter Kits are full-featured, ready-to-
use evaluation boards for the Freescale HCS12(X) family. The Starter Kits
have been designed for the evaluation and the debugging of user
applications.
The Starter Kits take advantage of CodeWarrior Development Studio (which
groups an Editor, Assembler, C Compiler and Debugger) and the Freescale
BDM interface, which allows the download and debug of the user application
into the microcontroller’s FLASH memory.
Together with CodeWarrior, the Starter Kits provide you with everything you
need to write, compile, download, in-circuit emulate and debug user code.
Full-speed program execution allows you to perform hardware and software
testing in real time. The Starter Kits are connected to the host PC through a
USB interface. A prototyping area allows you to wire your own small
application.
i
Note: on ZK Series, a ZIF (Zero Insertion Force) socket is
provided which allows easy microcontroller insertion/extraction.
The Starter Kits offer you the following benefits:
Real-time code execution;
In-circuit debugging;
In-system programming and debugging through a BDM-compatible
interface;
Demo area with push-buttons, potentiometer, DIP-switches and user
LEDs;
Where available: RS-232 ports, CAN transceivers, LIN transceivers and
other target-specific peripherals;

1
Overview
Page 8
Prototyping area;
CodeWarrior for HC(S)12 Development Studio, Special Edition, with
editor, assembler, C compiler and debugger.
i
Note: this user’s manual explains methods and procedures
common to all of the SK-S12(X) and ZK-S12(X) Series Starter Kits.
For a detailed list of the hardware features of your specific Starter
Kit, please refer to the Starter Kit’s specific user’s manual,
available in PDF format on the SofTec Microsystems’ “System
Software” CD-ROM.
1.2 Background Debug Module (BDM)
All MCUs in the HCS12(X) family contain a single-wire background debug
interface which supports in-circuit programming of on-chip non-volatile
memory and sophisticated non-intrusive debug capabilities. This system
does not interfere with normal application resources. It does not use any
user memory or locations in the memory map and does not share any on-
chip peripherals. The background debug module (BDM) uses a single-wire
communication interface to allow non-intrusive access to target system
memory and registers.
The Starter Kits feature a USB to BDM interface which allows the host PC to
communicate with the microcontroller through a standard USB cable.
Contrariwise to traditional in-circuit emulation (where the target application is
executed and emulated inside the emulator), the Starter Kits use the very
same target microcontroller to carry on in-circuit execution. This means that
all microcontroller’s peripherals (timers, A/D converters, I/O pins, etc.) are
not reconstructed or simulated by an external device, but are the very same
target microcontroller’s peripherals. Moreover, the Starter Kits’ debugging
approach ensures that the target microcontroller’s electrical characteristics
(pull-ups, low-voltage operations, I/O thresholds, etc.) are 100% guaranteed.

1
SK/ZK Series User's Manual
Page 9
1.3 CodeWarrior Development Studio Special
Edition
The Starter Kits come with CodeWarrior Development Studio, Special
Edition.
CodeWarrior Development Studio is a powerful and easy-to-use tool suite
designed to increase your software development productivity. It provides
unrivalled features such as Processor Expert application design tool, full chip
simulation, data visualization and project manager with templates to help you
concentrate on the added value of your application.
The comprehensive, highly visual CodeWarrior Development Studio enables
you to build and deploy HCS12(X) systems quickly and easily. This tool suite
provides the capabilities required by every engineer in the development
cycle, from board bring-up to firmware development to final application
development.
Without a license key, the product will run in a 1 KB code-size limited
demonstration mode.
To break the 1 KB limit, you have two options:
1. Contact Metrowerks to request an unlimited period, free license key to
increase the code size limit to 32 KB;
2. Contact Metrowerks to request a 30-day limited, free license key to run
the compiler without limitations.
This documentation covers the basic setup and operation of CodeWarrior
Development Studio, but does not cover all of its functions. For further
information, please refer to the CodeWarrior online help and online
documentation provided.
1.4 Recommended Reading
This documentation describes how to use the Starter Kits and how to set up
basic debugging sessions with CodeWarrior. Additional information can be
found in the following documents:
Microcontroller Datasheets;

1
Overview
Page 10
Starter Kit’s Specific User’s Manual;
Starter Kit’s Specific Schematic.
Additionally, we suggest to read Freescale Application Notes and
Engineering Bulletins available on the Freescale website
(www.freescale.com) for updated documentation about the microcontroller
that you are using.
1.5 Software Upgrades
The latest version of the Starter Kits’ system software is always available
free of charge from our website: http://www.softecmicro.com.
When installing the Starter Kits’ system software you have the option to
electronically register the product. If you register the product, you will be
automatically notified by e-mail every time a new version of the system
software is available.
1.6 Getting Technical Support
Technical assistance is provided to all customers. For technical assistance,
documentation and information about products and services, please refer to
your local SofTec Microsystems partner.
SofTec Microsystems offers its customers a technical support service at
support@softecmicro.com. Before getting in contact with us, we advise you
to check that you are working with the latest version of the Starter Kits’
system software (upgrades are available free of charge at
http://www.softecmicro.com).

2
SK/ZK Series User's Manual
Page 11
2 Hardware Features
2.1 Standard Features
Every SK-S12(X) and ZK-S12(X) Series Starter Kit features a common set of
functions, listed below.
MCU section
Power supply section
USB to BDM interface
BDM connector
Reset section
Inputs section
Outputs section
RS-232 section
Prototype area
Additionally, each Starter Kit may feature special additional functions.
i
Note: for a detailed list of the hardware features of your specific
Starter Kit, please refer to the Starter Kit’s specific user’s manual,
available in PDF format in the SofTec Microsystems’ “System
Software” CD-ROM.
The standard functions are explained in the following sections.
2.1.1 MCU Section
This section contains the following components:

2
Hardware Features
Page 12
The microcontroller (installed on a ZIF socket on ZK-S12(X) series);
Header connectors to access the I/O pins of the microcontroller;
An oscillator area to configure the clock source of the microcontroller;
MCU jumpers for setting the microcontroller’s operating mode, the
microcontroller’s internal voltage regulator and the microcontroller’s
internal A/D converter voltage reference.
2.1.2 Power Supply Section
The Power Supply section takes a 12 V DC voltage and, thanks to the built-
in power supply, provides a regulated voltage for the rest of the board.
2.1.3 USB to BDM Interface
The USB to BDM interface is a circuitry that electrically and logically
translates BDM-like commands sent by the host PC through the USB cable
to the BDM interface of the microcontroller.
i
Note: to bypass the built-in USB to BDM interface when using an
external in-circuit debugger (via the BDM connector), please
remove the “RESET ENA” and “BKGD ENA” jumpers.
2.1.4 BDM Connector
Even though the SK-S12(X) and ZK-S12(X) Series Starter Kits feature a
built-in USB to BDM interface, a separate, standard BDM connector is
present which allows an external in-circuit debugger to be used.
2.1.5 Reset Section
This section groups a reset push-button and a reset circuitry to generate a
suitable reset signal for the microcontroller and for the peripherals connected
to it.

2
SK/ZK Series User's Manual
Page 13
2.1.6 Inputs Section
All of the SK-S12(X) and ZK-S12(X) Series Starter Kits feature an input area
with various input controls like a potentiometer, DIP-switches and push-
buttons. Some Starter Kits may feature additional functions.
2.1.7 Outputs Section
This section features high-efficiency (low-current) LEDs, connected to the
microcontroller through jumpers. Some Starter Kits may feature additional
functions.
2.1.8 RS-232 Section
Depending on the specific Starter Kit, one or more RS-232 channels are
available. Each RS-232 channel is TIA/EIA-232-F compliant (up to 250
Kbit/s) and can be configured as DTE (Data Transmission Equipment) or
DCE (Data Communication Equipment) via the relative jumper.
2.1.9 Prototype Area
The prototype section features both a standard, thru-hole area (for mounting
traditional components) and a SMD area (for soldering SMD components).


3
SK/ZK Series User's Manual
Page 15
3 Getting Started
3.1 Package Contents
The Starter Kit includes the following items:
A full-featured evaluation board;
An AC adapter;
A USB cable;
The SofTec Microsystems “System Software” CD-ROM;
The CodeWarrior Development Studio Special Edition CD-ROM;
A QuickStart Tutorial poster;
A registration card;
This user’s manual.
3.2 Operating Mode
The Starter Kit can work in two ways: Standalone mode and Host mode.
3.2.1 Standalone Mode
In Standalone mode, no PC connection is required. The microcontroller is
factory programmed with a sample application which reads the
potentiometer value and displays the results on the output area.
To work in standalone mode, the “BKGD ENA” and “RESET ENA” jumpers
in “USB TO BDM INTERFACE” section must be removed and you must
verify that no BDM-based in-circuit debugger/programmer is connected to
the BDM connector.
To run the built-in example:

3
Getting Started
Page 16
1. Verify that all jumpers are in their default position. See the “Summary of
Jumper and Connector Settings” chapter on the Starter Kit’s specific
user’s manual.
2. Power up the Starter Kit. The power connector accepts a 12 V DC wall
plug-in power supply with a 2.1 mm pin and sleeve plug with positive in
the center and sleeve as ground. The green “POWER” LED on the
board should turn on.
3. By rotating the potentiometer, you affect the results of the A/D
conversion, and the value of each conversion is displayed on the
“OUTPUTS” section.
3.2.2 Host Mode
In Host mode the program execution is controlled by the host PC. You can
use the PC to debug the application by, for example, executing the program
step by step and watching how the microcontroller registers vary, using
CodeWarrior Development Studio provided.
In Host mode the Starter Kit can be controlled via the built-in USB to BDM
interface or in conjunction with a BDM-based emulator/programmer.
i
Note: to bypass the built-in USB to BDM interface when using an
external in-circuit debugger (via the BDM connector), please
remove the “RESET ENA” and “BKGD ENA” jumpers.
When debugging the microcontroller (either using an external in-circuit
debugger via the BDM connector or using the built-in USB connector), you
must remove the “MODA=1” and “MODB=1” jumpers.
This manual explains how to debug the application using the built-in USB to
BDM interface. Please refer to your development tool’s user’s manual if you
need to control the Starter Kit via the BDM connector.

3
SK/ZK Series User's Manual
Page 17
3.3 Host System Requirements
The Starter Kit is controlled by CodeWarrior Development Studio. The
following hardware and software are required to run the CodeWarrior user
interface together with the Starter Kit:
1. A 200 MHz (or higher) PC compatible system running Windows 98,
Windows 2000 or Windows XP;
2. 128 MB of available system RAM plus 500 MB of available hard disk
space;
3. A USB port;
4. CD-ROM drive for installation.
3.4 Installing the Software
i
Note: before connecting the Starter Kit to the PC, it is
recommended that you install all of the required software first (see
below), so that the appropriate USB driver will be automatically
found by Windows when you connect the Starter Kit.
The Starter Kit requires that both CodeWarrior Development Studio Special
Edition and SofTec Microsystems Additional Components be installed in the
host PC.
i
Note: CodeWarrior Development Studio for HC(S)12 must be
installed first.

3
Getting Started
Page 18
3.4.1 Installing CodeWarrior Development Studio
To install the CodeWarrior Development Studio Special Edition, insert the
CodeWarrior CD-ROM into your computer’s CD-ROM drive. A startup
window will automatically appear. Follow the on-screen instructions.
3.4.2 Installing SofTec Microsystems Additional Components
The SofTec Microsystems Additional Components install all of the other
required components to your hard drive. These components include:
The Starter Kit’s USB driver;
The software plug-in for CodeWarrior;
DataBlaze programming utility;
Examples;
Starter Kit’s specific user’s manual;
Starter Kit’s specific schematic;
Additional documentation.
To install the SofTec Microsystems Additional Components, insert the
SofTec Microsystems “System Software” CD-ROM into your computer’s
CD-ROM drive. A startup window will automatically appear. Choose “Install
Instrument Software” from the main menu. A list of available software will
appear. Click on the “Additional Components” option. Follow the on-
screen instructions.
i
Note: to install the Additional Components on Windows 2000 or
Windows XP, you must log in as Administrator.
3.5 Installing the Hardware
The Starter Kit is connected through a USB port to a host PC. Connection
steps are listed below in the recommended flow order:
This manual suits for next models
1
Table of contents
Other SofTec Microsystems Microcontroller manuals

SofTec Microsystems
SofTec Microsystems ZK-S12-B User manual

SofTec Microsystems
SofTec Microsystems ST7 Series User manual

SofTec Microsystems
SofTec Microsystems PK-HCS12E128 User manual

SofTec Microsystems
SofTec Microsystems DEMO9RS08KA2 User manual

SofTec Microsystems
SofTec Microsystems ZK-HC08AX-A User manual
Popular Microcontroller manuals by other brands

Sierra Wireless
Sierra Wireless AirPrime XM0110 user guide

Intel
Intel Stratix 10 GX user guide

GigaDevice Semiconductor
GigaDevice Semiconductor GD32C10 Series user manual

Congatec
Congatec conga-SKIT quick start guide

Cypress
Cypress PSoC 4200DS Prototyping Kit quick start guide

ST
ST STEVAL-MKBOXPRO user manual