#include /* common defines and macros */ #include /* derivative information */ #pragma LINK_INFO DERIVATIVE "mc9s12c128" /* File: lab_7_stopwatch_skeleton.c Author: Justin Ray Modified by: Chris Szilagyi 9-28-2009 - Updated to use mc9s12c128 headers - Added modclock.h includes and clockSetup() calls This program skeleton provides a framework for implementing a stopwatch using the MC9S12C128 chip and the project board. */ #include #include "lcd_lib.h" #include "modclock.h" //TODO define state constants here void main(void) { unsigned long timerCount; //TODO declare any additional variables here EnableInterrupts; //configure ports A and B as inputs //TODO //set bus clock to 8 MHz clockSetup(); //set up LCD for writing lcdSetup(); /* initialize the onboard timer */ //set the timer to run at 0.50 MHz with no interrupts enabled //TSCR2 = ??; TODO //set the timer to be disabled in stop and freeze mode; enable the timer //TSCR1 = ??; TODO //TODO do any one-time state initiliziation here /* wait forever */ for(;;) { //TODO monitor and respond to buttons //TODO implement the rollover state machine and display functionality here. } }