Motorola MCU DT128 User Manual Page 5

  • Download
  • Add to my manuals
  • Print
  • Page
    / 7
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 4
5
At this point, you should refer to the DBug12 Reference Guide, included on the accompa-
nying CD-ROM, to continue exploring DBug12.
The Demo Program
We’ve included our standard demo program on the CD-ROM to give you a starting point.
This program was written in assembler, and the sourcecode is included so you’re free to hack it all
you want! There are two versions that can be used with DBug12: one is meant to be loaded into
RAM and launched from the monitor prompt (ie. EVB Mode), and the other resides in Flash, and is
loaded in Bootload Mode. Both versions use pseudo-vectors. (See DBug12 Reference Guide if
you’re not familiar with these modes or with the concept of pseudo-vectors).
A third, standalone, version of the demo program has “true vectors”. To load this demo
program into a blank target chip, you’ll need to use a BDM pod that supports the 9S12DP256. Some
possibilities are: a second Adapt9S12DP256 module jumpered for Pod Mode, our MicroBDM12DX,
or our MicroBDM12SX product. By the way, the s19 file for this version of the demo has been run
through the SrecCvrt utility supplied with DBug12. This utility reformats the s19 file generated by the
assembler so that all s1 records have an even number of bytes, and start on an even address, as
these are the requirements for programming the Flash memory. There’s more on this in the section
called “Migrating from the HC912” a little further on in this manual.
New to Motorola MCUs?
If you’ve come from an 8051, PIC, or other background (or have never used microcontrollers
before), you should get up to speed on Motorola MCUs by reading Understanding Small Micro-
controllers, found on the CD-ROM. Written by Motorola’s Jim Sibigtroth, principle design engineer
of the HC12 family, this book uses an earlier MCU (68HC05) to introduce you to the basic concepts
and design philosophy.
Migrating from 68HC11
If you are already experienced with the 68HC11 family of microcontrollers, writing programs
for the HCS12 family will not present a big challenge. In fact, you can use your existing 68HC11
assembly code and re-assemble it to run on the CPU12 core, but there are a few things to keep in
mind.
Assembler syntax. You may need to edit your source file to conform to the syntax and
directives requirements of the HC12 assembler you’ll be using. There are several assemblers
available (eg. AS12, MiniIDE, IASM12, MCUez), and each has its own syntax to be aware of.
Register Block. Instead of $1000, the register block default location is $0000, and there are
well over a hundred registers! You’ll need to locate the relevant registers for the subsystems you
plan to use, and make sure they are properly configured.
RAM location. The RAM starts at $1000 and goes to $3FFF. This means you would initialize
the Stack Pointer to $4000 (on the HC12, the stack pointer points to the address following the top
of the stack).
High-speed Bus. The default bus speed is half the crystal frequency of 16 MHz, so it is 8
MHz. If you enable the PLL, it will be even higher (up to 24 MHz). This will mean changing some
initialization values for control registers and revising delay constants if you are using any software
timing loops.
I/O Ports. The digital I/O ports on the HCS12 are more flexible than ever. Besides selecting
the direction of each port pin via a Data Direction Register, there are registers controlling output
drive level (standard and reduced), internal pullup and pulldown resistors, and output logic polarity
(ie. true or inverted logic).
COP Watchdog. On most flavours of HC11, this was enable via a bit in the non-volatile
CONFIG register. On the HC12, it is dynamic, and automatically enabled following reset. Therefore
you have to choose whether you’re going to service it, or disable it.
Page view 4
1 2 3 4 5 6 7

Comments to this Manuals

No comments