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

LPC21 SPI IRQ

Hi, I'm sorry for a stupid question but I'm having BIG troubles trying to run SPI using IRQ.

I have SSEL0 pulled up to +3.3V. And SPI works fine when I just poll SPIF like:

S0SPDR=0xXX;

while(!(S0SPSR & 0x80)){}

But when I want to setup IRQ after SPI transfer is done. It don't work. It don't go into ISR at all. I think that after I fill S0SPDR with data to transfer, it should go into ISR after some time right? Or do I have to do something else??? Very strange is that in emulator it works fine! But in real LPC2129 it don't (I've put a breakpoint there using ULINK JTAG (It works fine for USART0 ISR))!!! I setup SPI like this:


/* Configure Pin Connect Block */
PINSEL0=0x5500;

/* Set pclk to same as cclk */
VPBDIV=0x01;

 /* Set to highest speed for SPI at 60 MHz -> 7.5 MHz */
S0SPCCR=0x08;

VICIntSelect &= ~( 0x0400 );
VICIntEnable |= 0x0400;
VICVectAddr2 = ( unsigned long ) vSPI0_ISR;
VICVectCntl2 = 0x02a;


/* Device selected as master, IRQ on */
S0SPCR=0xa0;


Thank You in advance, Mirek