

SPCTL = 0xD7;// configure SPI
ESPI = 1;    // enable SPI interrupt

// send a byte
  Chip_S = 1; // slave select  
  SPDAT = 0x09;          // Send byte command 
  delay();
  SPDAT = 0x80;	 	 // send address byte 
  delay();
  Chip_S = 0;   // end trans to slave
