#include /* common defines and macros */ #include /* derivative information */ #pragma LINK_INFO DERIVATIVE "mc9s12c32" void main(void) { unsigned char inputVal; TCTL1 = 0x00; //Disconnect timer from PTT TCTL2 = 0x00; DDRT = 0xF0; //Set direction PTT4-7 output PTT0-3 input PERT = 0x00; //Turn off pull-ups/pull-downs /* put your own code here */ EnableInterrupts; PTT = 0x00; for(;;) { Debounce_WaitPressPortTlow4(); inputVal = PTT; inputVal = inputVal & 0x0F; Debounce_WaitReleasePortTlow4(); switch(inputVal) { case 14: PTT = 0x10; break; } } /* wait forever */ /* please make sure that you never leave this function */ }