Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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
1
vote
4answers
342 views

how long should an I2C slave wait for a STOP bit (if at all)?

I2C frames each group of message bytes in START and STOP conditions, defined as SDA changing state 1>0 or 0>1 (respectively) while SCL is high, as described here. I am writing interrupt driven ...
1
vote
1answer
154 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 ...
7
votes
2answers
1k views

Mutex in interrupts

For a small micro controller without an OS what is the proper way to share data between different interrupts and the main loop? With an OS one can just create a mutex for each critical part and carry ...
1
vote
1answer
6k views

How to receive bytes from SPI with interrupts using HAL on STM32?

Background I am trying to make a SPI connection between two STM32F103C8T6's. Measurements According to my logic analyzer I get a signal that looks ok (sending 10 bytes with values 0x55): Results ...
0
votes
1answer
50 views

Data storage interrupt when shorting the CAN bus

In the MPC5674 microcontroller, when creating a short circuit in the CAN bus, the controller is getting restarted repeatedly. The root cause of this reset has been found to be due to a 'data storage ...
0
votes
1answer
359 views

Atmega4809 Asynchronous USART doesn't trigger data register empty interrupt - iom4809.h error

TLDR ATmega4809, mis-labelled ISR in iom4809.h. How can I define an ISR without using these mis-labelled predefined values from iom4809? Using the ATmega4809 Xplained Pro eval board, I'm setting up ...
1
vote
1answer
109 views

Interrupt circuit

I'm using an 'Arduino like' board with a PIR sensor that gives 3.3V when movement is detected. The board usually stays in sleep mode, and wakes up when a LOW value is given to a specific pin. What'...
2
votes
0answers
77 views

nucleo-64 103rb EXTI stays pending

The PC13 EXTI interrupt (EXTI15_10) configured here keeps firing none stop. Most other questions about this same topic indicate that the respective EXTI_PR pending bit needs to be cleared in the ISR. ...
1
vote
0answers
197 views

MSP430G2553 Reading from ADC10 Temperature with Button ISR

This is my lab assignment. When I press the button, the red LED toggles on and off. But, I can't seem to read anything from it. Also, there's an empty loop in the code, but I don't know what to insert ...
1
vote
1answer
2k views

Remapping vector table in STM32F0 (no vector offset register)

I have written a bootloader before for a STM32 that had support for the vector offset and is easy peasy. For STM32F0xx using HAL I read I need to move the vector table to ram and copy from flash. I ...
0
votes
3answers
356 views

method to handle concurrent GPIO interrupt sources?

I have two GPIO interrupt sources running in two separate threads: GPIO pulses following line frequency(60 Hz) button press How can I use both these interrupts concurrently, considering my ...
0
votes
2answers
772 views

STM32 - more buttons pressed interrupt

I am using STM32L433CCT6 and I am programming it with eclipse and code genereted by STM32CubeMX. I would like to ask you, if is possible to add iterrupt that will be called, if i press two (or more) ...
0
votes
0answers
312 views

Interrupt on falling edge PIC16F877

The PIC is supplied at 3.3V and clocked at 16kHz. For this part of the design I need the external interrupt to trigger on the falling edge of a 100Hz square wave signal on RB0 and toggle the state of ...
0
votes
0answers
104 views

synchronised tasks and interrupts conflicts with filesystem

my program include timers (timer0 to call an ISR periodically, timer3 to measure execution time), spi to read (without DMA) and fatfs. I call a function each 250 µs periodically using timer0, this ...
1
vote
2answers
428 views

Interrupt Priorities- What does it actually mean?

I have one generic question regarding interrupts. My software has 2 interrupts,lets say interrupt_x (timer), interrupt_y(spi). Both interrupt has its own ISR. Interrupt_x has higher priority than ...
1
vote
1answer
292 views

Why is Atmega324pb pin change interrupt not firing even though input is changing?

For some reason my pin change interrupts are not triggered on my Atmega324PB. To test, I'm using an eval board and connecting an output pin to a pin configured to trigger a pin change interrupt. Is ...
1
vote
1answer
530 views

How to reliably update duty cycle to PWM on arduino due with SAM3XE

I have arduino due, which has Atmel SAM3XE MCU. I want to generate PWM signal and I want to change duty cycle every cycle of PWM reliably so i can generate output signal such as sine on output pin. ...
1
vote
3answers
302 views

Does using a software delay() function have greater power consumption than using a System Timer interrupt? [closed]

I had a discussion with someone about using a software delay(), and how it just executes NOP commands for a specified number of clock cycles according to your delay, and thus is constantly running and ...
1
vote
0answers
142 views

MCU wakes up from sleep periodically

I'm facing a weird behavior on SOME boards based upon CC3220SF. Scenario I have 20 units of my custom PCB, designed following the Design Reference Guidelines from Texas Instruments and - like they ...
0
votes
2answers
117 views

will For loop in MikroC for dspic block the interrupt service routine?

I am using MikroC for dspic30f4011. I am using a Timer3 interrupt for ADC reading. In this Interrupt services routine, I am reading ADC values. In Void main, where I need some delay in the instruction ...
0
votes
1answer
225 views

USART not entering ISR STM32F030C8

I'm working on UART using interrupts on Stm32F030 controller. I have done the following init. ...
1
vote
1answer
3k views

How to add external GPIO interrupts on STM32?

I'm trying to configure STM32CubeMx to external GPIO interrupts, however, in the NVIC screen I don't see an EXTI... interrupt to be set. What should I do to be able to e.g. check for interrupts on ...
-2
votes
1answer
74 views

Counting slow to fast in a microcontroller.(Ramp)

I want to make an increment(++) to a variable initially slowly then speed up linearly. For example, using a timer interrupt(every 1 sec) in increase the variable x by 1.so at first variable get ...
1
vote
1answer
940 views

STM32L031 Nucleo USART Problem

I have a problem with STM32L031 Nucleo board USART communication. I am trying to send data to PC on USART periodically and catch the spesific character ('a') with Rx interrupt and toggle the onboard ...
1
vote
2answers
2k views

USART interrupt not working as expected [STM32 Nucleo]

could someone explain why i can only receive 13 chars with USART interrupt? I use '\n' to detect the end of string. ...
1
vote
1answer
4k views

How to dynamically adjust a timer with STM32

I've got this timer (TIM4) that's in PWM mode. I'm outputting one PWM channel and i want to wait a bit, and then grab the latest ADC samples from a DMA conversion. TIM4 -> ARR is 4096 TIM4 -> CCR1 ...
1
vote
2answers
140 views

Embedded system task scheduling for data aquisition on a CAN network

I'm struggling with the concept of how to schedule my tasks. My Setup: STM32F103 hooked up on CAN. Taking measurements with a Lidar V3 module comms via I2C, then distributing that measurement on the ...
1
vote
1answer
141 views

How to reset / clear IRQ requests in AX5043

Has anyone gained experience with Onsemi's RF Transceiver AX5043?! I'm not able to clear the interrupt request Bits. For example my XTALREADY interrupt is fired immediately after reset and fired again ...
0
votes
1answer
47 views

Generate pulse when any of inputs changes

I have a microcontroller with only one pin left which supports external interrupts. It is supporting 3 encoders which outputs can generate either rising or falling edge. I would like to find the way ...
0
votes
2answers
391 views

Interrupt vector address in Program Counter?

Second image illustrates the process of interrupt service entry in ARM TM123GH6PM (using GPIO port C as an example), as you see, it took the vector address of port C handler and put it in PC (you can ...
1
vote
1answer
1k views

debounce filter vs glitch filter [closed]

What is the difference between debounce filter and glitch filter on a mcu? I'm trying to implement a hardware debounce filtering on a ATSAM4S4C (ATMEL SAM CORTEX-M4 - PAGE 575. http://ww1.microchip....
1
vote
1answer
491 views

AVR pin change interrupt

I want to turn on LEDs 0, 1 and 2 when pinc1, pinc2 and pinc3 are triggered. Also, I want to use a pin change interrupt. Problem: only LED 1 is on. This is my code and I am using atmega328p and ...
1
vote
0answers
155 views

Interrupt priority in STM32F103RB

I got a doubt about an interrupt grouping in stm32f103. In programming manual of microcontroller I found 5 ways to configure it. But, while debugging, I found 8 ways. How is it possible to get ...
0
votes
2answers
435 views

External Interrupt delayed to in STM31F103C8

I have to write a C program to toggle an LED using an external interrupt on STM32F103(72MHz System Clock). I have initialized EXTI3 on the Falling edge and the ISR Handler toggles an led at high ...
5
votes
1answer
949 views

Altera Cyclone V - Linux & FPGA interrupt handling

I need to propagate an interrupt from my custom FPGA IP core to the HPS system of a DE0_nano_SoC (Cyclone V HPS-FPGA architecture) and handle in Linux. I have googled quite a lot to confidently say ...
0
votes
1answer
203 views

why doesn't this code receive string ?(it just receive the first character)

I want to receive a string whit atmega8 that is sent by another atmega8. The sender send string just one time, but in receiver just first character is received. I can't understand what is the problem? ...
2
votes
2answers
215 views

Length of an interrupt

I know that an interrupt should be as short as possible, however, what is short? My routine is quite long, but has quite some if-statements, so the execution time is short. But maybe it still is ...
0
votes
2answers
2k views

Possibility for UART receive data loss?

In a lot of examples using STM32, HAL, where UART data is received by interrupt the code looks like: Initially (to start the receiving): ...
0
votes
1answer
93 views

Secondary linear lamp circuit interrupter switch

Following on from this answer to a previous question from a while back, I want to add a new lamp (with its own button/switch). The new lamp should be controlled separately (i.e. not controlled or ...
2
votes
1answer
2k views

On which core on a multi core CPU is the ISR called?

When a multi core CPU is interrupted, the PC will be changed to point to the corresponding entry in the interrupt vector at the next instruction fetch. On a CPU having more than one core (e.g. modern ...
1
vote
1answer
1k views

stm32f0 uart1 rx interrupt

I have stm32f030f4p6 Microcontroller and using iar Compiler , library cmsis , After confige Uart1 the RXNE , FE and CMF bits return 1 whereas not recieve or send was done if I dont set RXNE bit to 0 ...
0
votes
1answer
426 views

GPIO external interrupt on LPC1769

I am working on GPIO external interrupt on LPC1769 board and having problems getting it to work. I have connected pin 2.11 to a push button and interrupt must be generated when the button is pushed. ...
2
votes
2answers
267 views

ATtiny13A's timer appears to be very inaccurate, is it normal? [closed]

I wrote this blink program for my ATtiny13A and tried to measure the accuracy with an Arduino Uno but the timer seems to be quite inaccurate. On the ATtiny I am running on the ...
1
vote
1answer
102 views

Are there any ways to improve this ISR - STM32F401RE?

I am currently coding a flight controller from scratch and am currently working on the module to decode the incoming PPM signal. Keeping in mind that this is an ISR, I've limited its functionality ...
1
vote
1answer
36 views

External interrupts to MCU from ADV7511

I am having situation that when I connect my monitor with ADV7511, it triggers interrupt (when hot plug detect happens) but more than one time, so I done debouncing. Problem is when I am unplugging ...
2
votes
2answers
277 views

FatFs f_write not working in LPC1788 Timer ISR

I’m using LPC1788 MCU with KeilV5 compiler. I Have a Timer ISR in which I read a value form specific ADC channel and write it into a SD-Card using FATFS library. Here is my Timer ISR code: ...
0
votes
1answer
1k views

How to set two timers running at the same time in atmega328p?

I want to set up two timers running two ISR-s with different resolutions. One timer for counting milliseconds for clock time, another for counting microseconds when ...
0
votes
1answer
382 views

How to use two timers for one interrupt vector on avr?

I want to use timer1 and timer2 for same vector TIMER#_COMPA_vect isr on atmega328p. Idea is to start and stop one when requested, for time sensitive functions. And ...
0
votes
1answer
84 views

PIC capture interrupt not triggering at 0.65v

I connected pulse input to CCP1 pin( capture1 pin), maximum and minimum volt of pulse is 2.5v and 0.65v interrupt setted on falling edge problem is, interrupt not triggering at 0.65v but when I ...
2
votes
2answers
98 views

How to detect and measure a step change in resistance

I replaced my car stereo with a Raspberry Pi 3 and the 7" touch screen. Everything's working nicely, but now I want to hook up the volume control buttons on the steering wheel to the Pi. The buttons ...