void main() { SPCR =0xD8; //Enabling SPI int,setting clock EA=1; ES0=1; SPDR=0xFF; //SPI data register while(1);
} unsigned char bdata test; sbit SPIF=test^7; void sr_intr() interrupt 4 { test=SPSR; if(SPIF==1) //Checking the status flag { SPIF=0; SPSR=test; SPDR^=0xFF; }
}
When I am trying to simulate the above in P89V51RD2 SPI data register is not getting loaded with the new values and it is not clearing the status the flag but SPI interrupt was triggering.What could be the problem? Thanks in advance.