#INCLUDE <16F88.h>
#FUSES XT,NOWDT
#USE delay (clock=8M)
#USE fast_io(A)
#USE fast_io(B)
#define SS PIN_B5


//PROGRAMA PRINCIPAL
void main(){

   int8 dato=0;
   
   set_tris_a(0b00000001); //Configuración I/O
   set_tris_b(0b00000010);
   output_high(SS);
   
   setup_spi(SPI_MASTER | SPI_L_TO_H | SPI_XMIT_L_TO_H | SPI_CLK_DIV_16 ); //Configuramos hardware spi.
      
      //Enviar valor numérico:
   output_low(SS);
   spi_write(0xAA);     //Este valor se envia correctamente
   output_high(SS);
     
      //Enviar variable:
   dato=0xBB;
   output_low(SS);
   spi_write(dato);     //Al enviar la variable, se roduce un error.
   output_high(SS);
      
      
      
   while(1);   
}
