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 (NotGate_9S12.zip), simple input/output 
LED toggle (LEDtoggle_DP512.zip), simple program to toggle the PP7 LED
Moore FSM (Moore_9S12.zip), simple finite state machine, PLL 
Simple SCI (SCI_9S12.zip) 
DP512 version (SCI0_DP512.zip) busy-wait synchronization serial I/O
LCD (LCD_9S12.zip),
DP512 version (LCD_DP512.zip) blind cycle 4-bit HD44780 LCD interface, PLL,
Analog to Digital Conversion (ADC_9S12.zip)
DP512 version (ADC_DP512.zip) ADC, TimerWait, LCD, PLL
Pulse Width Modulation (PWM_9S12.zip)
DP512 version (PWM_DP512.zip)   uses PLL, PWM
Interrupt examples
Interrupt RTI (RTI_9S12.zip) 
DP512 version (RTI_DP512.zip)  demonstrates real time interrupts
Simple Output Compare (OC3_9S12.zip) 
DP512 version (OC_DP512.zip) simple OC interrupts, PLL
Generalized Output Compare (OC_9S12.zip), OC driver, stepper motor output, call back function, PLL 
Simple Capture (IR_9S12.zip), IR remote input, period measurement, input capture interrupt
Interrupting Input Capture (IC_9S12.zip), 2 by 2 matrix scan, two input capture, one output compare, PLL
Interrupting SCI (SCIA_9S12.zip) 
DP512 version (SCIA_DP512.zip) interrupting I/O, PLL
Interrupt TOF (TOF_9S12.zip)
DP512 version (TOF_DP512.zip) demonstrates periodic timer overflow interrupts
Fuzzy Logic (Fuzzy_9S12.zip), ADC, Fuzzy Logic speed controller, PLL
Pulse Accumulator (PulAcc_9S12.zip)
DP512 version (PulseAccum_DP512.zip)  measures pulse width, PLL
Complex examples
DP512 version (SCI1_DP512.zip) SCI1 busy-wait synchronization serial I/O
C32 version DFtest (DFtest10.zip) 
DP512 version (DFtest10_DP512.zip)10-bit unsigned digital filter tester uses SCI, PLL
C32 version DFtest (DFtest10s.zip)  
DP512 version (DFtest10s_DP512.zip) 10-bit signed digital filter tester uses SCI, PLL
LCD graphics (AGM1264_9S12.zip)
DP512 version (AGM1264_DP512.zip) uses 64 by 128 pixel LCD graphics driver
Scanned LED graphics board (LED_9S12.zip), uses PLL, SPI, ASCII fonts, double buffer, OC6 interrupts
Lab17 (Lab17_9S12.zip), 9S12C32 Preemptive Real-time OS with spinlock semaphores uses SCI, PLL

Fixed Scheduler (Scheduler_9S12.zip), 9S12C32 Non-preemptive Real-time OS
Serial Monitor (FlashSerialMonitor.zip), 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 (Simple_DP512asm.zip)  PP7 flashes on and off
Digital output (Square_DP512asm.zip), Simple squarewave output, using TCNT timer
Local variables (LocalDP512_asm.zip), How to allocate, access, deallocate local variables
Simple SCI0 (SCI0_DP512asm.zip)  Busy-wait synchronization serial I/O
Simple SCI1 (SCI1_DP512asm.zip)  Busy-wait synchronization serial I/O
Simple program (Test_DP512asm.zip) 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)
       Lab4_812A4.sch 
  Lab 5d. Stepper motor finite state machine 
       Lab5_812A4.sch    
  Lab 6e. SPI  DAC tone generator
         Lab6_812A4.sch   
  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 .