Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

6
votes
1answer
581 views

Inaccurate timer interrupt STM32

I wrote a simple program to toggle an LED on and off using the TIM1 interrupt on an STM32F0 discovery board. CLK Freq = 48MHz Prescalar = 48000 Auto Reload Register = 1000 Using the following ...
0
votes
1answer
35 views

PIC32MX UART Interrupt Not working

I am writing a program to send data from one microcontroller and receive the data using on another PIC32 microcontroller and display the received data on LCD. I am using UART2 of both PIC32MX to send ...
0
votes
1answer
32 views

Now, currently i am working on PIC32MX775F256H ,In this uart_rx _interrupt is not triggering . I don't know why

void __ISR(_UART1_VECTOR, ipl6) IntUart1Handler(void) { if(!INTGetFlag(INT_U1RX)) { g_intraised++; } IFS0bits.U1RXIF=0; } Please help ...
3
votes
3answers
78 views

STM32 CAN bus receive interrupt is sometimes not fired, and CAN transmit sometimes times out

I have two STM32 boards connected via a CAN bus. They periodically transmit a message to each other. For some transmissions however, HAL_CAN_Transmit returns with ...
0
votes
0answers
20 views

Problem with using Timer Counter interrupt on Atmel ARM

I'm using an ATSAM4E16C microcontroller and i need to get a 1 millisecond tick. I want to implement this using the timer counter module to trigger an interrupt. The clock frequency is 96 MHz, so using ...
0
votes
1answer
35 views

Why disable interrupt is time-consuming in multi-processor computer?

I have a book statement: Disabling interrupt is time-consuming in multi-processor system. I suspect that this is related to the hardware implementation of how interrupt is enabled/disabled. So ...
0
votes
0answers
23 views

Bare ATMEGA328P - Clock using TIMER 1, PWM on TIMER 0 and TIMER 2

I am stuck on an issue. Like the title says, I am trying to generate 2 different PWM signals on TIMER 0 and TIMER 2, while I am using the interrupt on TIMER 1 to count the time. I tried several ...
0
votes
0answers
28 views

PIC18F26K22 interrupt INT0

I use to work with PIC18F1320, with nearly all interrupts and it works fine. I have a new project that needs some more pins and I2C. So I decided to use PIC18F26K22 (the board is done). But on that ...
2
votes
2answers
179 views

Can't trigger AVR ADC Interrupt

I am using an Atmel's XPlained mini board with Atmega328PB. I am trying to use ADC interrupt, however I can't get it to fire. Here's the code that I have a problem with: ...
0
votes
1answer
61 views

STM32F411VE ADC interrupt not working

My code works fine without interrupt (I tried polling the ADC value) but when I enabled the interrupt, it didn't work - while debugging in Keil, it never reaches the ...
0
votes
1answer
63 views

Problem with interrupt-based timer on STM32F411

I was following this online tutorial and cannot get the interrupt-based timer to work. I know the timer is running because if I uncomment the five lines in the main loop, I get a nice square wave ...
0
votes
1answer
25 views

Interrupt during packet transfer

I'm using the mbed TCP/IP Socket library to receive incoming messages via ethernet. Currently, the incoming data is read in an infinite while(1) loop (i.e. as fast as possible). I will also be ...
2
votes
0answers
19 views

MikroC trigger interrupt in compiler

I am trying to test the interrupt function at home without a board to push buttons etc. I gave up on my code and copied an example but still cant make it work. Below is the sample code. In the while ...
0
votes
3answers
80 views

Interrupt debouncer for switch sensor

I want to read the state of a switch sensor (magnetic contact). I'm thinking to connect the switch between an interrupt pin of my micro and ground, listening for CHANGE status. In this way I have ...
0
votes
1answer
57 views

What are the minimum and maximum number of cycles consumed when executing an interrupt on an STM32F0 MCU?

Assuming I set an external GPIO interrupt to highest priority, how many cycles does an STM32F0 MCU take to: start executing the interrupt handler code return from the interrupt I expect that the ...
0
votes
0answers
20 views

Can standard 8051 timer 1 and timer 0 be available to programmer when serial mode 1 is used?

The micro is an AT89C4051. It allows two timers and a serial port interrupt. Currently, I set things up so that if any kind of data is received on the serial port, it just is loaded into memory by ...
2
votes
1answer
146 views

NVIC Pending register vs EXTI Pending register (STM32F4)

Why there are two pending registers for interrupt? One of them is EXTI_PR and other one is Interrupt Set-pending Registers(ISPR) which is in NVIC controller registers. EXTI unit pending register: ...
0
votes
0answers
107 views

Waking up an ESP8266 using an MPU6050 accelerometer not working

I am trying to wake up an ESP8266 from deep sleep using an MPU6050 interrupt. I am using Micropython to configure MPU6050 to generate a 50us pulse (active low) on motion and connect it to the RST pin ...
3
votes
2answers
133 views

Set up an ADC ISR, but every time an ADC Interrupt is called it goes to isr_trap.asm instead

I am trying to do a program with my MSP430FR6989 from Texas Instruments. I send an Analogue signal to my ADC module in the uC, which converts it to a digital signal, if the value is greater than 0x800 ...
0
votes
1answer
55 views

LIS2DH12 Watermark and Overflow Interrupts at the same time

I'm working on a project that uses the LIS2DH12 accelerometer by ST (product page). I have a couple of questions about it, and as it is quite a common part, I wonder if anyone here knows the answers: ...
0
votes
1answer
38 views

STM32F030(K6) Systick not triggering (BOOT0 problem)

I'm trying to write a simple program for a STM32F030K6T6 microcontroller. The problem I am facing is the more common "Systick is not working" problem. The code is generated using Cube32MX (Firmware 1....
0
votes
1answer
42 views

Using UDRIE0 interrupt in ATmega168

I only have some limited knowledge in interrupts. This is what I understand about following ISR functions ISR(USART_RX_vect) will get called when a new data ...
0
votes
0answers
67 views

STM32f103 multiple TIMER IRQ to generate different timebase using SPL

I am trying to control two LEDs with different delays.I used CUBEMX for code generation and used TIM2 and TIM3 to generate different timebase. It worked without any issue. Simply using TIM2_IRQHandler(...
0
votes
0answers
142 views

PORTB Interrupt-On-Change in PIC16F887 microcontroller triggering issue

I have a question regarding PIC16F887 internal interrupts. Can PORTB Interrupt-On-Change in PIC16F887 microcontroller be triggered if the PORTB is configured as output port? its Datasheet doesn't ...
1
vote
2answers
231 views

Timer0 overflow interrupt does not work on ATtiny10

I am trying to use the Timer0 overflow interrupt to make a little project. I used such a timer in the ATtiny45 and it worked, but with ATtiny10 no result. So I tried an easy LED blinking program and ...
0
votes
1answer
65 views

ARM cortex-A7 - cycle interrupts

I'm using a Banana Pi M3 with an ARM cortex-A7. I want to perform a task in a cycle with a fixed period with no delays and I was wandering if I could use an interrupt for that. Does this processor ...
7
votes
7answers
2k views

Is it possible to interrupt the copy process of a struct by an interrupt in embedded C?

Inside the driver I have got a function to copy the data from the internal struct into a struct from the application. Can this process be interrupted by a microcontroller interrupt trigger? ...
2
votes
2answers
235 views

Nested Vectored Interrupt Controller (NVIC) - Why is it “nested” and “vectored”?

In ARM microcontrollers there is an peripheral called NVIC (Nested Vectored Interrupt Controller). What does the "nested" and "vectored" part refer to, or why is it "nested" and "vectored"?
0
votes
1answer
116 views

Understanding atomic writes to GPIO on different ARM Cortex-M's

This video succinctly describes why the read/modify/store has potential problems when it comes to interrupts. Very clear and understandable. He uses the TI Stelarris Cortex-M4 as a teaching board ...
2
votes
1answer
71 views

Interrupter on induction heater

Im currently trying to control the power of my induction heater, i want to use an interrupter to control it. but if i now interrupt the driver at random points, the mosfets wont turn off at zero ...
1
vote
1answer
98 views

5V Tolerant Way To Generate Rising Edge Signal on USB Connection

I have a microcontroller device that can be awakened from deep sleep mode when it detects a rising edge signal on a wakeup pin. The wakeup pin is 5V tolerant and I'd like a connection to a USB port to ...
0
votes
1answer
104 views

LSM9DS1 accelerometer with too many aux pins. Which ones are actually useful?

I'm designign a board with an LSM9DS1. I have an SPI bus (with only this device connected), two gpio for the chip selects (it has two CS, one for gyro and accel and the other for the magnetometer. ...
0
votes
0answers
200 views

Decoding mp3 with Helix lib on Stm32f411

I'm sending mp3 self-contained frames from PC to my STM32f411(Discovery board) via FTDI, on microcontroller I decode frame and send decoded pcm data to external DAC codec(on a board) via I2S. I'm ...
4
votes
2answers
178 views

Is it a good idea to refresh a display (8x8 LED matrix in this case) inside an interrupt handler?

Let's say I have an Arduino connected to a 8x8 LED matrix. In my case, the LED matrix is driven using two 74HC595 shift ...
8
votes
2answers
608 views

ATtiny13A - Can't generate software PWM with CTC mode

I'm trying to make a remote control RGB LED light using an ATtiny13A. I know the ATtiny85 is better suited for this purpose, and I know I might not eventually be able to fit the whole code, but for ...
0
votes
3answers
530 views

STM32F4 How are Preemption Priorities and Sub-Priorities used?

I have started working with ARM-based microcontrollers. I not understand subpriority and preeemptionpriority. For example: NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x00; ...
0
votes
0answers
106 views

PIC18F452's timers and interrupts

The PIC18F452 datasheet explains that it has 4 timers: ...
0
votes
1answer
86 views

Output Compare Interrupt does not work avr atmega

Hey I'm trying to do blinking led using interrupts on 16 bit timer. My atmega model is Atmega168A. Chip clock rate is 12Mhz. Here is my code: ...
0
votes
1answer
77 views

Atmega168 interrupts not working

I am trying some simple programs to test my microcontroller, but I am having trouble with the first test program: blinking an LED using interrupts. I'm using an Atmega168A-PU. Here is my program: ...
-3
votes
2answers
238 views

Edge detection circuit (for rotary encoder)

I managed to decode a rotary encoder using an arduino to read the input signal but I noticed other than the interrupts, the code is mainly made up of lines similar to: "IF this AND that OR that AND ...
0
votes
1answer
38 views

Single Button Power Switch and Mode Selector

I am currently creating an embedded project and would like to know what you all think is the best way to proceed. My setup at its most basic is an ATMEGA328P, a simple momentary pushbutton, a ...
3
votes
2answers
160 views

Is D flip flop equivalent to frequency mixer (difference frequency) for square waves?

I was trying to make a frequency mixer (only difference frequency) for two square waves (PWM1, PWM2, both 0.5-4KHz range) using ONLY Arduino due. I'm new to signal processing, and the only way I can ...
1
vote
4answers
209 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
102 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
904 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
2k 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
0answers
32 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
154 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
76 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
53 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. ...