Questions tagged [interrupts]

A mechanism for the control of program flow in a computer. When interrupted a computer saves it's present operational state and changes to execution of code that is dependent upon which interrupt was generated. Interrupts can be either hardware-sourced 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.

Filter by
Sorted by
Tagged with
8
votes
6answers
1k views

Differences between Interrupts and sampling for hardware button?

I have a hardware button I connected to an interrupt, but my problem is it bounces a bit, making the button press unreliable. I think a good deal of these issues would be solved by sampling in the ...
35
votes
4answers
124k views

What does edge triggered and level triggered mean?

I am studying 8085 microprocessor architecture and the word edge triggered and level triggered confusing me really very much. Can anyone explain me it in layman's words ? While studying the ...
8
votes
1answer
5k views

Bug in Keil ARM compiler with interrupt handlers and C++?

I have a problem with writing interrupt handlers in Keil ARM compiler for LPC1114. When I write program in C++ and specify --cpp compiler option all code from interrupt handlers disappears, it is ...
8
votes
2answers
7k views

AVR interrupt service routine not executing as fast as expected (instruction overhead?)

I'm developing a small logic analyzer with 7 inputs. My target device is an ATmega168 with a 20MHz clock rate. To detect logic changes I use pin change interrupts. ...
17
votes
1answer
29k views

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 ...
12
votes
4answers
2k views

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 ...
3
votes
1answer
2k views

Clearing Flag Bits By Writing 1

Most of the interface devices have various flag bits (that can also raise interrupts if that functionality is provided) used to check the status of the device/operation. Usually they are cleared by ...
3
votes
2answers
6k views

Use PWM and ISR at same time on AVR

Is it possible to use AVR PWM outputs and ISR interrupts at the same time? I've got a project I'm trying to do on an ATMega328P and I need 3 PWM outputs but ALSO need to be able to use ISR interrupts ...
9
votes
4answers
34k views

How do I create a timer interrupt with Arduino?

I am trying to create a time delay interrupt with Arduino. I would like to use the interrupts() function, because it is an internal interrupt. Example: Let's say, I would like to make a light blink ...
7
votes
3answers
14k views

What's the actual difference between Edge sensitive and Level sensitive interrupts

Currently I'm working on a C8051F120 MCU where External Interrupts can be defined in two ways: Edge sensitive (Falling) Level sensitive (low-level) In level-sensitive interrupts as soon as the MCU ...
15
votes
4answers
6k views

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 ...
9
votes
3answers
19k views

How are interrupt handlers implemented in CMSIS of Cortex M0?

I have a LPC1114 kit. Last few days I have been digging up CMSIS implementation of Cortex M0 to find how things are done in it. So far I understood how each registers are mapped and how I can access ...
7
votes
2answers
5k views

What's the difference between setting SysTick Interrupt in NVIC and using it as an exception?

I'm using an STM32F303 MCU and I've noticed that the SysTick can be set up to cause an exception, which seems to mentioned quite often in various User Guides. This way, it will have a priority level ...
6
votes
1answer
6k views

Handling timer overflow and compare interrupts in ATMega328 (Arduino)

I'm trying to simulate PMW mode on multiple pins in software by controlling a Timer2. I'm using maximum prescaler value to get approximately 60 pulses per second when timer counts to its maximum ...
6
votes
1answer
18k views

STM32 Interrupt Priority (preemption) Problems

I have another problem (High resolution system timer in STM32) which I have tracked down (mostly) to this issue, and have created a test case here for the simplest STM32 processor I could find (on the ...
3
votes
1answer
13k views

STM32 Rotary Encoder with Hardware Interrupts

I'm trying to get a rotary encoder working on my STM32. I have channel A & B being pulled up to 3V and debounced with 1uF capacitors. The board has channel A & B connected to PA11 & PA10 ...
1
vote
3answers
936 views

Interrupt being called before complete execution of ISR

What happens when an interrupt is called again before the execution of the ISR is completed?
11
votes
6answers
6k views

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 ...
7
votes
2answers
12k views

STM32F7 gets stuck in external interrupt callback function

i am working on a project to connect a camera to an STM32F7 Discovery board using the DCMI interface. The camera part works fine, but i have a strange problem with external interrupts from the ...
6
votes
1answer
2k views

How is this Pushbutton Debounce code?

I am monitoring a pushbutton with a microcontroller where I am trying to take care of four things together: 50-msec debounce upon push-begin and 25-msec debounce upon push-release identify a short-...
5
votes
1answer
4k views

PORTB Interrupt On Change changes state unintentionally

I am running below code in a PIC16F887 that runs at 20 MHz. I feed PORTB.0 a signal of 1 KHz from my signal generator. However, whenever the signal is low, ...
4
votes
2answers
1k views

Moving the code and interrupt locations in Arduino

I need to be able to choose between two Arduino apps running on an atmega 1280 (megaavr) at boot time. Therefore I need to move one of those apps to a different location in program memory, and I need ...
4
votes
4answers
2k views

Implementing an I2C buffer in C

I'm implementing a read-only I2C slave on a PIC18F4620. I have made a -working- ISR handler for the MSSP module: ...
4
votes
4answers
6k views

Level vs edge triggering, usefulness of level triggering

Many processors / µCs / dev-platforms (BeagleBoard, Arduino,...) use interrupts. These can be triggered by the detection of: HIGH level RISING edge CHANGING level (either FALLING or RISING edge) ...
2
votes
2answers
704 views

Serial Communication Rx ISR logic design

If im not wrong, an ISR is supposed to do minimal processing when it receives a data serially(via UART). Im planning on implementing such a protocol for communication between 2 systems via uart. This ...
1
vote
1answer
121 views

Latching battery switch triggered by interrupts

I've got an accelerometer with a couple interrupt pins and I've figured out how to get it to fire its interrupts on any change in acceleration or lack thereof for a given duration. What I want to do ...
1
vote
2answers
2k views

Determine input frequency of square wave w/ ICR in Atmega328p

I'm trying to obtain the input frequency of a square wave using the input capture register of an Atmega328p. So far, it works sporadically -- which is to say, when I input a 75 kHz square wave, the ...
4
votes
1answer
2k views

Cortex-M0 interrupt nesting

Question 1: When one interrupt handler is executed, will it be interrupted if another interrupt with the same priority occurs? Question 2: When one interrupt handler is executed, will it be ...
2
votes
0answers
4k views

ESP8266 Wake from deep sleep with an interrupt

I have an ESP8266, and a MCP23008 I2C GPIO expander. The GPIO expander has the ability to trigger an interrupt when a pin changes - this is handy, as it means we can do something when an input pin ...
1
vote
1answer
407 views

Can't get AVR pin change interrupt to work

I'm trying to get a pin change interrupt on an Attiny2313 to work but i'm stuck, the interrupt is not triggering. I'm using the following code in main(): ...
1
vote
1answer
4k views

Inverting interrupt edge (STM32 wake up pin)

A sleeping STM32 can be woken up by a rising edge on its wake up pin. But if the IC on the other end of the line only interrupts as falling edge, is it possible to invert it somehow ?
1
vote
1answer
6k views

PIC32 does not get UART RX interrupts in xc32 Compiler

I'm trying to setup a UART channel on my PIC32 MCU (PIC32MX470F512). But the code does not reach the ISR at all. I have verified that the PPS (peripheral pin select) is configured properly and the ...
1
vote
1answer
160 views

Is it the right use of the RTC RV8523 to wake up an atmega328p?

I'm using the RV8523 to wake up every 2 minutes an arduino atmega328p. The rtc is wired like this : Where INT1 is wired to Port D pin 3. The internal pull up resistor is activated and yet it's ...
1
vote
1answer
133 views

5V Tolerant Way To Generate Rising Edge Signal on USB Connection

I have a microcontroller device that can be awakened from deep sleep mode when it detects a rising edge signal on a wakeup pin. The wakeup pin is 5V tolerant and I'd like a connection to a USB port to ...
1
vote
3answers
2k views

Dimming multiplexed LEDs

I'm multiplexing 32 LEDs in a 4:8 configuration on an ATMega328 and am trying to dim them with what is probably a completely naive understanding of PWM. Note: I'm multiplexing them directly with 12 ...
1
vote
3answers
9k views

STM32F031K6 HAL UART Interrupts problem

I got a new STM32F0 31 K6 nucleo board and I need to make a GSM UART interface on that board. I need to send an AT and receive an OK from the GSM board as a first step.I am able to transmit AT ...
0
votes
2answers
8k views

PIC: Global variable not modified inside interrupt handler

I have an interrupt handler for my PIC 16 that should modify a global variable. The global variable is then read by main() in an infinite loop. For some reason, it ...
0
votes
3answers
97 views

Really occasional malfunction of the Schmitt-trigger input

I'm using some Schmitt-trigger inputs for debouncing the interrupt problems. Referring to above circuit, the circuit has a RC circuit and the output of the RC circuit goes to the Schmitt-trigger IC(...
0
votes
2answers
803 views

Role of the MMU in a Page Fault Swap

When a virtual memory address outside the range of loaded into physical RAM is referenced and a page fault occurs, does the Memory Management Unit rely on DMA (Direct Memory Access) to swap the ...
0
votes
1answer
280 views

How to generate UART interrupt for GPIOs?

I am using PIC32 and I have few inputs. I want a UART Tx Interrupt to fire whenever any input becomes HIGH. I have somehow manged to write code for UART tx and rx ...
0
votes
1answer
53 views

Why is the the uart_rx _interrupt is not triggering on a PIC32MX775F256H?

void __ISR(_UART1_VECTOR, ipl6) IntUart1Handler(void) { if(!INTGetFlag(INT_U1RX)) { g_intraised++; } IFS0bits.U1RXIF=0; } uart ...
-3
votes
2answers
426 views

Edge detection circuit (for rotary encoder)

I managed to decode a rotary encoder using an arduino to read the input signal but I noticed other than the interrupts, the code is mainly made up of lines similar to: "IF this AND that OR that AND ...