Questions tagged [interrupts]

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.

Filter by
Sorted by
Tagged with
1 vote
0 answers
54 views

Why is my MCU detecting false interrupts and having its EEPROM data erased?

I am currently working on a device that includes a pressure sensor, an LCD, a DC motor, three solenoid valves, an 11.1V battery, and a membrane keypad used to control its function. The device is ...
0 votes
1 answer
25 views

How can I use interrupts for more than 3 push buttons with EXTI line 4 to 15 interrupts?

I would like to make a spot welding device with pulse current from 0.02 to 10 s. For prototyping I'm using 3 push buttons; one to initiate the welding process and two for current control (current+ ...
0 votes
1 answer
71 views

Which kinds of embedded platforms can be considered well-suited for acquiring a general taste of interrupts? [closed]

I'm an application programmer without much knowledge in low-level programming. I've set up a basic toolchain for assembly programming with the ATMega328P on an Arduino Uno R3 board. One of my aims is ...
  • 135
1 vote
3 answers
77 views

Troubleshooting a rare glitch in a microcontroller timer ISR

I'm using an Atmel ATtiny85 microcontroller to implement a PID controller for a temperature regulation application. I have configured Timer1 to be a simple PWM generator using the following code: <...
  • 268
0 votes
0 answers
15 views

EPWM ISR taking to long in F280049C

A problem has been boggling me for a couple of days, for which I need your help. I use SYSGONFIG Tool to initialize and program my ePWMs for a 3-phase DAB converter. I have enabled an extra epwm7A on ...
0 votes
1 answer
33 views

What's a good name for change detector initialisation? [closed]

Hi I'm trying to come up with a name for when a change in input is detected and an interrupt is issued due to that. So I want to "trap" a change in an input, but a trap already means a ...
2 votes
2 answers
100 views

How do I measure a pulse width using the ATmega328P interrupts and timers?

I am using an ATmega328P MCU with an 8 MHz internal oscillator. I need to measure the pulse width of an incoming pulse. The frequency of this pulse is approximately 500 Hz. Once every 2 ms, one pulse ...
0 votes
1 answer
88 views

Reading data with ADXL345 only when new data arrives

I am using ADXL345 with Uno and ESP32. I am using ADXL345 with 50 Hz like this : ...
3 votes
0 answers
48 views

Any way to have MSP430 wake from sleep and immediately start executing the next instruction after the sleep, avoiding calling into the ISR?

I am executing a simple state machine that steps based on a pin change and sleeps between steps. A significant amount of time is spent in the overhead overhead of calling the ISR on each pin change, ...
  • 9,748
2 votes
2 answers
75 views

How can I change ARR/CCRx register in ISR correctly?

I have strange behavior of timers. I'm using a Blue Pill with a STM32F103 chip with the HAL lib. My case: I set up TIM2 to input capture mode to count impulses, then I store it in a global structure ...
  • 33
0 votes
1 answer
250 views

ADC Multiple Channel without using DMA

below i give my code. here i using 2 ADC Channel and i getting first ADC channel value only. i need to read both ADC channel value. ...
5 votes
1 answer
129 views

Why does my ATmega crash when a function is present (not called) inside an interrupt?

This is strange behavior and I am very curious. It's a fairly large project, but basically this section of code is designed to quickly save all of the user settings on power down. There's plenty of ...
1 vote
1 answer
53 views

Poll for button input while sleeping - PIC microcontroller

I'm working on a wall control project that runs on a battery. Therefore, I want the system to be in sleep mode while there is no user input. I'm using a PIC18F45Q43 which has 3 external interrupts, ...
  • 11
-3 votes
1 answer
106 views

Why do we need an interrupts when using a battery charger? [closed]

I am analysing a circuit, containing a battery charger. In the schematic, it says that our battery charger sometimes performs an interrupt on the microcontroller. What is the reason? UPDATE The ...
1 vote
1 answer
50 views

What is preferred way to have an interrupt every second - setting timecmp to timecmp+1000 or time+1000

me and friend were discussing what the most accurate way have an timer interrupt happen every second in RISC-V. We understand that the internal clock is generally inaccurate, but were still wondering ...
0 votes
1 answer
62 views

LSM6DSOX IMU sensor: interrupts necessary?

I have a question about the interrupt pin of the LSM6DSOX IMU. Can the interrupt pin be used to send an interrupt signal to my microcontroller to notify me when the sensor is detecting a change in ...
  • 71
0 votes
4 answers
217 views

Confusion about edge/level triggering interrupt

I have read this answer. My understanding is, there are actually 2 lines logically: clock/gating line event/interrupt line And the clock/gating line can make the circuit take event input at an ...
0 votes
1 answer
31 views

Configuration of the Interrupt Signal

I'm using this IC- LAN9500A and want to know how to use pin 1, nPHY_INT. I'm using internal PHY and want to generate output on this pin 1 (interrupt output) Can someone tell me how to configure it? Is ...
  • 3,883
0 votes
1 answer
57 views

AVR32 goes to unrecoverable exception when exiting interrupt routine

I'm using an ATUC128D3 microcontroller and have 5 switches connected to it. I have the GPIO interrupt configured to trigger on a falling edge and this works just fine. It enters the interrupt and the ...
0 votes
2 answers
80 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,465
2 votes
1 answer
52 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
117 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: "...
  • 671
5 votes
1 answer
374 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 ...
  • 671
0 votes
1 answer
98 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
567 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 ...
  • 307
0 votes
0 answers
29 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
102 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
2 answers
145 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 ...
  • 883
0 votes
0 answers
33 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
51 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
165 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,772
0 votes
2 answers
165 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: ...
  • 852
2 votes
3 answers
282 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, ...
  • 250
0 votes
0 answers
121 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
187 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
127 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
559 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
47 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
158 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
219 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
251 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
107 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
115 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
47 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
286 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
103 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
587 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
209 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
3 votes
0 answers
428 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,438
0 votes
1 answer
421 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 ...

1
2 3 4 5
17