/////////////////////////////////////////////////////////////////////////
////                            EX_ICD.C                             ////
////                                                                 ////
////  This is a simple program used to demonstrate the use of the    ////
////  ICD as a device.  The example does some simple math and then   ////
////  flashes a LED at a frequency of 1Hz.                           ////
////                                                                 ////
////  Configure the CCS prototype card as follows:                   ////
////     Jumper from pin 42 to 47.                                   ////
////     See additional connections below.                           ////
////                                                                 ////
////  This example will work with the PCM compiler.  The following   ////
////  conditional compilation lines are used to include a valid      ////
////  device for each compiler.  Change the device and clock for     ////
////  your hardware if needed.                                       ////
/////////////////////////////////////////////////////////////////////////
////        (C) Copyright 1996,2001 Custom Computer Services         ////
//// This source code may only be used by licensed users of the CCS  ////
//// C compiler.  This source code may only be distributed to other  ////
//// licensed users of the CCS C compiler.  No other use,            ////
//// reproduction or distribution is permitted without written       ////
//// permission.  Derivative programs created using this software    ////
//// in object code form are not restricted in any way.              ////
/////////////////////////////////////////////////////////////////////////


#if defined(__PCM__)
#include <16f877.h>
#device ICD=TRUE
#fuses XT,NOWDT,NOPROTECT
#use delay(clock=4000000)
#endif

#define  TOGGLE_PIN  PIN_A4


// This function turns the LEDs on and off
void flash_led() {

   output_a(0x00);
   delay_ms(1000);
   output_a(0xFF);
   delay_ms(1000);
}


// This function does simple math and also turns the LEDs on and
// of at a frequency of 1Hz
main()
{
   while(TRUE)       // flash LEDs at 1Hz
      flash_led();
}
