Hello Bigmac,
I am working on SPI Driver for MC9S08DZ60 microcontroller. I have one master and one slave, both master and slave are of same microcontrollers( MC9S08DZ60). I have a problem in receiving a byte at the slave side. Im not sure also whether the data byte has been sent or not. Following is my code.
Transmit function at Master side:
---------------------------------------
void spi_tx(void)
{
int fl_dummy;;
while(!SPIS_SPTEF);
fl_dummy = SPIS; //Clear SPTEF flag
SPID = 0x06;
while((SPIS & 0x80) != 0x80); //Wait for transmission to complete
}
Receive function at Slave side:
---------------------------------------
int spi_rx(void)
{
int temp;
temp = SPIS;
while((SPIS & 0x80) != 0x80);
temp = SPID;
return temp;
}
This micro controller is from HCS08 family.
Can u please lemme knw what and where the prblm exists.
Its very urgent. Kindly reply me ASAP.
Thank you.
Regards
xxxx