A mechanism for the control of program flow in a computer. When interrupted a computer saves its present operational state and changes to executing code (interrupt handler) that is dependent upon which interrupt was generated. Interrupts can be either hardware- or software-sourced; software-sourced interrupts are called traps. It is an alternate mechanism to polling and is the basis around which most I/O, multitasking and control is implemented.
Questions tagged [interrupts]
832 questions
44
votes
4 answers
What does edge triggered and level triggered mean?
I am studying 8085 microprocessor architecture and the terms edge triggered and level triggered confusing me really very much. Can anyone explain me it in layman's words ?
While studying the interrupts of 8085 named RST 7.5, RST 6.5, RST 5.5 and…

ATR
- 1,213
- 2
- 11
- 9
22
votes
2 answers
Stm32 Event and interrupts
I started studying interrupts on stm32 specifically the stm32f4 discovery board. i found this example in which you have to press the button to start the interrupt and push it again to stop it.
In this line:EXTI_InitStructure.EXTI_Mode =…

ChiPlusPlus
- 419
- 1
- 3
- 12
19
votes
11 answers
Why should interrupts be short in a well configured system?
Why should interrupts be short?
I'm currently using STM32 and it has a feature of prioritizing interrupts.
Because of that, I don't see any difference between these two options:
the main loop and interrupts
one big interrupt with a very low…

oneat
- 581
- 2
- 6
- 11
19
votes
5 answers
How to implement critical sections on ARM Cortex A9
I am porting some legacy code from an ARM926 core to CortexA9. This code is baremetal and does not include an OS or standard libraries, all custom. I am having a failure that appears to be related to a race condition that should be prevented by…

CodePoet
- 407
- 3
- 7
18
votes
2 answers
Is SPI safe to be interrupted?
I'm writing to a microSD card from within my firmware, but it's the lowest priority task, so it can be interrupted by other tasks while it's in the middle of reading/writing.
Now suppose I communicated with this microSD card using a UART. The…

Maestro
- 979
- 1
- 10
- 24
18
votes
2 answers
Should all traps always be defined?
I've seen two cases now with dsPIC 30F4013 where the controller was resetting due to an undefined trap. Why these traps were getting raised in the first place is still a mystery, but that's not my immediate question. I'm starting to think it would…

Stephen Collings
- 17,373
- 17
- 92
- 180
17
votes
6 answers
Avoiding global variables when using interrupts in embedded systems
Is there a good way of implementing communication between an ISR and the rest of the program for an embedded system which avoids global variables?
It seems that the general pattern is to have a global variable which is shared between the ISR and…
user109324
15
votes
4 answers
AVR SEI instruction
The AVR SEI instruction (http://www.atmel.com/webdoc/avrassembler/avrassembler.wb_SEI.html)
waits for the next instruction to finish before enabling interrupts.
If I use another instruction to set the I flag in SREG, will this also wait 1…

jayjay
- 347
- 1
- 3
- 8
15
votes
6 answers
STM32: Timer interrupt works immediately
This is code for timer in my project on STM32F429:
//timer initialization
void timerInit()
{
uwPrescalerValue2 = (uint32_t) ((SystemCoreClock / 2) / 100000) - 1;
RS485Timer.Instance = TIM5;
RS485Timer.Init.Period = 67400000; // high value to…
user54506
14
votes
4 answers
How does the controller know when to jump to the ISR?
I am talking about things at the core level.
As far as I understand, the controller core just executes instructions which are fetched from the memory (Fetch - Decode - Execute). When an Interrupt arrives, how does the core/ALU decide to jump to the…

Swanand
- 3,245
- 5
- 28
- 45
13
votes
3 answers
What do the different interrupts in PCIe do? I referring to MSI, MSI-X and INTx
We have the following interrupts: MSI, MSI-X and INTx. What do these different type of interrupts do in PCIe? I only need a short description. I only know that in PCIe interrupts are generated as packets when they are to be asserted and also when…

quantum231
- 11,218
- 24
- 99
- 192
13
votes
3 answers
Clearing USART (UART) interrupt flags in an STM32?
I am using an STM32F105 to communicate with a Linx GPS chip using a UART.
If I don't use interrupts (if I just poll the RX flag) then it works just fine. But I'm getting unexpected results when trying to use interrupts.
For example, if I only…

bitsmack
- 16,747
- 9
- 52
- 108
12
votes
5 answers
What is the difference between Interrupt on Change and External Interrupt on PICs
What is the difference in function between IOC and EXT Interrupt on a PIC? I am currently using a PIC12F1822, and apart from the extra layer of checking you have to do with IOC (i.e. which pin caused the interrupt) the two are identical.
What is…

tsiflana
- 363
- 1
- 2
- 8
12
votes
3 answers
STM32F4 How are Preemption Priorities and Sub-Priorities used?
I have started working with ARM-based microcontrollers.
I not understand subpriority and preeemptionpriority. For example:
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x00;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x01;
Why…

ziyad
- 121
- 1
- 1
- 3
11
votes
10 answers
Is there a microcontroller with zero interrupt jitter?
I know that interrupt latency depends on what the CPU is doing when the interrupt takes place (arm interrupt latency guide). This effect is called interrupt jitter. For my application I need an MCU with fixed interrupt latency (zero interrupt…

Andrey Rogatkin
- 111
- 1
- 5