Encoder Front Page
SRS Home | Front Page | Monthly Issue | Index
Search WWW Search seattlerobotics.org

The 68HC912B32: An Overview

Kevin Ross

If you have been reading the Encoder for any length of time, you have more than likely seen articles regarding the 68HC12 series of Microcontrollers. Most of these articles have focused on one varation of the 68HC12, which is the 68HC812A4. This article is going to discuss the latest variant of the HC12, which is the 68HC912B32 (aka the B32)

As with all new chips, the B32 is going through a final test phase. Motorola has just released the XC68HC912B32CFU8, and it appears that many distributors are supposed to get stock of this chip in mid May. The 'XC' means it is in its final experimental stage. The next step is the MC series, which means Motorola certifies that the chip is good. We have all been using the XC version of the 68HC812A4 for a while with very favorable results. The B32 looks just as robust.

The B32 variant, as you will see in my discussion of the part, is going to be a great robot controller. Lets look at the details.


Here are some of the highlights of the feature set:

Basically, most of the cool features of the A4 variant of the chip are on this version with the addition of the PWM module. The package is physically smaller (80 pin QFP package), so it has fewer I/O pins. Rest assured, however, there are still plenty to go around! In total, there are 63 I/O pins. As with the A4, you can program almost all of them as digitial I/O, or as their special functions pins.

The chip can operate several different bus models. First, it runs great in a single chip configuration. With 32k of EEPROM for program space, most applications of the chip won't require an external bus. For those applications that need more memory, the external bus can be enabled. Unlike the A4, the B32 has a multiplexed bus. That means the address and data lines are shared. The width of the bus can be selected as either 16 bits or 8 bits wide. This allows you the flexibility to connect an 8 bit memory device.

Unique Features

Most of the internals of the chip are very similar to the A4 and the 68HC11 series chips. Motorola did add a few features to this chip that have unique origins.

Like the A4, the B32 has a Background Debug Mode pin. It uses the same BDM system as the A4, which allows you to perform a whole set of debugging operations. Because the B32 has 32K of Flash EEPROM, the designers realized that the part would need additional debugger support. Most systems, such as the A4, allow a debugger to read/write specific bytes of memory. This allows a debugger to insert special instructions to cause a program to break into an interupt routine when they are hit. On a system that has normal EEPROM, you can write/erase single bytes at a time. On a system that has Flash EEPROM, this can be a problem. The Flash EEPROM can only be erased in bulk. The only way to set then reset a breakpoint is to erase and reprogram the entire EEPROM. Not very practical.

So, the designers of the chip added a couple of features.  In particular, they added two breakpoint registers. This enables the user to select two addresses, or one address and one data value for the CPU to watch for. If an address or data item matches, then a breakpoint causes the chip to either execute a SWI (SoftWare Interupt) or to enter BDM (background debug mode). This is really cool if you are writing a debugger. I am working on putting breakpoint support into my BDM12 debugger program.

Another great new feature is the Pulse Width Modulation module. I have written an entire article on this subject, but suffice it to say that it is a great feature. Check out 68hc12pwm.html to see the details on the PWM system.

The BDLC interface is an interesting looking new feature that I am still trying to figure out. It implements the SAE Standard J1850 Class B Data Communication Network Interface, what ever that is! I know that the B32 was designed with automotive applications in mind, and my understanding is the BDLC (byte data link communications) interface is used to communicate between automotive modules. I would be very interested in hearing from you if you know about this interface specification and would be willing to write an Encoder article explaining it!

Development Support

Development support for the B32 is already in place. Since it supports the CPU12 core, and the same BDM module as the A4, you will find that Karl Lunts SBASIC compiler and as12 assembler work just fine on the B32. There are a couple of sources for development boards as well. Motorola sells a 68HC912B32EVB for around $99.00. I am also offering a development board for the B32 which is a 2"x4" board. By default, it can bring the B32 up in single chip mode. It also brings the pins out to standard .1" spacing, and also has a prototyping area. You can check it out at http://www.nwlink.com/~kevinro/b32brd.htm


The B32 has a great mix of powerful on board features, small size, and I/O capabilities that make it a real natural for most embedded applications. I expect we will be seeing a lot more of this chip in the future.

List Of Tools and Documentation

Here are links and instructions for getting 68HC12 resources


as12 assembler is available from Karl Lunt, and is the freeware assembler for the HC12 family.

SBasic is Karl Lunts version of BASIC for the 68HC12. This is a good high level language.

Robotic and Microcontrollers Products is my page that allows you to order the SRS 68HC812A4 Development board, as well as my BDM12 interface board, and the new 68HC912B32 development board.

Imagecraft has a great C compiler for the 68HC12. The compiler runs around $150, but is a great bargin if you would like to write software in C for the HC12.

Documentation (online versions)

You can get online versions of the 68HC12 documentation from Motorolas website. Here are the files to grab. You can also get printed versions as described below.

CPU12RM-AD Index is an index to a series of .PDF files that create the Motorola CPU12 Reference Manual. This describes the instruction set and programming model for the chip. It is definitely a must have. There is also an Online Version at CPU12RM-AD or http://www.mcu.motsps.com/lit/manuals/cpu12/outline1.html

a4.pdf is the .PDF file of the 68HC812A4 Technical Summary that contains information specific to the 68HC812A4 version of the chip. This is the one with 4k of EEPROM, 1k RAM, and tons of I/O. This explains all of the systems on the chip, where the registers are, etc. You should definitely have one of these if you are using the 68HC812A4.

(250K bytes)
is a PDF file with the electrical characteristics of the 68HC812A4. Timing diagrams, electrical capacities and absolutes, accuracies, etc.

b32ts.pdf is the .PDF file of the 68HC912B32 Technical Summary that contains information specific to the 68HC912B32 version of the chip. This is the one with 32k of Flash, 768 bytes EEPROM, 1k RAM, and still lots of I/O. This explains all of the systems on the chip, where the registers are, etc. You should definitely have one of these if you are using the 68HC912B32.

(272K bytes)
is a PDF file with the electrical characteristics of the 68HC912B32. Timing diagrams, electrical capacities and absolutes, accuracies, etc.

Printed Versions

Motorola will also allow you to order printed documentation online at http://design-net.com/home2/lit_ord.html where you will find a form to fill out your name and address, then a spot on the bottom for document numbers. The following are the documents that you might be interested in

CPU12RM/AD The CPU12 Reference Manual (Must Have)
MC68HC812A4EC/D 68HC812A4 Electrical Characteristics
MC68HC812A4PP/D 68HC812A4 Product Preview (Not worth the effort!)
MC68HC812A4TS/D 68HC812A4 Technical Summary (Must Have)
MC68HC912B32ECD 68HC912B32 Electrical Characteristics
MC68HC912B32PPD 68HC912B32 Product Preview (Not worth the effort!)
MC68HC912B32TSD 68HC912B32 Technical Summary (Must Have)