Nested interrupt

Hi

Im using a timer to generate interrupt based on the match registers. On one of those interrupt, I would like to start a SPI data transfer. The SPI transfer is also using vector based interrupt (for sending 3 bytes).
But (of cause) the SPI interrupt doesnt work from within another VIC interrupt, so I guess I have to use nested interrupts??
Im looking at the nested interrupt sample from KEIL.
I guess I have todo the following:

timer_ISR
  IENABLE
  Start SPI transfer
  Do something else
  Ack the interrupt


SPI_ISR
  Send byte1
  Send byte2
  Send byte3
  IDISABLE
  Ack the interrupt


Is this the right approach?

Using af LPC2103 ARM7

/Thomas

Parents
  • There is no problem starting an SPI transfer from your interrupt handler - no need for nested interrupts for that.

    Nested interrupts is just if you want one interrupt handler to be able to interrupt another interrupt handler.

    If you need to service the SPI interrupt before leaving the timer interrupt, or if you need to service the timer interrupt before ending the SPI interrupt.

    But both SPI and timer interrupts should normally (as almost all interrupts) be very short and quick, in which case you can run the two interrupts after each other - something the processor will manage by itself.

Reply
  • There is no problem starting an SPI transfer from your interrupt handler - no need for nested interrupts for that.

    Nested interrupts is just if you want one interrupt handler to be able to interrupt another interrupt handler.

    If you need to service the SPI interrupt before leaving the timer interrupt, or if you need to service the timer interrupt before ending the SPI interrupt.

    But both SPI and timer interrupts should normally (as almost all interrupts) be very short and quick, in which case you can run the two interrupts after each other - something the processor will manage by itself.

Children
More questions in this forum