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), EE345L (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

EE345L

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

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

EE345L/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

PCB Artist

Circuit drawing file of components used in EE319K

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

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

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

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

EE345L

Excel

sound wave tables

EE345L students can use these Excel sheets to design the 12-bit sound for Lab 5. Adjust the red parameter, then copy paste table.

DigitalFilterDesign.xls

EE385J.17

Excel

Digital filter design method

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

DP512AdaptPin.pdf
DP512adaptPinH1.pdf

EE319K, EE345L

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 EE345L

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

EE345M

Visual C++

Code file for a FFT

Derived from Numerical Recipes in C, Cambridge University Press

FFT.H

EE345M

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 
HCS12SerialMon2r2_C128.zip

 

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

Heap_9S12.zip

EE345L

Metrowerks C

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

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

IC_9S12.zip
IC_DP512.zip

EE345L

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

EE345L

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

EE345L, 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

EE345L

TExaS

Microcomputer file to link TExaS

Allows you to compile on Metrowerks and simulate on TExaS

Lab1e.c

EE345L

Metrowerks C

Test file for EE345L 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

EE345L

Metrowerks C

Two projects for Lab 2g

Examples of how to create debugging instruments

Lab3f_Artist.sch

EE345L

PCBArtist

DP512 with LCD speaker

Simple drawing file for creating circuit for Lab3f

Lab6h_artistStarter.sch
Lab6h_artistStarter.pcb
9S12C128_artist.sch

EE345L

PCBArtist

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

Freescale 9S12C128 circuit and PCB

Lab4h_Artist.sch

EE345L

PCBArtist

Stepper Motor

Unipolar stepper motor with 7-pin connector 

Lab 8 parts

EE345L

Excel

Parts available for Lab 8

EE345L 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

EE345M

Metrowerks C

Fully running project

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

Lab18_9S12.zip

EE345M

Metrowerks C

Prototype for an OS

 Starter file for real-time OS

LEDtoggle_DP512.zip

EE345L

Metrowerks C

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

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

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

EE345L

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 EE345L PCBArtist Template for using the Nanocore Tech Arts 32-pin nanocore has a 9S12C32, RS232 and regulator

NotGate_9S12.zip

EE345L

Metrowerks C

 

 

NotGate_DP512asm.zip

EE319K

TExaS assembly

Input from PT7 output to PP7 

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

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

EE345L

Metrowerks C

Output compare periodic interrupt on the 9S12DP512

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

PCBArtistLibrary.zip EE345L PCBArtist Library files for EE345L 10/26/09 Place the six library files into the PCB library directory, or add folder in the Library Manager

PWM_9S12.zip
PWM_DP512.zip

EE345M

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

EE345L

Metrowerks C

Interrupt driven SCI driver for the 9S12C32 and 9S12DP512

This example illustrates interrupt-driven serial I/O using 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 SCI port on PT2 and PT3.

SCI_9S12.zip
SCI0_DP512.zip
SCI1_DP512.zip

EE345L

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

SCI0_DP512asm.zip
SCI1_DP512asm.zip

EE319K

TExaS assembly Busy-wait SCI drivers for the 9S12DP512

These examples illustrate  serial I/O using SCI0 and SCI1

Scheduler_9S12.zip

EE345M

Metrowerks C

 

 

Simple_DP512asm.zip

EE319K

TExaS assembly

Output to PP7 

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

SineWave.xls

EE345L

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

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 

TOF_9S12.zip
TOF_DP512.zip

EE345L

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   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

EE345L

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

EE345L

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 EE345L Lab 6.

Trobot_DP512.zip EE319K Metrowerks C 9S12DP512 engine for TRobots This starter file can be used with TRobots version 1.83, Spring 2009

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

EE345M

ExpressSCH

Circuit drawing for the USB interface 

 Use this drawing template in the USB lab in EE345M

 

Last updated November 21, 2009 Send comments to: Jonathan W. Valvano .