Starter files used in the design of microcontroller-based embedded systems
These starter files are used in the embedded systems labs at the University of Texas at Austin. They are specifically designed for EE319K (assembly language), EE445L (interfacing in C), EE345M (embedded systems, real-time operating systems, and robotics), EE385J.17 (biomedical instrumentation) and EE464 (capstone design lab). These files are are Copyright by Jonathan W. Valvano. You may use, edit, run or distribute these files as long as the copyright notices within the files remain. No specific warrantee exists concerning the accuracy or reliability of these examples. I think they work, but history has shown, sometimes I can be wrong.
Functional descriptions  Data sheets  Go to Home Page

Link to download

Course(s)

Type

Description of starter file

Applications

ADC_9S12.zip
ADC_DP512.zip

EE445L

Metrowerks C

9S12C32 and 9S12DP512 projects with ADC input, LCD output

Sample analog input, display output on LCD. This driver can be used for any application needing the ADC on the 9S12C32. or 9S12DP512. Analog to digital conversion, data acquisition system, LCD output.

AGM1264_9S12.zip
AGM1264_DP512.zip

 

Metrowerks C

9S12C32 and 9S12DP512 projects with LCD graphics interface, including driver, circuit diagram, and design documents.

Plot graphics, text on a 128 by 64 bit LCD. This AGM1264 driver can be used for a real-time DAS based on the $10 LCD1030 available at www.bgmicro.com.

C32AdaptPin.pdf

EE445L/EE345M

PDF

TechArts 9S12C32 board

Place paper between board and protoboard. Make sure you print file this with no scaling.

EE319K_DP512_Artist.sch
EE319K_DG128_Artist.sch

EE319K

PCB Artist

Circuit drawing file of components used in EE319K

This file can be used when drawing interface circuits for the Adapt 9S12DP512 or 9S12DG128.

DFtest10.zip  (C32)
DFtest10_DP512.zip

EE345M, EE385J.17

Metrowerks C

9S12C32 and 9S12DP512 projects for testing unsigned 10-bit digital filters. The input is simulated and the output is displayed using SCI.

This project can be used to experimentally determine the gain versus frequency response of an unsigned digital filter based on simulated unsigned 10-bit ADC data (0 to 1023).

DFtest10s.zip (C32)
DFtest10s_DP512.zip

EE345M, EE385J.17

Metrowerks C

9S12C32 and 9S12DP512 projects for testing signed 10-bit digital filters. The input is simulated and the output is displayed using SCI.

 This project can be used to experimentally determine the gain versus frequency response of an unsigned digital filter based on simulated signed 10-bit ADC data (-512 to +511).

Dac.xls

EE319K

Excel

4-bit sine wave table, 4-bit exponential pacemaker wave

EE319K students can use this Excel sheet to design the 4-bit sine wave table for Lab 9.

dac_sin.xls dac_trumpet.xls dac_flute.xls dac_horn.xls

EE445L

Excel

sound wave tables for a digital to analog converter

EE445L students can use these Excel sheets to design the 12-bit sound for Lab 5. Adjust the red parameter, then copy paste table. The tables have DAC values used to create sound.

DigitalFilterDesign.xls

EE385J.17

Excel

Digital filter design method. Infinite impulse response filter (IIR)

Use this file to design and analyze IIR digital filters with up to 8 poles and 8 zeros.

DP512AdaptPin.pdf
DP512adaptPinH1.pdf

EE319K, EE445L

PDF

TechArts 9S12DP512 board

Place paper between board and protoboard. Make sure you print file this with no scaling. H1 version is 18 copies for TAs to cutout.

EE345LextraComponents.sch
Connector.pcb

 

ExpressSCH

Circuit drawing file of components used for 9S12 systems

This file can be used when drawing interface circuits for the Adapt 9S12C32. No longer used in EE445L

EE385JextraComponents.sch

 

ExpressSCH

Circuit drawing file of components used in EE385J.17

This file can be used when drawing interface circuits for the Adapt 9S12C32. No longer used in EE385J

FFT.CPP

 

Visual C++

Code file for a FFT

Derived from Numerical Recipes in C, Cambridge University Press

FFT.H

 

Visual C++

Header file for a FFT

 

FFT16.xls

 

Excel

Simple 16-bit FFT

Use this file to explore the FFT, understand the Nyquist Theorem and see the consequences of aliasing.

FlashSerialMonitor.zip C32;
HCS12SerialMon2r2_C128.zip

 EE445L

Metrowerks assembly

Serial monitor for the 9S12C32 or the 9S12C128

Using a BDM, you can reflash the serial monitor debugger on your 9S12C32 or the 9S12C128

FlashSerialMonitorDP512.s19

 

Machine code

Serial monitor for the 9S12DP512

Using a BDM, you can reflash the serial monitor debugger on your 9S12DP512

Fuzzy_9S12.zip

 EE345M

Metrowerks C

Fuzzy logic motor controller

This example shows how to implement a fuzzy logic motor controller on the 9S12C32. It also shows how to link an assembly program (fuzzy logic engine) to a C project (motor controller). 

GCC11.zip

 

Gnu C

Open source compiler for the 6811 and example files

Students can use the Gnu project to compile software for the 6811 embedded system. It also includes a 6811 debugger that runs on a 9S12C32.

HeapSimple_9S12.zip

 

Metrowerks C

Allocate and Release.

This very simple memory manager allows you to allocate and release blocks of a fixed size. It illustrates linked lists. Malloc and free

Heap_9S12.zip

EE445L

Metrowerks C

Memory manager: malloc, calloc, realloc, and free.

Jacob Egner wrote this memory manager using the binary buddy system.  This manager can be used in systems needing a dynamic memory allocation. In EE445L we use it as a case study to describe the proper use of header and code files.

IC_9S12.zip
IC_DP512.zip

EE445L

Metrowerks C

Keyboard interface for 9S12C32 and 9S12DP512 using input capture interrupts 

This example illustrates how input capture interrupts can be used to interface a 2 by 2 matrix keyboard. Output compare interrupts are used to debounce the keyboard.

IR_9S12.zip

 

Metrowerks C

IR detector interface for the 9S12C32. Period measurement

A digital waveform from a IR detector is placed on PT2, and input capture interrupts are used to measure a sequence of pulses.

ICC12D.zip

 

ICC12 C

Three examples, LED, DAS, and output compare interrupts

These examples illustrate how C programs can be compiled on ICC12 and simulated within TExaS

LCD_9S12.zip
LCD_DP512.zip

EE445L

Metrowerks C

LCD interface to the 9S12C32 and 9S12DP512 

This is a 4-bit mode interface using 7 pins on the 9S12 to send data to a HD44780-based LCD display 

LED_9S12.zip

 

Metrowerks C

64 by 8-bit LED interface

A 64 by 2 bit, 3-color LED board illustrates concepts of device driver, scanned display, double buffer, and output compare interrupts.

LPF.xls

EE445L, EE345M, EE385J.17

Excel

Design process for a low pass filter

You can use this spreadsheet to design a Butterworth 2-pole analog filter using one op amp, 3 capacitors of the same value, and 2 resistors of the same value.

Lab1e.UC

EE445L

TExaS

Microcomputer file to link TExaS

Allows you to compile on Metrowerks and simulate on TExaS

Lab1e.c

EE445L

Metrowerks C

Test file for EE445L Lab 1e 

Contains input/output parameters for testing the fixed-point conversion programs in Lab 1e. It is an example of how to test.

Lab2g_DP512.zip

EE445L

Metrowerks C

Two projects for Lab 2g

Examples of how to create debugging instruments, new Fall 2010

Lab3_Artist.sch

EE445L

PCBArtist

LM3S1968 with switch, speaker

Simple drawing file for creating circuit for Lab3

Lab6h_artistStarter.sch
Lab6h_artistStarter.pcb
9S12C128_artist.sch (old)

EE445L

PCBArtist

Lab 6 starter files, one with serial interface for serial monitor

Freescale 9S12C32 circuit and PCB

Lab4_Artist.sch

EE445L

PCBArtist

Stepper Motor and LM3S1968

Unipolar stepper motor with 7-pin connector , stepper motor, 2N2222 and L293

Lab 8 BOM

EE445L

Excel

Parts available for Lab 8

EE445L students use this list as they design Lab 8. It includes part number, price, and source for many components needed for an embedded system.

Lab9dv2.zip

 

 

 

 Test of reentrant behavior with various FIFO implementations

Lab17_9S12.zip

 

Metrowerks C

Fully running project

 Real-time OS kernel for 9S12, spin-lock semaphores

Lab18_9S12.zip

 

Metrowerks C

Prototype for an OS

 Starter file for real-time OS

LEDtoggle_DP512.zip
LEDtoggle_DG128.zip

EE319K, EE445L

Metrowerks C

Simple program that toggles an LED on and off, for the 9S12DP512 and the 9S12DG128

This example illustrates Port P direction register, Port P data register and 1/2 sec time delay using TCNT timer. Timer_Wait function

LocalDP512_asm.zip EE319K TExaS Simple program illustrating how to create a local variable on the stack This example uses SP index mode to access the local variables, creates a binding using EQU, and has a STK window to observe the local variables on the stack

Moore_9S12.zip
Moore_DP512.zip

Moore_DG128.zip

EE319K
EE445L

Metrowerks C

Two input, two output FSM

Illustrates how to many a ROM-based FSM controller, showing linked lists and the timer

Nanocore_C32_Artist.sch EE445L PCBArtist Template for using the Nanocore Tech Arts 32-pin nanocore has a 9S12C32, RS232 and regulator

NotGate_9S12.zip

EE445L

Metrowerks C

 

 

NotGate_DP512asm.zip
NotGate_DG128asm.zip

EE319K

TExaS assembly

Input from PT7 output to PP7 

This is a very simple 9S12D assembly examples with one input and one output. Can be simulated or run on the real 9S12DP512 or 9S12DG128

OC3_9S12.zip

 

Metrowerks C

Output compare interrupt on the 9S12C32

Simple output compare 3 interrupt, used to run a FSM in the background. Also includes the PLL.

OC_9S12.zip

 

Metrowerks C Output compare interrupt on the 9S12C32

OC3 interrupt software module. The device driver allows the main program to pass a function and set the interrupt period. The main program spins a stepper motor at a constant speed.

OC_DP512.zip
OC_DG128.zip

EE319K
EE445L

Metrowerks C

Output compare periodic interrupt on the 9S12DP512, DG128

This example illustrates how to create two periodic interrupts, one at 100 Hz and one at 1000 Hz.

PCBArtistLibrary.zip EE445L/EE345M PCBArtist Library files for EE445L and EE345M 9/11/11 Place the six library files into the PCB library directory, or add folder in the Library Manager

PWM_9S12.zip
PWM_DP512.zip

 

Metrowerks C

Pulse width modulation on the 9S12C32 and 9S12DP512

Port T on the 9S12C32 and Port P on the 9S12DP512 can be used to generate waves with a fixed period, but with a user programmable duty cycle. PWM is an effective way to adjust power to a DC motor.

PulAcc_9S12.zip
PulseAccum_DP512.zip

 

Metrowerks C

Pulse accumulator on the 9S12C32 and 9S12DP512

This is an example application of the pulse accumulator, which can be used to measure period or frequency on PT7.

RTI_9S12.zip
RTI_DP512.zip

 

Metrowerks C

Real time interrupt on  the 9S12C32 and 9S12DP512

This example illustrates the RTI interrupt on the 9S12 

SCIA_9S12.zip
SCIA_DP512.zip

EE445L

Metrowerks C

Interrupt driven SCI driver for the 9S12C32 and 9S12DP512

This example illustrates interrupt-driven serial I/O using the serial port SCI, including two FIFOs. The SCI driver includes a debugging instrument to collect histograms of FIFO sizes during execution.

SCIB_9S12.zip
SCIB_DP512.zip

 

Metrowerks C

SCI driver using two Port T pins

Use this driver when a second SCI device is needed on the 9S12C32 and 9S12DP512. It uses one input capture and two output compares to implement a virtual serial port SCI port on PT2 and PT3.

SCI_9S12.zip
SCI0_DP512.zip
SCI1_DP512.zip

EE445L

Metrowerks C Busy-wait SCI drivers for the 9S12C32 and 9S12DP512 These examples illustrate serial I/O using serial port SCI

SCI0_DP512asm.zip
SCI1_DP512asm.zip

EE319K

TExaS assembly Busy-wait SCI drivers for the 9S12DP512

These examples illustrate  serial I/O using serial port SCI0 and SCI1

Scheduler_9S12.zip

EE345M

Metrowerks C

 A real-time thread scheduler for fixed-time periodic threads

This is a real-time thread scheduler. One task is low priority but the remaining three tasks are high priority threads. The high priority threads are run at fixed (but unequal) rates

SDC_DP512.zip   Metrowerks C Low level driver code for a secure digital card (SDC). Includes initialization, read block and write block commands. Includes a full FAT16 and FAT32 file system driver for the 9S12. The SDC can run in simple SPI mode. This driver implements initialization, block write and block read functions on the card. It runs on the 9S12DP512, but porting to other 9S12 boards should be easy. It requires one SPI port and one output compare interrupt. If you are building the circuit shown in Figure 10.22, replace 10k pullup resistors with 470 ohms. FAT FAT16 FAT32 software driver

Simple_DP512asm.zip
Simple_DG128asm.zip

EE319K

TExaS assembly

Output to PP7 

This is a simple 9S12D assembly examples, showing a LED output and the delay loop. Can be simulated or run on the real 9S12DP512 or 9S12DG128

SineWave.xls

EE445L

Excel

Shows mixing of two sine waves

Two 5-bit DAC waves are added into one 6-bit output

Slot32.EPS

EE345M

Encapsulated PS

Circular template for a tachometer

To be used with an optical sensor for RPM measurement

Slot32.FH11

EE345M

Freehand

Circular template for a tachometer

To be used with an optical sensor for RPM measurement

Slot32.pdf

EE345M

pdf

Circular template for a tachometer

To be used with an optical sensor for RPM measurement

Square_DP512asm.zip
Square_DG128asm.zip

EE319K

TExaS assembly

Output to PP7 

This is a simple 9S12DP512 assembly example, showing a LED output and the timer. Can be simulated or run on the real 9S12DP512 or 9S12DG128

TOF_9S12.zip
TOF_DP512.zip

EE445L

Metrowerks C

Timer overflow periodic interrupt for  the 9S12C32 and 9S12DP512

This example illustrates the TOF interrupt  

Test_DP512asm.zip

EE319K

TExaS assembly

Output to PP7 

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 

Tester.zip

 

Metrowerks C

9S12C32 board tester

First checkout the orange platform for the tester, download this program to the 9S12C32, quit the debugger, and run HyperTerminal

Tester_DP512.zip
Tester_DG128.zip
  Metrowerks C

9S12DP512 board tester

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

Therm3.msm

EE445L

Multisim

Bridge circuit for thermistor interface

This simulation file can be used to design a thermistor bridge and amplifier using just one op amp.

Therm10.xls
Therm12.xls

Therm16.xls
Therm10Vref2_5.xls

EE445L

Excel

Design process for a 10-bit, 12-bit or 16-bit temperature DAS, with instrumentation amp reference at 0V and at 2.5V

Enter calibration data for the thermistor, choose resistor values for bridge, select gain for instrumentation amp, then copy paste calibration tables into C program. Used for EE445L Lab 6.

TRobots1_85.zip EE319K Metrowerks C 9S12DP512 engine for TRobots This starter file can be used with TRobots version 1.85, Spring 2011. TRobots is a simulated tank battle that is used as a programming competition. Each contestant writes assembly or C code that runs on a 9S12 to control a tank. 2 to 50 tanks operate in a simulated battle.

TimerWait_DP512asm.zip

EE319K

TExaS assembly

Output to PP7 

This is a 9S12DP512 assembly example, showing LED toggling with the delay function implemented with TCNT. Can be simulated or run on the real 9S12DP512 

UM245R.sch

 

ExpressSCH

Circuit drawing for the USB interface 

 Use this drawing template in the UM245 USB module

 

Last updated September 15, 2011 Send comments to: Jonathan W. Valvano .