Interrupt Question

In a interrupt handler , why some other interrupt routine does not work? For example,in the spi (serial port2 for spi) interrupt handler, the printf function doesn’t work. the serial port 1 act as the dialog port. I am using a mcu to convert spi to canbus .In the canbus interrupt handler,the spi doesn’t work. The spi works in the interrupt mode rather than polling mode. And the spi int priority is higher than the can int priority. In interrupt handler, I can’t use other interrupt? Can you give me some source demo for custom interrupt, such as the ns7520 portc[3:0] as interrupt source .

Arm architecture… when an interrupt occurs and you enter the main interrupt handler further interrupts are disabled at the core until you exit interrupt mode… the interrupt channel status bits at the Netsilicon ASIC will probably get set for any new interrupts occurring during the current interrupt cycle… However, these new interrupts will probably not get processed in the current interrupt cycle… Regards, Dave

Is that mean than I can’t use spi as interrupt mode . Because I want to process spi in another interrupt handler. Is there other means for this problem?

Why isn’t your main task doing the processing?.. Your interrupt handlers should be doing very minimal processing… Unloading /loading FIFOs setting flags etc. For example… 1) Your RX interrupt handler for the UART unloads the RX FIFO into a buffer and flags that data is available… and then exits. 2) Your main program task checks this flag (with interrupt protection around the checking code) to see if RX data is available in the buffer, processes the data and sends it to the interrupt driven TX handler for the other UART if it isn’t busy… 3) Similarly for RX /TX in the other direction. If your main task gets called at a sufficiently regular interval then you will get better results than doing a comms translation at interrupt time. Regards Dave