Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Interrupts problem

Status
Not open for further replies.

electroRF

Member
Hi folks
I'd appreciate your kind support.

I'm running several DMA channels, sometimes on parallel.

Inside the ISR, at its beginning, I read the DMA Interrupts Register to know which channel has interrupted, then clear the HW Interrupt Source, which is connected from the uC to the DMA, and then treat the interrupting channel accordingly.

However, there was a special case where while I treated Channel A inside the ISR, another Channel, B, has interrupted, but since I already read the DMA Interrupts Register before Channel B's interrupt occurred, I did not treat Channel's B interrupt when I left the ISR.

Of course, I could re-read the DMA Interrupts Register at the end as well, however, there could still be a case where just after re-read it, another channel interrupts.

How then could I treat this special case?

Thank you.
 
Without knowing exactly what processor you are using it is hard to say, but as a general rule each DMA device should have its own interrupt flag (you say "several DMA channels...in parallel" you don't mean they are sharing interrupts do you?).

You should be able to check the flags at the start of the ISR, clear just that flag and perform the necessary tasks. If you return from the interrupt when a flag is still set, it should generate another interrupt.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top