I am trying to debug some simple code to read and write to the SPI port on an ADuC831. I can setup the port just fine and send data out. However, is there a way for me to "read in" a value into the SPIDAT register? Example// ISPI = 0; //init SPI interrupt SPIM = 1; //Declare as Master CPOL = 0; //Idle Clock Polarity Low CPHA = 1; //Data sent on Leading edge SPR1 = 1; // SPR0 = 1; // divide clock by 16 SPE = 1; //activate spi port while (1) { SPIDAT = 0xA0; //send a control byte out while (!ISPI); //wait until interrupt i = SPIDAT; // read in value in SPIDAT } I am not able to enter in a value for SPIDAT into the SPI Peripheral window. It just keeps reading in i = 0x00. Any help?
The simulated SPI interface is more sophisticated than that. You probably need to write a simuation script to actually simulate the SPI device you are connected to. There is a good example at: http://www.keil.com/download/docs/at89s8252_spi.zip.asp It is written for the Atmel 89S8252 but the principles still apply. Be sure to look at the INI file that has the script for an SPI memory device. Jon
Thanks, will try this. Hopefully its not too above my head. MG