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

Interrupts with I2C on ESP-IDF

I want to use interrupts with I2C on ESP-IDF, and I would like to acquire fundamental knowledge on this matter. How can I enable the I2C interrupt channel in a bare-metal environment? Is there anyone ...
res_queen's user avatar
0 votes
0 answers
57 views

The shortest timer between interrupt events is 3 microsecond. How can I shorten this time?

Using an STM32F756ZGT6, I want to detect rising edge of 1MHz frequency has 50% duty circle. At each rising edge I will generate a pulse about 50ns (I use a timer on the same board to generate this PWM ...
Hongquan Phan's user avatar
1 vote
1 answer
34 views

Can I use a different channel of a timer at the same time?

I am using AVR128A for a project. It comes with two 16-bit timers (Timer 1 and Timer 3) and two 8-bit timers (Timer 0 and 2). Timer 1 has two channels whereas Timer 3 has three. I have all the timers ...
RK Eshat's user avatar
  • 143
1 vote
1 answer
59 views

I2C to USB converter with interrupt

I have a touch screen with I2C and interrupt output and I would like to connect this touch screen over a USB cable to a host controller. I know that it is possible to transfer interrupts on the USB ...
Stefan Wyss's user avatar
  • 6,829
1 vote
0 answers
60 views

Fall edge interrupt constantly triggering without any visible edge

I'm trying to implement a button-operated sleep mode toggle on a Sparkfun Artemis module. Button press one puts the Artemis to sleep, button press two wakes it up. I'm coding it in the Arduino IDE and ...
E.HP.S's user avatar
  • 329
1 vote
2 answers
351 views

PIC based MCU coding to make a speedometer

I am trying to make a speedometer cum odometer. I'm using a PIC based MCU. The speed I'm getting is as an analog input. (at 0 V, I get 0 km/h and at 18 V, I get 25 km/h). I can easily measure the ...
Siddharth Goel's user avatar
0 votes
1 answer
23 views

Pic32MZ interrupt signal to output pin set without CPU usage

I generate ADC digital comparator interrupts. I want to use this interrupt to trigger Input Capture module. To achive precise timing it will be better to directly trigger IC module with ADC digital ...
Ahmet Atcı's user avatar
0 votes
0 answers
49 views

Is it possible on STM32 to detect if an event triggered?

According to Stm32 Event and interrupts , STM32 events are mainly for controlling other peripherals. Is there a way on the MCU itself to detect if an event fired? That is, I don't need to interrupt ...
SRobertJames's user avatar
0 votes
5 answers
118 views

Interrupts: does execution continue afterwards, and how long can they be?

I’ve been reading that interrupt callbacks must be very short. I have two questions: Imagine the while(1) loop inside the main. I guess this while(1) loops with clock frequency(?). Does this looping ...
GNZ's user avatar
  • 1,638
0 votes
0 answers
43 views

STM32: I2C Master Slave code does not work

I have two board: nucleo U575zi-q & nucleo L432kc u575 is the master board, l432 is slave. I want to transfer data between Them, and below is my two codes. this is my master's code ...
이준표's user avatar
0 votes
0 answers
36 views

Experiencing Much Higher Data Rate than Timer Interrupt Settings While Reading IMU Data via I2C on Arduino

I am currently using an Arduino MKR ZERO to gather IMU data from three MKR IMU SHIELD boards(BNO055 IMU). I have utilized the <Adafruit_ZeroTimer.h> library to set a timer interrupt with a ...
JING's user avatar
  • 1
0 votes
0 answers
43 views

Interrupt function (PIC16F MPLAB XC8)

I have two interrupt functions: one for generation of PWM signal for sinewave generation and the other is for (PWM) generating signal to battery charger. Whenever the supply is available the battery ...
Electrone's user avatar
1 vote
2 answers
75 views

Not having a PORTAbits.RAx on ISR breaks my code

I'm working on a 433MHz RF reciver code for a PIC16F628A using a cheap 433MHz receiver. The catch here is that I'm only able to use RA4 for the RX, and because of that i had to use timer2 (because the ...
fpp's user avatar
  • 159
0 votes
1 answer
91 views

What is Interrupts in ESP32? [closed]

I am working with ESP32 WROOM32 Controller and AHT25 Temperature and Humidity sensor. I need to work with Interrupts in my device. Basically I don't know what is interrupts and How to use my device ...
Kuralmozhi's user avatar
0 votes
0 answers
31 views

Tsi107 PowerPC Host Bridge Vs Processor

I a confused regarding the difference between a powerPc host bridge and a processor. According to the host bridge datasheet, it can be programmed, and it has interrupt generation and handling, and ...
kam1212's user avatar
0 votes
4 answers
185 views

Why is timer interrupt on PIC MCU not behaving as desired?

I am using PIC16F627A with PICKit 3. MPLAB X IDE v5.40 (and associated IPE) with XC8 compiler v2.41. PIC16F627A datasheet My intention is to flash TOWER_LED in ...
RickyBoy's user avatar
2 votes
0 answers
49 views

ATmega - nested interrupt

I need to wait on PIN_CHANGE interrupt during pending TIMER interrupt. Is that right to do it like in code below? Is the interrupt still enabled during ...
Michal Podmanický's user avatar
0 votes
2 answers
99 views

Why doesn't polling require a context switch?

When we have a microproccessor and we must service the peripherals, the theory suggests that we can use either interrupts (context switch required) or polling (no context switch required.) On the ...
user1198483's user avatar
1 vote
2 answers
220 views

STM32F746 Disco: Why doesn't the RTC generate an alarm A interrupt?

I'm trying to generate an interrupt every 60 seconds using alarm A. I put a HAL_GPIO_Toggle instruction inside the interrupt HAL_RTC_AlarmAEventCallback to turn an LED on to see if it triggers but I ...
Rodo's user avatar
  • 978
0 votes
1 answer
75 views

How can I change SPI ports on an Arduino?

My end goal is to read information from an nRF24l01 module connected to my Arduino UNO R3 and generate an interrupt while doing that. I have read that for hardware interrupts, only pins D2 and D3 can ...
insipidintegrator's user avatar
0 votes
1 answer
90 views

On an embedded system, when you have a hardware interrupt, what happens to the process status word?

I have been taught that when an interrupt arrives, the following generally happens: The current instruction finishes. The interrupt is acknowledged. The hardware state(PSW) is stored . The PC is ...
Thomas Stokes's user avatar
1 vote
1 answer
48 views

MSP430G2553: ISR not triggering when I2CTX-Flag is set

So I need to get an I2C up and running. To do so the µC relies on ISR's to push data byte by byte onto the data-line. So far so good I programmed my functions and ISR's to transmit and receive data. I ...
Steve's user avatar
  • 21
0 votes
0 answers
55 views

IIM-42352 interrupt triggers multiple times, when condition is only met once

Currently I am working with esp32-s3-mini system which communicates with IIM-42352 accelerometer via SPI. My configurations are as follows: *FIFO mode- stream to FIFO *Packet size- 16 bytes *Interrupt ...
Dominykas's user avatar
  • 335
1 vote
3 answers
151 views

ATmega - How to decrease the time of jumping into PCINT ISR

I need to jump into PCINT ISR as fast as possible after signal appears on pin. Currently it takes about 20 clock cycles. I would like to decrease it to 10 cycles. I am using C. Is there a way? I found ...
user avatar
0 votes
0 answers
88 views

STM32 timers works wrong in pair

A few weeks ago I ran into some strange timer behavior that I couldn't figure out. Description: I have a system which count signal from a wheel with tooth (for synchronization), based on input signal ...
Alexey's user avatar
  • 43
0 votes
0 answers
87 views

LIS2DE12 accelerometer configurations

I am working with LIS2DE12 accelerometer. Communicating with it via I2C. Retrieving simple data works fine, but now I want to configure it to generate interrupt on strong acceleration, but I'm a bit ...
Dominykas's user avatar
  • 335
0 votes
0 answers
64 views

Issues reading data back from 24LC512 EEPROM via interrupt on MSP430F47187

I have interfaced MSP430F47187 with 24LC512 EEPROM. I am able to write to the EEPROM without any issue but reading the data from the EEPROM is problematic as the reading stops after a while. I have ...
GBJ's user avatar
  • 1
1 vote
1 answer
57 views

Cannot stop Microcontroller's Hardware Timer from running

I'm using an Atmel ATMega8 microcontroller to control a stepper motor. (Datasheet). Timer1 (a 16-bit hardware counter) is used in CTC mode to modulate an IO pin to provide the stepping signal to the ...
Wossname's user avatar
  • 454
0 votes
1 answer
286 views

Using Timer Interrupts Instead Of Delays in PIC Microcontroller

I have this task where I have to use timer interrupts intead of delays (for efficiency purposes) in this 7 segment display circuit with PIC18F4620. Here is the circuit: Display is common anode. I ...
Line Follower's user avatar
0 votes
1 answer
85 views

STM32 PWM timer interrupt latency

I have STM32F401 board (WeAct Black Pill V3.0, but the chip is labeled as STM32F401CCU6). My task is to read output of AD7606 (16 bit, simultaneous sampling, 8 channels, 200 kSPS max) in parallel mode ...
anandr's user avatar
  • 111
0 votes
1 answer
44 views

How to make a circuit which can give divided voltage to ADC and can send a trigger pulse to INT0 when I press a button?

I connected 4 buttons to the ADC module of AVR-ATMega328p with different resistor values, To know which button is pressed this ...
yssh's user avatar
  • 11
2 votes
0 answers
80 views

Nucleo32 with STM32F303K8 crashes when setting PA2 as Interrupt and triggering it

I am using a nucleo 32 for my project. I am using arduino and creating a TCP modbus and RTU modbus server. I have set the pins as folows: Description Type Arduino STM32 Pin Number Pulse input 1 ...
DriesVanDB's user avatar
0 votes
1 answer
67 views

Why are pulses not generated? [closed]

Task: Implement interrupt processing when the button is pressed, and the very start on the rising edge, the interrupt pin and to which the button is connected 11. Implement the processing of the ...
Good York's user avatar
0 votes
1 answer
56 views

STM32F405: WWDG interrupt occurs right after WWDG enabling

I've faced the problem with WWDG on STM32F405 (the same problem described here, but with no no solution): After enabling WWDG interrupt occurs immediately, despite the fact, that counter is far from ...
MatTab's user avatar
  • 11
1 vote
2 answers
507 views

How do I handle interrupts manualy by registers in STM32?

I've just started learning STM32, and I'm learning it at low (register) level without libraries. It is very easy to use GPIO: I #define memory addresses (like ...
Tyo Hoy's user avatar
  • 75
0 votes
0 answers
93 views

ADXL345 Interrupt doesn't work

I am using adxl345 with arduino. I am using sparkfun's library. I am using adxl345 with I2C. I can read adxl345 value without any problem and I can detect inactivity and activity. ...
Tryingtogetsome's user avatar
0 votes
1 answer
76 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+ ...
Armel Tchuisseu's user avatar
-1 votes
1 answer
82 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 ...
Piovezan's user avatar
  • 133
1 vote
3 answers
97 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: <...
Wossname's user avatar
  • 454
0 votes
0 answers
52 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 ...
Shahamat's user avatar
0 votes
1 answer
36 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 ...
Hard Deco's user avatar
2 votes
2 answers
456 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 ...
turqay mammadov's user avatar
0 votes
1 answer
115 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 : ...
Tryingtogetsome's user avatar
4 votes
0 answers
103 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, ...
bigjosh's user avatar
  • 9,958
3 votes
2 answers
255 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 ...
Alexey's user avatar
  • 43
0 votes
1 answer
1k 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. ...
Sudhakar R's user avatar
5 votes
1 answer
201 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 ...
rspaudio's user avatar
1 vote
1 answer
68 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, ...
mrs15's user avatar
  • 11
-3 votes
1 answer
119 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 ...
mohammad rezza's user avatar
1 vote
1 answer
94 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 ...
Mattwmaster58's user avatar

1
2 3 4 5
17