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
0answers
16 views

STM32 __HAL_TIM_GET_FLAG vs. __HAL_TIM_GET_IT_SOURCE and how doing without (CMSIS)

I'm trying to configure a timer (on STM32F0 but I guess it's the same on the rest of the STM32F family) with Output Compare to get an interrupt for two different actions at two different time ...
0
votes
0answers
29 views

Touchscreen keeps failing to communicate with raspberry pi, except when I touch the INT pin

I bought a display with a i2c touchscreen from Aliexpress and hooked it up to my Raspberry Pi 3b+. The screen part works fine, however, the touchscreen part is flaky. When I just boot the pi, the ...
15
votes
11answers
4k views

Why should interrupts be short in a well configured system?

Why should interrupts be short? I'm currently using STM32 and it has a feature of prioritizing interrupts. Because of that, I don't see any difference between these two options: the main loop and ...
1
vote
1answer
57 views

STM32 UART: combining interrupt and DMA modes

I am trying to use UART3 of STM32F103K8 to rx data in interrupt mode and tx in DMA mode. Reception works well, but transmission ...
2
votes
2answers
46 views

PIC when generating a PWM signal does the used timer throw a overflow interrupt flag?

I'm trying to make a 10kHz PWM signal with a PIC18f25k50. Which is generated like the following diagram. I configured timer2 at 750kHz which means if I set PR2 ...
2
votes
2answers
287 views

Reading interrupt safe ring buffer

I have a piece of code here that was generated by Atmel START Wizard. It setups a UART and it also creates a ring buffer for reading data. This is the code that reads data from the buffer: ...
0
votes
0answers
31 views

ATmega328p: Does SPI conflict with timers TC1, TC2 or interrupts PCINT2, PCINT0?

My code - based on my library MultiTrans - uses timers TC1 and TC2 as well as interrupts ...
1
vote
3answers
105 views

Counting pulses using Arduino Uno

I am trying to count pulses from a waveform generator using an Arduino Uno. The waveform generator is set at the following settings: Waveform Type: Pulse Freq: 20 Hz (50ms) Amplitude: 3.0 Vpp Offset: ...
0
votes
1answer
61 views

Master SW (bit-bang) I2C with Interrupts?

I've written a set of "bit-bang" software routines for the PIC18F2620 device. These routines work well for reading and writing 24LC256 EEPROM and DS1307 RTCC devices for the most part. (I wrote this ...
0
votes
1answer
59 views

timer input capture for really low frequencies

How low of a frequency can a timer be used to measure an external signal in "input capture" mode? If I need to measure something that has a frequency of say 1hz - 2hz... or even slower for that ...
0
votes
1answer
76 views

STM32: Interrupt latency for serial protocol implementation

I am implementing a synchronous serial interface (SDLC) using an STM32. My original implementation for the RX side is running on a ARM7 which uses the FIQ to set an interrupt on the clock line, in ...
1
vote
0answers
52 views

How to set registers of accelerometer BMA220?

I first wrote my problem in Arduino Stack exchange (https://arduino.stackexchange.com/questions/68438/how-to-manage-interrupt-from-accelerometer-bma220) but I was told that I might get a better help ...
3
votes
1answer
72 views

AVR diagram of functions calling, ISR and main loop share the same resource

I made a simple diagram of functions calls to illustrate the potential problem which bothering me a little. As you can see, my task_list (which is simple linked ...
1
vote
2answers
56 views

Non-reentrant Functions as Macros for utilities used in both Main and Interrupts

When compiling software with xc8 for a PIC which has functions which are called in both interrupts and in the main function the compiler gives an advisory: ...
0
votes
1answer
76 views

Arduino to Attiny841 with ATTinyCore — pins not working

I have code that works using Arduino. Because I wanted to size down the project, I replaced it with an Attiny841. Process: I soldered the 841 on an adapter and checked all pins using a multimeter ...
3
votes
1answer
98 views

Exiting interrupt routine in PIC16F18877

After executing the interrupt block, the execution halts and never returns out of the interrupt routine to the while(1) block in the main method. To check the functionality, I've written the below ...
1
vote
0answers
78 views

STM32 I2C Fast Mode Issue

Currently, I am implementing I2C communication with Interrupt. STM32 serves as the slave and Arduino serves the master. MCU: STM32L152RDT6 For previous work, I2C communication in standard mode is ...
0
votes
1answer
63 views

Do UART RX interrupts require support from the transmitter?

I'm trying to understand why I am seeing RX interrupts when tying RX to TX of my SAMR34 but not when I connect it to the transmitting device. The transmitting device notes the following restrictions: ...
1
vote
1answer
56 views

Interrupt on Change in PIC16F18877 Not Triggered

I'm trying to trigger the interrupt service routine method in PIC16F18877 microcontroller, but the code never gets into the isr() method. Not sure what and where am i going wrong. Here is the code i'...
1
vote
2answers
59 views

Where should be defined a device specific ISR when making a static library?

Suppose I want to make a static library (.a file), which contains an ISR. That library should be used by many AVR MCUs, but each device has different ISR vector name, so it cannot be defined in .c ...
1
vote
1answer
83 views

STM8 TIM2 interrupt not taking place. What am I missing?

I've just started using STM8 microcontrollers, specifically the STM8S003F3P6 chip, in my own custom test board. The board works and I am able to blink an LED on PA3 without using an interrupt. However,...
1
vote
4answers
106 views

What happens if an interrupt callback execution is interrupted by the same interrupt?

I have a microsecond timer (generates interruption every microsecond) for which I implemented a "HAL_TIM_PeriodElapsedCallback" function. What occurs if the ...
2
votes
1answer
52 views

NVIC memory map ARM cortex M3 STM32f103

I do not understand the following memory map regarding the NVIC registers in Programming Manual for STM32f103 page 129. It says that the offset address for NVIC_IPR0 is 0x300 and that of NVIC_IPR20 is ...
4
votes
4answers
741 views

Interrupt control in STM32

I am trying to learn about STM32 programming. I started to read some references before start the programming. I am currently reading this ST presentation. It says: When an interrupt request ...
0
votes
1answer
101 views

Using pointer of a function's returned value

I would like to know if there are possibilities to change the following code: ...
1
vote
1answer
74 views

UART receive detection

I am working with UART and I want to do something but could not achieve myself. I want to enter an interrupt when the data receive stops, i.e when I unplug the cable, do something only once and then ...
0
votes
1answer
77 views

Thread-Style Operation on Microprocessor

This is a general question about designing firmware for AVR microcontrollers, say, the AtMega16. I have a routine that I am running through several thousand times per second. The routine is entirely ...
-1
votes
2answers
71 views

Why polling works rather than interrupts [closed]

I have several devices like for example connecting with ESP8266. I have tried to use the SPI with it with STM32F4. First I have tried to work with SPI interrupts, the result of the communication is ...
2
votes
0answers
73 views

Pulses counting problem from npn proximity with interrupts in arduino

I am interfacing an open output npn proximity sensor with Arduino nano. I have used very silly approach of voltage divider as I was not sure that in open output sensor you can get whatever voltage you ...
0
votes
2answers
148 views

What is the difference between IQRn 0 and IRQn 1?

I am using STM32CubeMX to program my chip. Essentially I have a timer that i am trying to set to one ms, and every time that timer reaches a ms I want to toggle a pin. My question is that does it ...
0
votes
2answers
89 views

thoughts on reading only one changing GPIO with accurate time amoung huge number of digital Inputs

I am trying to read a huge number of digital inputs (129 to 800 and maybe more) at the same time. the sampling rate should be around 500K samples per second but I only need to read one of these inputs ...
0
votes
0answers
40 views

MEGA2560 only starts program after pressing RESET button multiple times

I am working on a program where I am controlling an MP3 player by using UART between my MEGA2560 and the MP3 player. The MEGA2560 sends serial commands to the MP3 player when external interrupts are ...
0
votes
1answer
166 views

DMA, Interrupt and UART connection in STM32 for detecting chararcters

I am trying to make a project and am planning to use DMA for my UART from one STM32 to another STM32. Here are some details of what am I using: Chip: STM32F107RB debugger and programmer: Atollic for ...
0
votes
1answer
40 views

Tasks inside Interrupt Handler

Is there any schedular that exists for STM32F103 in which the 'tasks' are run at the ISR() level while the Schedular() code runs in the main() thread?
0
votes
0answers
44 views

digispark + pcf8563 RTC interrupt not working

I have PCF8563 WAVESHARE board connected to DIGISPARK via I2C. Here is the code: ...
2
votes
1answer
335 views

single or multiple interrupt handlers in stm32

I am coming from 8-bit world to 32-bit world specifically stm32f103. At present I am only doing study and discussion with my fellows to know the major differences in the two worlds and also to select ...
2
votes
1answer
197 views

CPU Utilization Methods

To fulfill customer expentations and fill out customer reports about the device, is there also one section about CPU Utilization. Because I have never done such task before I have overview some "...
0
votes
3answers
60 views

Interrupt generating circuit: 0 ~ +3.3 V

For the purpose of testing a MCU and it's interrupt handling I want to design a circuit to generate interrupts. Ideally I would use a relaxation oscillator, but my supply is constrained to 0V and +3....
0
votes
1answer
132 views

timer interrupt on STM32F303

I'm kind of a newbie so excuse me if this is a beginner's question. tried to find an answer but couldn't find one. I'm working on STM32f3Discovery eval board, with the stm32f303vc on it. The code ...
0
votes
0answers
46 views

Calling a function that uses HW_Delay inside timer interrupt

I have the following timer interrupt configuration ...
0
votes
0answers
90 views

PIC timer1 interrupt never occurs

I am trying to use timer1 interrupt on PIC18F26K83. I use Micro C as compiler. So I set my timer for 30 ms and after that 30 ms, it is supposed to enter an interrupt and light the LED. But it never ...
1
vote
2answers
136 views

PIC interrupt on change never enters the interrupt routine

Hello I am using PIC18F26K83 and I have a button on RC7 pin. That is why I cannot use a normal interrupt. But according to datasheet interrupt on change can be used in this pin. I could not make it ...
2
votes
0answers
83 views

How to implement multiple functions on single push button

I am using a STM32 Nucleo MCU and trying to pull a multi-function single-button method. I need a way to implement this form of functionality for a single push-button: Push 1: function 1 Push 2: ...
0
votes
0answers
24 views

How to disable port2 interrupt when port 1 interrupt is active?

I am using MSP430G2553 with IAR. I would like to make an IR communication system which has a transmitter-receiver on both sides. When I try to send my signal, the receiver on the opposite can't ...
0
votes
0answers
73 views

Can't use the Wake-on-Motion functionality of an MPU9250 with STM32

Hi there :) I'm trying to use the Wake-on-Motion functionality of this particular MEMS (MPU9250) with my STM32L152C-Discovery board: if the MPU9250 sense a motion, the INT pin will be high. To achieve ...
1
vote
0answers
81 views

STM32F042 ADC Interrupt with STMCUBEMX

I need to read 15 channels ADC. However my MCU is specific named STM32F042K6T6. I decided to use an analog MUX to read every channel from just one pin. But, I didn't read accurately the datas by ...
0
votes
2answers
2k views

STM32 EXTI does not trigger interrupt

I am working on a device with a button that is supposed to turn it on (when pressed briefly) and off (when held longer). The MCU is an STM32L432. The button is connected to PB0. I want to use EXTI as ...
0
votes
1answer
137 views

Microcontrollers (STM32) and GPIO with momentary buttons

I have six momentary buttons and an STM32 Discovery board. I want to check the button presses. As far as I understand, I create a continuous loop that will check each GPIO consecutively. (I am aware ...
-1
votes
1answer
133 views

STM32 interrupt from Matlab Code

I'm using the STM32 MAT plugin and embedded coder for Simulink to generate C-Code out of my models to compile them onto an STM32F4. As IDE I use TrueStudio and for my MCU Configuration I use CubeMX. ...
0
votes
1answer
98 views

Identifying unhandled interrupt

I stopped in the middle of debugging a very simple project where I send "hello world\r\n" every couple seconds out of USART2. The first print hits the console and then I hang in an infinite loop ...