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
0 votes
2 answers
50 views

How to make the microcontroller respond/compare I2C data faster in this case?

I measure the current via an I2C current sensor by using this STM32F302 Nucleo board. And I display internal temperature and the averaged current value in an OLED display. But I do everything in ...
  • 1,303
0 votes
1 answer
21 views

Triggering ADC conversions with a timer on the MSP430FR5969

I am trying to repeatedly sample one channel from the ADC on my MSP430FR5969 using timer TA0. Unfortunately, the timer doesn't appear to be causing conversions. I expect my issue lies in my ...
1 vote
1 answer
82 views

Exception vs interrupt for Cortex-M chip

I'm not sure how to use the terms "exception" and "interrupt" correctly. In the book Embedded Systems with ARM Cortex-M Microcontrollers in Assembly Language and C it says: "...
  • 591
5 votes
1 answer
171 views

Why is HAL_GetTick not protected by a CRITICAL SECTION?

I'm trying to better understand atomicity in embedded systems. While researching the topic, I encountered this problem: In the STM32 HAL, the system tick is provided by ...
  • 591
0 votes
1 answer
58 views

ATMega328p with SSD1306 and DHT22, help in code

Hi I am trying to make a project that uses DHT22 (Temperature & Humidity Sensor) and SSD1306 (OLED Display) with the ATMega328p. I want the OLED Display to be normally off and should turn on for 5 ...
  • 121
7 votes
1 answer
495 views

Program never goes into interrupt

I used to work with C but I am trying to learn using C++ for embedded programming. I want to do a basic GPIO interrupt example to understand the structure of a class and its usage. My microcontroller ...
  • 187
0 votes
0 answers
28 views

Atomicity of gic-D MMIO writes

MMIO-writing to the GICD_ISPENDR bit can set the pending bit for 32 IRQs. Does the setting of all the 32 pending bits happen logically atomically, meaning, if any other core is concurrently MMIO-...
0 votes
0 answers
89 views

External interrupt falsely gets triggered when another device switches on/off on power grid

I'm building a DIY Power Amp where I integrated an STM32F407 on this board to control the amp via Ethernet. The amp also has a momentary push button switch (E-Switch PV6 anti-vandal switch) that turns ...
3 votes
1 answer
52 views

STM32 Interrupt large latency

I am writing an STM32F303 application to digitize pulse signal amplitudes. There will be a peak detector, that can be reset by the uC pin, so I'm not expecting the uC to instantly digitize as soon as ...
  • 813
0 votes
0 answers
31 views

Measure acceleration for X mins

I have a situation where I have to check if a body is motion or not for x minutes. If it is in motion for x minuteds then the function should return true, else it should return false. I have an ...
  • 1
0 votes
0 answers
29 views

PIC32MK1024MCM064 UART receive interrupt is not working

I wrote an experimental UART program which does following: I send a character from a PC keyboard via USB <-> UART converter to my MCU and the PIC sends that character back to get it depicted on ...
0 votes
2 answers
59 views

Timer Interrupt not working as expected on ATMEGA808/1608

After countless of tries, I still didn't figure, why I cant get it to work... I'm using an ATMEGA1608 (Datasheet) with the following code. Pin D6 has a LED connected. ...
  • 1,742
0 votes
2 answers
47 views

Why does attachInterrupt() not run even though my interrupt pin is changing from LOW to HIGH / HIGH to LOW?

I have an arduino uno and I am running this code here: ...
  • 578
2 votes
3 answers
204 views

Arduino Uno prescaler, not measuring what I expected

I'm using the following code to set a pin high or low (each cycle.) I measure that pin with a logic analyzer. I use an Arduino Uno with 16MHz frequency. I set a timer interrupt with a prescaler of 64, ...
  • 206
0 votes
0 answers
61 views

How to calculate the revolutions of BLDC motor?

A brushless DC motor is rotating at 5000 rpm and is fitted with 3 hall effect sensors. The microcontroller interfaced with the brushless motor has a clock speed of 2 KHz and is configured to trigger ...
0 votes
0 answers
95 views

Teensy read two encoders simultaneously

I am trying to read two Quadrature encoders at exactly the same time. They are 4000CPR encoders, and they will be spinning between 10 to 60 RPM. The two encoders are mechanically paired to the same ...
1 vote
2 answers
89 views

Keil C & 8051: DC Motor Speed Control & Display [closed]

I am writing a program to control three DC motor levels and display speed (RPM) on a 7-segment LED display using an 8051. I use an external interrupt to read pulse from encoder. When compiling, the ...
  • 13
1 vote
1 answer
305 views

STM32: USART interrupt triggered with no flags

I am using USART1 on STM32L051 with interrupts for serial communication. I start my program by sending 5 bytes from MCU to PC, which works fine, but then a USART interrupt gets triggered with only TXE ...
0 votes
0 answers
23 views

Stm32CubeIDE ADC interrupt code generation

I configured the ADC interrupt and its priority in the Stm32CubeIDE configuration pannel but the autogenerated code does not mention them at all, other than others configuration e.g. ...
  • 1
2 votes
1 answer
89 views

MCP23017 open drain interrupts not working as expected

I have multiple MCP23017 ICs with their interrupts all connected in serial. The interrupt pins are configured to be open-drain. All the A port interrupt pins are connected together and all the B port ...
  • 23
1 vote
1 answer
118 views

Simple AVR interrupts in C - How to cleanly stop and restart "INT0"?

I'm trying to use an ATTiny84's INT0 pin to detect a falling edge event on a 1 kHz signal. What is the correct way to temporarily halt this interrupt INT0, and then resuming it at a later time, ...
1 vote
0 answers
123 views

STM32L562 interrupts not working

I'm programming an STM32L562 (self made PCB), and when i try to init a TIM16 interrupt, HAL_TIM_Base_Start_IT(&htim16); using this function, it get stuck at ...
  • 11
0 votes
0 answers
83 views

Do PCI Express devices' interrupts always go through a PIC or an APIC?

My Question is PCI/PCIe interrupt path to CPU is through a PIC or an APIC? https://people.freebsd.org/~jhb/papers/bsdcan/2007/...
  • 93
1 vote
0 answers
93 views

Does the external hardware interrupt affect both cores in ESP32?

I am working on a project, where I am implementing FreeRTOS on an ESP32 DEVKIT-V1 module. One core is specifically dedicated to reading high precision rotary encoders. I am reading the number of ...
  • 83
0 votes
0 answers
33 views

Determine BRK Input State or Generating Interrupt on BRK in STM32G0 Timer 1 (STMCUBE IDE, HAL)

I am using an external BRK input for TIM1. I want to count how many BRK events occurred. I have tried callbacks unsuccessfully. Maybe I am not able to understand how to apply them. Tried reading HAL ...
0 votes
2 answers
87 views

How can I handle Overrun and Framing errors in UART transmissions on PIC16 devices?

I am transmitting and receiving data over UART between two PIC16 devices using interrupts, but at random times, one of them seems to block its receiver and it stays stuck in that position permanently. ...
  • 65
-1 votes
3 answers
95 views

Simple circuit to sample 120 VAC and yield 8.33 ms pulses

Have you noticed the lack of availability and prices of RTC chips lately? A simple DS1307 RTC is simply not available right now. Last year I purchased DS1307s for less than a buck. Now they are $4+ ...
  • 319
-1 votes
2 answers
323 views

STM32: How can i poll a GPIO pin until 100ms using timer interrupt?

I am currently use nucleo-board and I try to poll a pin until 100ms. I activated timer interrupt. So basically if pin is not high (digital '1') until 100ms the function must returns false. I share my ...
2 votes
4 answers
164 views

Interrupts in microprocessors

This might be a very trivial question, but I was unable to find a concise answer to it. For non maskable interrupts, are the interrupts handled immediately while the current instruction is getting ...
  • 31
2 votes
0 answers
283 views

STM32 Software Interrupt Trigger Any

STM32F746-Disco Windows 10 STM32CubeIDE 1.8.0 I've just finished writing my first minimal bare metal UART DMA driver (CMSIS only), and both reception and transmission work ok, but then I thought I ...
  • 3,348
0 votes
1 answer
250 views

PIC18 UART interrupt priority problems

I am completely new to microcontroller programing. Just started my journey with PIC18F24K22 and now I am on the UART interrupt stage. I have been reading the datasheet meticulously and it really took ...
2 votes
1 answer
533 views

Why to clear the interrupt flag before the user callback function?

In a tutorial, regarding the following IRQ Handler function: ...
  • 1,275
1 vote
1 answer
298 views

STM32 USART Does Interrupt Trigger if TXE was set before TXEIE

STM32F746 Disco, STM32CubeIDE 1.7.0, Win 10, CMSIS-only, C language, on registers. I'm writing a UART transmit driver on interrupts (load data into buffer array, automatically fetch it from there with ...
  • 3,348
1 vote
0 answers
74 views

Cannot access array after coming back from a function which execute with Interrupts STM32 Cube IDE

Hi I am using STM32 Cube IDE to Program Neucleo F746zg board. In my code there is a function to check if the elements of an array is equal to some value and if it is I execute some Functions. I first ...
1 vote
1 answer
138 views

Change Notification Interrupts PIC32

I am attempting to code a program in the PIC32 where pressing S1 button lights up the LED and releasing it would turn it off, LED2 is also blinking - using interrupts. The pressing and releasing works,...
-1 votes
3 answers
281 views

How to read multiple quadrature encoders using an Arduino

I am developing a 4-wheel mobile robot. Each motor has a quadrature encoder with 2000 pulses per revolution (PPR). I have tried to read the encoders' pulses using an interrupt, but the counted values ...
8 votes
1 answer
498 views

Writing bytes to internal flash memory blocks all interrupts on the STM32L0 despite moving the vector table and ISR functions to RAM

The Context I have a embedded system running on an STM32L053 processor that needs to process STM32 hardware timer interrupts regularly and cannot be disabled. These top-priority interrupts cannot be ...
  • 347
1 vote
1 answer
98 views

PIC18, XC8 compiler, enable multiple interupts

I am trying to make a module that needs to communicate over USART module, and also, do some tasks on a timer basis. (1ms / 30sec / 2 minutes) Now I need to enable USART interrupt and enable a 1ms ...
0 votes
2 answers
177 views

Why is my interrupt so slow/inconsistent? Arduino external interrupt as pedestrian crossing button

So this is the setup; It's a traffic light system with 2 road lights and a pedestrian crossing. The normal sequence is alternating between main road green and secondary road green. It reads these ...
0 votes
0 answers
213 views

Spi in interrupt mode for transmission and reception in PIC microcontroller

I am using spi in pic16f877a, for m95320 eeprom. Using interrupt for communication, Everything is working fine. However I have to tweak something which is confusing me, of using interrupt. ...
  • 238
0 votes
2 answers
88 views

Transmission interrupt in PIC18F46K80

I'm using a PIC18F46K80 and have been trying to send data to the computer using USART module (simulating in Proteus). This is my code: ...
  • 120
0 votes
1 answer
37 views

How decide which pin right for interrupts?

I would like to ask about I2C sensor's interrupt pins connection to STM32F. I use ADXL345 Ggyro sensor. I would like to connect sensor to STM32F446RE (64 LQFP). But I do not know what I need to know ...
  • 89
1 vote
0 answers
259 views

STM8: How to make External Interrupt Handler firing only once

I have a external interrupt handler which is tied to a button which will be fired upon pressed. ...
0 votes
1 answer
125 views

Faster Timer0 overflow than 2 ms on Attiny85

I'm trying to get a Timer0 overflow with an overflow every 500us, but can't find a solution to get it so low. I'm running the Attiny85 on its internal 1 MHz clock, so I know it is not gonna be the ...
  • 309
2 votes
1 answer
137 views

PL011 clear interrupt when interrupt condition is true

PL011 seems to have a level triggered interrupt system, meaning, when certain criteria (e.g. enough space in TX buffer) is true, the interrupt line will be asserted. It is confusing how this interacts ...
1 vote
0 answers
68 views

PIC Microcontroller C program Problem.[Sequential Issue and PWM Problem]

I have just started coding PIC microcontroller in C and do not understand where the problem is. PIC10F320 is chosen for its two PWM pins, one for breathing effect on LED and the other one for 75% duty ...
  • 13
2 votes
2 answers
142 views

8051 interrupt within interrupt high vs low priority

I am learning and experimenting on the 8051 (AT89C51). From what I have learnt so far regarding interrupts, I understand that an interrupt with a higher priority can interrupt an interrupt with a ...
  • 49
0 votes
0 answers
2k views

How to receive UART0 data using UART0 Received interrupt in ESP32 with Arduino IDE code

I want to receive UART0 data of ESP32 using UART0 Received Interrupt using Arduino IDE. There have arduino Library to receive UART data like: ...
-1 votes
2 answers
380 views

How does programmed IO vs interrupt driven IO work? [closed]

I know how programmed IO and interrupt driven IO work but I am confused if I am right about their working or not: This is the flowchart given in this site: https://slideplayer.com/slide/265620/ I used ...
  • 23
0 votes
1 answer
234 views

MSP430 UART Trouble

I'm trying to learn how to use UART on a MSP430G2553 and I wrote this simple program. The program should set up a timer interrupt to happen once a second. The interrupt service routine should toggle a ...
  • 31

1
2 3 4 5
16