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

How I can call a SPI function from Interrupt service Routine

Hi
I am using 89C51ED2 for my projects.From SPI I am receiving datas from peripherial.I using inbuilt registers like SPDAT,SPCON.But I can't call my SPI function
from interrupt service routine

My CODE is

void readspi(void){

Enablecs();
SPDAT = addr;
while((SPSTA & 0x80) == 0);
spivalue = SPDAT;
while((SPSTA & 0x80) == 0);
Disablecs();
}

void Ext0_ISR(void) interrupt 0 using 1{
readspi();
}
void main(void){
static unsigned int spivalue;
while(1){
}

}

Please help me to over come this problem

0