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
2 votes
3 answers
175 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, ...
user avatar
  • 206
0 votes
0 answers
32 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 ...
user avatar
0 votes
0 answers
53 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 ...
user avatar
0 votes
2 answers
73 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 ...
user avatar
  • 3
1 vote
1 answer
89 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 ...
user avatar
0 votes
0 answers
15 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. ...
user avatar
  • 1
2 votes
1 answer
47 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 ...
user avatar
  • 23
1 vote
1 answer
81 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, ...
user avatar
1 vote
0 answers
57 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 ...
user avatar
  • 11
0 votes
0 answers
56 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/...
user avatar
  • 83
1 vote
0 answers
61 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 ...
user avatar
  • 83
0 votes
0 answers
20 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 ...
user avatar
0 votes
2 answers
63 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. ...
user avatar
  • 65
-1 votes
3 answers
91 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+ ...
user avatar
  • 319
-1 votes
2 answers
182 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 ...
user avatar
2 votes
4 answers
150 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 ...
user avatar
  • 31
2 votes
0 answers
163 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 ...
user avatar
  • 3,328
0 votes
1 answer
126 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 ...
user avatar
2 votes
1 answer
299 views

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

In a tutorial, regarding the following IRQ Handler function: ...
user avatar
  • 1,265
1 vote
1 answer
172 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 ...
user avatar
  • 3,328
1 vote
0 answers
59 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 ...
user avatar
1 vote
1 answer
95 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,...
user avatar
-1 votes
3 answers
204 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 ...
user avatar
8 votes
1 answer
317 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 ...
user avatar
  • 347
1 vote
1 answer
61 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 ...
user avatar
0 votes
2 answers
159 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 ...
user avatar
0 votes
0 answers
135 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. ...
user avatar
  • 229
0 votes
2 answers
84 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: ...
user avatar
  • 120
0 votes
1 answer
35 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 ...
user avatar
  • 89
1 vote
0 answers
183 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. ...
user avatar
0 votes
1 answer
111 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 ...
user avatar
  • 309
2 votes
1 answer
115 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 ...
user avatar
1 vote
0 answers
61 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 ...
user avatar
  • 13
2 votes
2 answers
106 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 ...
user avatar
  • 49
0 votes
0 answers
1k 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: ...
user avatar
-1 votes
2 answers
250 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 ...
user avatar
  • 23
0 votes
1 answer
186 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 ...
user avatar
  • 31
0 votes
0 answers
433 views

How to update period of a timer every interrupt on stm32 with preload enabled?

I'd like to change timer period inside interrupt handler that is equivalent to AVR code ISR(TIMER0_COMP_vect){ OCR0 == new_value } As I undestand the documentation,...
user avatar
  • 101
0 votes
1 answer
153 views

MSP430 Timer Interrupt Not Happening

I recently starting learning how to program a MSP430 and thought I'd start by writing a program to turn a LED on and off every second. However, when I run my code the LED goes on an stays on. When I ...
user avatar
  • 31
0 votes
2 answers
56 views

Can a pin change value after causing interrupt on a MCU

This was just a question I thought of as I started working through a design project. Let's say I have a hall effect sensor on an encoder motor. I need to catch every pulse from this encoder so I use ...
user avatar
  • 39
0 votes
2 answers
137 views

STM32 interrupt triggers by itself

I am using stm32cubeide to program a stm32f030f4p6 MC. I have assigned one pin as an external interrupt and it is connected to the data output of an RF433 receiver. Here is a summary of my code: ...
user avatar
0 votes
1 answer
514 views

Trying to use I2C ITs with HAL Functions

Hardware : STM32L452RET6 Software : STM32CubeFW_L4 v1.17 My problem : After using I2C with standard polling functions, i would like to use IT Functions to optimize my firmware. I try to work with ...
user avatar
  • 159
0 votes
1 answer
140 views

ATtiny85 - Sleep Mode & Interrupts

I am working with ATtiny85. I want to put my MCU in IDLE Sleep mode and after every five minutes, I want to write data into EEPROM. I am using Timer 0 overflow interrupt to count 5 mins. Counting will ...
user avatar
  • 5
1 vote
1 answer
992 views

STM32 UART interrupt with callback not working

I am trying to make a small project with an STM32 which uses serial commands to control the rotation direction of a motor. I used UART interrupts and callbacks to try to achieve that. I am using an ...
user avatar
  • 191
11 votes
10 answers
3k views

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 ...
user avatar
0 votes
1 answer
108 views

Cortex-M4 how to recover from vector table read fault in an empty device?

I have to load and run firmware in RAM of an empty Cortex-M4 chip (in a manufacturing environment). The chip ordinarily expects vector table at address 0x0 in flash. When I am loading my firmware to ...
user avatar
  • 8,426
0 votes
0 answers
136 views

HAL_Delay fails after flashing code

My code runs differently if reset vs. power-cycle. My board has a status LED. My program flashes an LED on and off. When I flash my code via my STLink V2 and hit my reset button, the light turns on, ...
user avatar
0 votes
0 answers
42 views

How to implement a touch controller wake up circuit?

I have an system-on-module (SoM) connected to an LCD with touchscreen interface. The SoM allows wake up from sleep by toggling one of its GPIOs. These are the datasheets: LCD, touch controller and SoM....
user avatar
1 vote
4 answers
300 views

Removing noise from the speed sensor of a motorcycle

I am trying to make a digital dashboard for a motorcycle using a Raspberry Pi, a display and some sensors. I am using this speed sensor. When I put the sensor on the axis of the motor wheel and run ...
user avatar
  • 111
2 votes
2 answers
183 views

Generate an interrupt with 8 inputs

I have 8 TTP223 touch sensors for 8 relays. I want my microcontroller to know when anyone of the switches is high or low. For that I can take inputs from the same pins that switch relays. However, how ...
user avatar

1
2 3 4 5
16