Using Atmel AT89C51CC03, and having very strange problem with SPI. My interrupt routine is like this:
void SPIISR(void) interrupt 10 { if (SPSCR == 0x88) {P1_0 = ~P1_0;} tmpchar = SPDAT; SPDAT = 0xCC; P1_1 = ~P1_1; }
It took me lots of time to narrow down SPSCR to 0x88, but with this code, what I see on the scope is that P1_0 toggles every 16~17 us even when chip select is HIGH. After the first low chip select, P1_0 stops toggling, and P1_0 never toggles again. P1_1 never toggles at all.
So I am really confused here. P1_0 is toggling and P1_1 is not. Does it toggle from the interrupt? Why does this only happen before first LOW Chip Select and nothing during LOW Chip Select?