> I don't think the problem is with the interrupt service routine, the problem > is that the PSPIF bit does not get set in the first place despite low pulses > on !CS and !WR. I'm trying to interface the PIC to a 80C85 processor, !CS is > 900 ns and !WR is 450 ns well within !CS. > > Thank you for your inputs. Do you, or anybody else, have an explanation for > the missing PSP interrupt flag, PSPIF in PIR1? You said you'd read the errata sheets, so I didn't include this, but I saw a similar problem, and the cause of the problem was that use of the RETURN instruction clears the PSPIF bit. Note that this was in May of last year when I was messing with this, and Rev A silicon was supposed to have fixed this problem, but I have not verified this personally. My solution was to avoid use of the RETURN function. Since I couldn't control how the compiler used it, I simply forced a return with a "RETLW 00h" just before the end of a function. Here's the note from my source: // // The PIC16C64 and PIC16C65 have a bug that affects the operation of // the parallel slave port (PSP). The bug is that the IBF (Input // Buffer Full) flag is cleared whenever the processor executes a // RETURN instruction. Since the compiler uses this instruction a // lot, the following #define is used to enable insertion of a RETLW // #0 instruction just before the compiler-generated RETURN. This // ends up wasting a few bytes, but allows the PSP to work ... // #define PSP_BUG_WORKAROUND TRUE #if PSP_BUG_WORKAROUND == TRUE #define PSP_Return() #asm " RETLW 00h" #else #define PSP_Return() #endif The way this is used is like this: void function (void) { // ... do something ... PSP_Return(); } The problem with this, of course, is that it makes it difficult to return values from functions, except by using global variables. In my application this was not a big deal, but your mileage may vary ... The weird thing for me was that the program worked perfectly when running from the emulator (Advanced Transdata RICE16), but didn't work stand-alone, in a real PIC. But as soon as I replaced all my RETURNs with RETLWs, the PSP magically started working ... Randy Rasa rrasa@sky.net http://www.sky.net/~rrasa