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.

  • When I am trying to simulate the above in P89V51RD2 SPI

    if a simulator were to support every unique function of every unique derivative, you could not afford it. Most simulators will simulate the "classic"51 and a few uniques.

    Erok

  • Eric, uVision covers simulation for arround 500 different 8051 variants.

    The P80LV51RD2 is simulated in PK51 V8.05. See:
    http://www.keil.com/dd/chip/3625.htm
    http://www.keil.com/dd/vtr/3625/1352.htm

    Now the question is: which version is used by PRK Ganesh?

  • Eric, uVision covers simulation for arround 500 different 8051 variants.

    I know that, but if you could guarantee that all 'special' SFRs in all derivativers listed were fully covered and fully tested as to the effect of every bit in those, you would be "too good to be true"

    The point I make is that no simulator can be guaranteed to truthfully emulate all (unique) SFRs.

    A short while ago there was a post here or at 8052 about a SFR in a LPC chip that was not simulated, the poster did never burn a chip because of an unfounded trust in the simulator. When he burned the actual chip all worked.

    I have no doubt, Reinhard, that the Keil simulator is the most complete, but I am willing to bet a lot that no none could make a completely verified simulator for the entire '51 spectrum with any reasonable business attitude.

    Erik