// ============================================================================= // Object here is to test the hardware for the generic PIC18F6722 // development envirionment namely: // // LCD interface // I2C 512 EEPROM A // I2C 512 EEPROM B // Three on board LED's // Comm 1 // Comm 2 // // Kevin Wheatley - M0KHZ // Code writen for CCS 'C' compiler - Version 3.249 // // Ver. Date History // ----------------------------------------------------------------------------- // 0.001 03-05-08 Initial start of project // // ----------------------------------------------------------------------------- // // ============================================================================= // ============================================================================= // Libraries // // Change to suit your directory structure // // ============================================================================= #include "C:\Program Data\PICC\PIC18F6722_Dev_Board\PIC18F6722_Dev_Board.h" #include "C:\Program Data\PICC\PIC18F6722_Dev_Board\Flex_LCD420.C" #include #include #include "C:\Program Data\PICC\PIC18F6722_Dev_Board\24512.c" #include #include "C:\Program Data\PICC\PIC18F6722_Dev_Board\Definitions.c" #include "C:\Program Data\PICC\PIC18F6722_Dev_Board\Functions.c" // --------------------------------------------------------------------- // RTCC Interrupt Service routine(s) // --------------------------------------------------------------------- // designates that this is the routine to call when timer2 overflows #INT_TIMER2 void Timer2isr() { // button_press(); } void main() { // ====================================================== // There are a few things that need to be do before moving // into the main program loop, these are gathered together // and placed in the power_up() function. // ====================================================== power_up(); // ====================================================== // Main program loop starts here // ====================================================== while (true) { // ====================================================== // Call function for the current state of the FSM // ====================================================== switch (state) { case 0 : state_00 (); break; case 1 : state_01 (); break; case 2 : state_02 (); break; case 3 : state_03 (); break; case 4 : state_04 (); break; case 5 : state_05 (); break; case 6 : state_06 (); break; // ====================================================== // add as many states as require for you application // ====================================================== default : state_error (); break; } // ====================================================== // You might want / need to do some more tasks before processing // the state change - if any // ==================================================== // ==================================================== // Process any state changes // ==================================================== do_state_change () ; } } // ==================================================== // That’s all folks! Program flow control complete. // ====================================================