/* Standard Include for 16F877 Chip */
#include <16F877.h>
#fuses XT,NOWDT,NOPROTECT,NOLVP,PUT

/* Delay for 4 mhz crystal */
#use delay (clock=4000000)

/* Setup RS232 */
#use rs232(baud=9600, xmit=PIN_D4,rcv=PIN_D5, INVERT)

/* Setup I2C */
#use i2c(SLAVE, SDA=PIN_C4, SCL=PIN_C3, address=0xa0, SLOW, FORCE_HW)

#INT_SSP
void ssp_interupt ()
{
   byte incoming;
   incoming = i2c_read();
   printf("\n\rRead byte 1: %x\n\r", incoming);
   incoming = i2c_read();
   printf("Read byte 2: %x\n\r\n\r", incoming);
}


main()
{
      delay_ms(1000);
      printf("Running");

      enable_interrupts(GLOBAL);
      enable_interrupts(INT_SSP);
      while (true)
   {

   }
}



