This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Data in not getting loaded for SPDR register

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.

0