#include <12F683.h>
#device ADC=10
#fuses INTRC_IO,NOWDT,NOPUT,NOPROTECT,NOCPD,NOMCLR
#use delay(clock=4000000)
#define GP0 PIN_A5
#define GP1 PIN_A4
#define GP2 PIN_A3
#define GP3 PIN_A2
#define GP4 PIN_A1
#define GP5 PIN_A0
#use spi(DI=PIN_A2, DO=PIN_A1, CLK=PIN_A3)
void init()
{
set_tris_a( 0b11100001 ); // set GP0 output, all other inputs
setup_comparator( NC_NC_NC_NC ); // disable comparators
setup_adc_ports( NO_ANALOGS ); // disable analog inputs
setup_adc( ADC_OFF ); // disable A2D
}
void main()
{
init();
while ( TRUE ) // blink LED
{
spi_write(0x70);
}
}