I2C Raspberry Pi to PIC24F
Test this:

unsigned char I2C_RECV[1]

void main(void) {
  unsigned int temp=0,temp2=0, i;
  for(i=0; i&lt;1; i++)
     I2C_RECV[i]=0;

  TRISA = 0b0000000000000000;
  PORTA = 0b0000000000000001;

  /* INITIALISE I2C MODULE  */
  CloseI2C1();        // close i2c if it was operating earlier

  while(1){

   config1 = (I2C_ON | I2C_7BIT_ADD | I2C_CLK_REL | I2C_STR_EN  );
   config2 = 0;                //This defines I2C to be slave
   OpenI2C1(config1,config2);  //configure I2C1
   I2C1ADD = 0x22;             //I2C address set to 1E  

    I2C1CONbits.I2CEN = 1;     // ENABLE I2C!!
    I2C1CONbits.DISSLW = 1;    // Disable slew rate control
    I2C1CONbits.GCEN = 1;      // Enable interrupt when a general call address is received (enable for reception)

    while(IFS1bits.SI2C1IF==0){asm ("clrwdt");}; //wait untill the data is transmitted from master

    temp = SlaveReadI2C1();     //Read address to empty buffer
    temp2 = SlaveReadI2C1();    //Read data to empty buffer

    SlavegetsI2C1(I2C_RECV,1);

    if(temp2 == 0x09) PORTA = 0b0000000000000011;
    else PORTA = 0b0000000000000000;        
    CloseI2C1();      //Disable I2C
  }  
}