Davide Capitanio

SPI don't work with Full Chip Simulation

Discussion created by Davide Capitanio on Mar 22, 2007
Latest reply on Mar 22, 2007 by David Payne
Hi to all,
I'm trying to use a MC9S08GT60. I'm using Full Chip Simulation to verified that all the function works fine.
I've a data that I want send by SPI, but in Full Chip Simulation I can't write on the SPI1D register.
There is the code:

byte SPI_send(char data)
{
while (!SPI1S_SPTEF); /* Wait for Tx buffer empty */
SPI1S; /* Read of SPI1S with SPTEF=1 */
SPI1D = data; /* Send byte */
while (!SPI1S_SPRF); /* Wait for Rx buffer full */
return (SPI1D); /* Received byte value */
}

When I write data to SPI1D with "SPI1D = data" nothing happens!
The memory map don't change.

Where I fail?

Best regard,
Davide

Outcomes