EDN Access


September 24, 1998


EDN's 25th Annual Microprocessor/Microcontroller Directory

16-BIT

Motorola 68HC12

[Download PDF version]

View block
diagram

Although the 68HC12 is a true 16-bit architecture, it has the same register set and interrupt stacking order as the 68HC11. In addition, the 208 instructions of the HC12 are a superset of the HC11's instruction set, making the HC12 upwardly compatible with the HC11. To run HC11 code on the HC12, you need only to reassemble your code and account for changes to timing loops resulting from a clock-speed increase to 8 MHz and shorter instruction-cycle times.

As with the 68HC16 and 68300 families, Motorola based the HC12 on a modular design methodology. Motorola designers use the Lite Module Bus, which is similar to the InterModule Bus, to connect the core to peripheral modules. The HC12's core contains a module that includes a multiplexed or nonmultiplexed external bus, runtime monitors, and Motorola's background-debugging mode (BDM). The runtime monitors include a watchdog timer, a clock monitor that uses a resistor/capacitor time constant to monitor the speed of the crystal, and a periodic interrupt timer. The BDM, a single-wire implementation (versus four wires on the HC16 and 68300), offers code patching and two hardware breakpoints. (However, the hardware breakpoints are not available on all HC12 derivatives.) BDM also performs nonintrusive reads and writes to memory while the CPU runs at full speed, and the BDM accesses on-chip memory during CPU dead cycles. You can use the BDM to program the on-chip flash or EEPROM or for programming the address comparators to set hardware breakpoints. BDM lets debuggers do source-level debugging and monitor variables without intruding on users' software.

Power management: The HC12 uses a PLL to hit 8 MHz and to help with the CPU's power management. Current implementations of the core operate from voltages of 2.7 to 5.5V with a path to 1.8V. The HC12 has wait and stop power-saving modes and many other power-saving features in the core. Each module has controls to save power when idle, low noise drivers are available on each I/O pin, and external-bus actions halt when the CPU is accessing internal events.

Special instructions: The HC12 supports several indexed addressing modes, the most important of which is stack-pointer referencing to handle stack-based parameters. Autoincrement and autodecrement indexed addressing is useful for loop counters in C-language programming. You can use the HC12's load-effective-address instruction in C programs to allocate and deallocate stack space. For case statements, indexed indirect-addressing modes allow you to put a computed GOTO in line.

A new division instruction on the HC12 allows you to divide a 16-bit number by a 16-bit number instead of using a sign-extended, 32-bit number. Furthermore, the HC12 performs this divide in 12 cycles compared with 41 cycles for the HC11. A 16X16-bit multiply executes in 375 nsec. Minimum/maximum functions compare two values and store the result in the accumulator or the memory. For example, for a minimum function, the µC stores the smaller of the two values. Similar to the 68300 family, the HC12 performs table-look-up and interpolate functions for operations such as compressing table data. The HC12 also includes four instructions to assist with fuzzy logic.

Development tools: A relatively large number of vendors support the relatively new 68HC12. Archimedes Software (www.archimedesinc.com), Cosmic Software (www.cosmic-software.com), and IAR Systems (www.iar.com) offer compiler support. CMX Co (www.cmx.com), Embedded Systems Products (www.esphou.com), and Motorola provide RTOSs. Eight vendors offer debuggers, eight offer emulators, and 15 supply programmers. Axiom (www.axman.com) and Motorola supply evaluation boards.

For example, Motorola's $99 68HC912B32 evaluation board operates in BDM and acts as a target and debugger. Inform's (www.fuzzytech.com) Fuzzytech HC11/HC12 version generates the fuzzy-logic system as assembly code for the target µC. It also allows you to perform in-circuit debugging using BDM, but, unlike with in-circuit emulators, you need not halt the running system to modify the fuzzy-logic control strategy.

Second sources: There are no second sources for the 68HC12.


For details on devices in this family,
search EDN's Microprocessor Database:

[search]


Back to Microprocessor/Microcontroller Directory Main Page


| EDN Access | Feedback | Table of Contents |


Copyright © 1998 EDN Magazine, EDN Access. EDN is a registered trademark of Reed Properties Inc, used under license. EDN is published by Cahners Business Information, a unit of Reed Elsevier Inc.