unsigned char writeSPI(unsigned char byte)
{
SPI0CN0_SPIF = 0;
SPI0DAT = byte;
while(!SPI0CN0_SPIF);
return SPI0DAT;
}