The lpc2148 user guide says:
If SSE bit in SSPCR1 is set "The SSP controller will interact with other
devices on the
serial bus. Software should write the appropriate control information to the
registers and interrupt controller registers, before setting this bit."
However, if SSPIMSC with an appropriate interrupt mask is updated afret SSPCR1
is set to 2 then everything works just fine!
Something strange happens when I try to use SSP in lpc2148.
So, I initiate SSP as per spi1_init(2,11) in SPI mode with tx FIFO half empty
enabled (see the code below).
Then I start to transfer bytes over SPI.
The first portion of the data until tx FIFO is empty being transfered Ok. Then
I expect SPI1 interrupt routine should be called, but it never happens. I
expect ISR being called when tx FIFO is half empty in order to stuff it with
I got also timer interrupts configured on compare match and it works.
However, if I configure SPI1 interrupts having higher priority than timer's ones
interrupts happen. Nevertheless SPI1's tx FIFO being emptied.
If I assign SPI1 to default vector, SPI1 generates interrupts, but...
RFF bit is always 1 regardless of the number of words I write to SSPDR.
MCU falls into SPI ISR and never exits from it.
The question is:
Is this a hardware bug or did I miss something?
MCU works as expected if timer0, I2C and UART0 interrupts enabled.
Compiler is not an issue - the binary code is fine (no inter-working , arm mode
None of unexpected interrupts happen.
Pull-up at SSEL1 does not make any difference.