Programming the Tech Arts 9S12C32 and 9S12DP512 boards
Jonathan Valvano, June 24, 2012
You are free to use this material as long as the copyrights and textbook references remain.

Datasheets click to see all the datasheets
    Tech Arts 9S12C32 board (technical information for the TechArts 9S12C32 board)
    MC9S12C data sheet (9S12C32 I/O ports)
    MC9S12DP512 data sheets (I/O ports)

    CPU12 programmer manual (6812 assembly op codes)
    CPU12 reference guide (short 6812 assembly programming guide)

Metrowerks C Software click to see all the starter files
Simple examples
Not gate (, simple input/output 
LED toggle (, simple program to toggle the PP7 LED
Moore FSM (, simple finite state machine, PLL 
Simple SCI ( 
DP512 version ( busy-wait synchronization serial I/O
LCD (,
DP512 version ( blind cycle 4-bit HD44780 LCD interface, PLL,
Analog to Digital Conversion (
DP512 version ( ADC, TimerWait, LCD, PLL
Pulse Width Modulation (
DP512 version (   uses PLL, PWM
Interrupt examples
Interrupt RTI ( 
DP512 version (  demonstrates real time interrupts
Simple Output Compare ( 
DP512 version ( simple OC interrupts, PLL
Generalized Output Compare (, OC driver, stepper motor output, call back function, PLL 
Simple Capture (, IR remote input, period measurement, input capture interrupt
Interrupting Input Capture (, 2 by 2 matrix scan, two input capture, one output compare, PLL
Interrupting SCI ( 
DP512 version ( interrupting I/O, PLL
Interrupt TOF (
DP512 version ( demonstrates periodic timer overflow interrupts
Fuzzy Logic (, ADC, Fuzzy Logic speed controller, PLL
Pulse Accumulator (
DP512 version (  measures pulse width, PLL
Complex examples
DP512 version ( SCI1 busy-wait synchronization serial I/O
C32 version DFtest ( 
DP512 version ( unsigned digital filter tester uses SCI, PLL
C32 version DFtest (  
DP512 version ( 10-bit signed digital filter tester uses SCI, PLL
LCD graphics (
DP512 version ( uses 64 by 128 pixel LCD graphics driver
Scanned LED graphics board (, uses PLL, SPI, ASCII fonts, double buffer, OC6 interrupts
Lab17 (, 9S12C32 Preemptive Real-time OS with spinlock semaphores uses SCI, PLL

Fixed Scheduler (, 9S12C32 Non-preemptive Real-time OS
Serial Monitor (, on-chip debugger, needs a BDM to download

Board tester for the 9S12C32 and 9S12DP512
Software to test the 9S12C32
Instructions on running the 9S12C32 tester
First checkout the orange platform for the tester, download this program to the 9S12C32, quit the debugger, and run HyperTerminal
Software to test the 9S12DP512  First checkout the silver platform for the tester, place board in H1 socket, apply power, download this program to the 9S12DP512, quit the debugger, and run HyperTerminal, disconnect power, move to H2 socket, apply power and run tester again

Texas Assembly Software for DP512  click to see all the starter files
PP7 LED toggle (  PP7 flashes on and off
Digital output (, Simple squarewave output, using TCNT timer
Local variables (, How to allocate, access, deallocate local variables
Simple SCI0 (  Busy-wait synchronization serial I/O
Simple SCI1 (  Busy-wait synchronization serial I/O
Simple program ( This is a simple 9S12DP512 assembly example with one output, showing the stack and a subroutine. Can be simulated or run on the real 9S12DP512

Course Materials
EE345L 2010 Laboratory Manual (based solely on the 9S12DP512)

Books on the 9S12 Cengage Learning Publisher's Website
Embedded Microcomputer Systems: Real Time Interfacing, 2nd edition, Jonathan W. Valvano, Thomson Publishers, 2006, ISBN 0-534-36642-2, outline, lab manual, list of errors

Introduction to Embedded Systems: Interfacing to the Freescale 9S12, Cengage Publishing 2009, ISBN-10: 049541137X | ISBN-13: 9780495411376, by J. W. Valvano 

Introduction to Embedded Microcomputer Systems: Motorola 6811 and 6812 Simulation, 2002, Jonathan W. Valvano, Thomson Publishers, ISBN 0-534-39177-x, outline

Software for TechArts Adapt812, MC68HC812A4
Simple SCI, busy-wait synchronization I/O, Starter file for Lab2
Debugging example, RTI interrupts, Starter file for Lab3
Interrupt TOF, demonstrates timer overflow interrupts (new 2/8/04)
LCD, demonstrates 8-bit HD44780 LCD interface, Starter file for Lab 4
Interrupt RTI, demonstrates real time interrupts
Moore FSM, simple finite state machine, Starter file for Lab 5
Simple Output Compare, demonstrates OC interrupts, Starter file for Lab 5
Generalized Output Compare, OC driver, call back function, Starter file for Lab 5
ADC, analog to digital converter, LCD, Starter file for Lab 7
Interrupting Input Capture, 2 by 2 matrix scan, Starter file for Lab 8
Interrupting SCI, interrupting I/O, Starter file for Lab10
Fuzzy Logic, ADC, Fuzzy Logic speed controller

Old Labs based on the MC68HC812A4
  How to program the TechArts Adapt812 
  Lab 1c. Memory PCB layout (Adapt812 only)
       Lab1prep.pcb Lab1prep.sch Lab1prep.pcb(old)
  Lab 2e. SCI fixed point, driver
  Lab 3c. Debugging, dump profile
  Lab 4e. Alarm clock (2 weeks)
  Lab 5d. Stepper motor finite state machine 
  Lab 6e. SPI  DAC tone generator
  Lab 7d. Position measurement
  Lab 8d.  Calculator (2 weeks)
  Lab 9a.  Memory diagnosis (Adapt812 only)
  Lab 10c. Serial peer-peer network chat room (2 weeks)  group of 6

Go to Home Page

Send comments to: Jonathan W. Valvano .