Rob Humble

YA SPI Question, follow-up

Discussion created by Rob Humble on Feb 15, 2006
Latest reply on Feb 16, 2006 by Mark Hotchkiss
First, thanks to Mac and Peg for their eariler comments and suggestions which seem to be leading me in the right direction. Well, until this roadblock.
void main(void) {
SPIC1_MSTR = 1;    // MCU set as SPI master
SPIC1_CPHA = 0;    // clock phase default
SPIC1_SSOE = 1;    // slave select output enable
SPIC2_MODFEN = 1;  // ss pin acts as slave select
SPIC2_SPC0 = 0;    // uses seperate pins for I/O
SPIC1_SPE = 1;     // Enable SPI
SPIBR = 0;         // Set baud rate to max (no divisors)   
for(;:smileywink: {
 __RESET_WATCHDOG(); // feeds the dog
// yes, it's a very short for loop
}                    // end of main()
interrupt 18 void KBI_ISR(void)
if (SW1 == 0){
while (!SPIS_SPTEF);     
SPID = 0x05;             
while (!SPIS_SPRF);      
my_status = (SPID);      
else if (SW2 == 0){
while (!SPIS_SPTEF);     
SPID = 0x03;
while (!SPIS_SPTEF);
SPID = 0x00;             
while (!SPIS_SPRF);      
my_serial = (my_serial | SPID) << 4;
while (!SPIS_SPRF);
my_serial = (my_serial | SPID);
So, everything seems to be good and I can check the various flags in the debugger, but writing to SPID (SPID = 0x05;) doesn't do anything and the value of SPID doesn't change. I haven't put a scope on the lines yet, so I don't know if SS is rising and falling as it should, but I'd at least figure that I'd see SPID change. Am I missing something here? That's a silly question.. of course I'm missing something, but what?