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
1answer
28 views

UART doesn't transmit all characters when using UDREn interrupt

Note: I am beginner :) MCU: Atemega328p In Method 1, I am using a UDRn data register empty interrupt once the transmit buffer is empty and inputting characters from ...
0
votes
0answers
22 views

ESP8266 using DS3231 to wake up from deep sleep

I am using the Arduino IDE to program the ESP8266 and am able to set the time, alarms on the DS3231 and test to see that they are firing. My problem is that I would like to use the SQW output to wake ...
1
vote
2answers
58 views

Does this interrupt improve performance even with while loop in ISR?

Note: I am a beginner :) MCU: Atmega328p Which program below burdens the CPU the least? Would it be a significant difference? Objective: to make a more "efficient" serial monitor by ...
0
votes
0answers
36 views

problem in programming ISR in 8051

in this code : ...
1
vote
1answer
49 views

Need more than two external interrupts in 8051

I am working with 8 YS-17 flame sensors and may need more in the future. There are only two INT0 and INT1 in port 3. Is there any way to get the other interrupts or I/Os to work as external ...
0
votes
1answer
34 views

Error Real Time Clock implementation AVR microcontroller

I want to create a real-time clock using ATmega328p microcontroller. The microcontroller's frequency is 1 MHz. So, I think I should use timer interrupts in CTC mode to generate interrupt every second. ...
1
vote
1answer
42 views

UART RX Interrupts Stop Working After a Few Seconds

I am writing a very simple program to validate that my board (STM32L4) can receive terminal (TeraTerm) characters via interrupt. The program runs as expected for the first few seconds (anywhere ...
0
votes
0answers
35 views

STM32 Timer - Issues with generating 1 us pulse on GPIO

I am using Nucleo-F767ZI board which has STM32F767ZI controller on it, and am in need of sending out a particular structure of elements bit-by-bit through a GPIO pin once every microsecond (1 MHz freq....
0
votes
4answers
98 views

Crystal tolerances and what that means for timer interrupts

I'm developing a system that needs to periodically wake up and perform a process. We're currently targeting for an hourly wake up (give or take, this spec is very loose). The key here is the unit cost ...
0
votes
1answer
59 views

What if you enable both DMA and Interrupt for a STM32 ADC

Imagine this scenario: You are using a timer driven ADC in DMA mode, nothing special. Now, because you are interested in having a Watchdog, you also enable the ADC Global Interrupt in CubeIDE (...
1
vote
1answer
39 views

Pin change interrupt won't toggle OFF my LED

Friendly Note: I am a beginner :) Microcontroller: Atmega328p LED = PORTB0 BUTTON = PORTB1 Aim: To have the button generate a pin change interrupt request which runs an ISR that toggles PORTB0 ...
0
votes
3answers
56 views

How to write own ISR handler

I am learning about avr programming and i know we have to use avr/interrupt.h library to use interrupt but my main reason to learn avr programming is to program without any library so i want to know, ...
0
votes
1answer
52 views

How to use PIC16F84A TMR0 Interrupt as a substitute to the Sleep instruction in Assembly

I have this circuit: So my problem is that I'm having trouble using the TMR0 interrupt as a delay or substitute to the SLEEP instruction in the PIC16F84A. I can't quite get the concept of using the ...
0
votes
0answers
12 views

Cannot seem to initiate Inerrupt in STM8S TIM2

I trying to initiate an interrupt every 1 minute. The Timer itself is working however, the interrupt does not seem to work. I have added my main code + the vector interrupt code. Please let me know ...
2
votes
0answers
20 views

How to safely set/clear only some bits of SCB->SHCSR on ARM Cortex-M processors?

On p. 265 of the third edition of Joseph Yiu's The Definitive Guide to Arm Cortex-M3 and Cortex-M4 Processors, there is some discussion about the "system handler control and state register" (...
0
votes
0answers
31 views

Interfacing Arduino with TSL235 (light to frequency converter)

I am working on an Arduino based circuit that uses light to frequency converter (TSL235) to trigger a buzzer when there is an intensity change in the ambient light (for example when a car is pointing ...
0
votes
0answers
67 views

While(1) doesn't work when interrupt active

I use PIC18F45K22. After getting UART RX interrupt the program doesn't go back While(1) loop. ISR runs correctly by itself. I need LED blink continuously in while(1) loop. What is missed? I tried ...
3
votes
0answers
102 views

ISR won't modify a global variable (IAR)?

First, some background on what I'm working on. I have a custom board with ATmega324A that I designed as part of a project I'm working on. Originally, software for the uC was written for GCC in Atmel ...
1
vote
0answers
47 views

Wake up with external Interrupt from deep sleep mode (Adafruit Feather 32u4)

I have an Adafruit Feather ATMega 32u4. I want to put it into sleep mode and wake it up with pressing a switch as an external interrupt. This is what I tried so far and which worked: switching a LED ...
0
votes
0answers
42 views

How to detect the presence/ absence of a PWM signal on a GPIO pin?

I just want to set or clear a flag by detecting the presence or absence of a PWM signal with approximately >100 kHz frequency on a GPIO pin. I studied that a simple RC low pass filter can be used ...
0
votes
0answers
47 views

How to detect an I2C slave presence/ absence as an interrupt?

Involved in a task to build a test equipment with a ARM M4F microcontroller for the purpose of testing various PCBs. One of the PCBs has I2C compatible current/voltage monitoring chip on it. Is there ...
0
votes
0answers
8 views

Handling nPeriphRequest in IEEE 1284 ECP as an interrupt

I don't know if this is the proper forum for this. This can be as much system architecture and software as "electronics". IEEE 1284 is the standard that governs the PC Parallel port. It has ...
0
votes
1answer
63 views

MSP430 Timer Interrupt Not Triggering

I'll post my code below. The problem is that the MSP's ISR_TRAP function (a function that handles ISRs that are not otherwise handled) is triggering and trapping me in its endless loop. This happens ...
0
votes
0answers
77 views

STM32 CAN Interrupt causes program to jump in infinite loop

Struggling with this issue for days now and can't find a solution. Maybe someone saw something like this before and can give me a hint. I have FreeRTOS running on an STM32L4 with different tasks. One ...
3
votes
2answers
202 views

ESP-32 not working with big motor

I have spent the last two months trying to build a door controller for a chicken coop. The idea is simple: The ESP32 recieve signal from my house Wi-Fi to close or open the door. So the corresponding ...
2
votes
1answer
72 views

GPIO- Interrupt on a non-interrupt pin?

If a GPIO pin is not interrupt configurable as external interrupt, is it still possible by any chance to detect the button press on the pin without polling just like an interrupt?
0
votes
0answers
46 views

Why Arduino not receiving RS485 data?

I am trying to send data from Arduino mega (message "ping") to Arduino nano, then send back (message pong) to the mega board, I am not receiving "pong" back to the mega board, why ...
0
votes
1answer
101 views

Pushbutton Circuit - Triggers Event when no button press

I have been using the circuit below. I have noticed there are times the circuit will trigger on its own without any button press. Sometimes it can trigger a few times within an hour. The components ...
1
vote
0answers
61 views

STM32 - Configure Output Compare Registers on the Fly

since this is my first, feel free to give newbie a feedback :) I have a following setup with my STM32 Nucleo (simplified, ignore the HW behind): a) one input signal acquisition (Square wave, consider ...
2
votes
2answers
111 views

Interrupts using member function

I am trying to use a member function in an interrupt. The function uses member variables so I created a global instance of that class to use it in a static function. The problem is that I created a ...
0
votes
0answers
161 views

Input Capture with MCPWM on ESP32

I'm trying to capture a digital signal that consists of 8us HIGH pulses with 8us or 16us LOW pauses in between. There are additional LOW pauses of about 6ms (yes, ms) that separate data frames. I'm ...
2
votes
3answers
69 views

Best way to implement a global FAULT input

I've got several microcontrollers multiple feet away from each other in a network that must be able to be put into a shutdown state all at once, ideally before power loss. I want to trigger a shutdown ...
0
votes
1answer
179 views

STM32 - cannot properly send UART response because EXTI frequently interrupts UART handler with higher priority

I'm using STM32F4 with HAL. It is configured as a simple counter as it counts pulses via EXTI interrupt. I want to asynchronously ask for the current number of impulses via UART. Highest frequency of ...
3
votes
3answers
450 views

How does the Arduino NANO deal with simultaneous external interrupts?

I am a beginner with Arduino NANO and this is something I've been trying to figure out for a few hours now. Say, in setup(), I have the following snippet of code: ...
1
vote
2answers
119 views

Context Switch in C in 32-Bit MCU

I am trying to understand the concept of 'Context switch' in reference to C-language and 32-bit MCUs. For example if I am programming STM32F407 MCU in C-language using STM32CubeIDE and I want to ...
0
votes
1answer
37 views

STM8 alarm firing shortly after resetting time

I'm using an STM8L151F3 with the SPL, compiled with SDCC. I'm trying to generate an alarm interrupt after n seconds, then another after m seconds. To do that, I reset the time to 0, then set the alarm ...
-3
votes
1answer
39 views

Converting 3-bit binary to Octal using RB0 ext. INT

I am tasked with converting 3 bit binary number to Octal whenever the rising edge of the RB0 interrupt occurs, that I can do easily, the problem is that it is required to be displayed on a 7-Seg. ...
0
votes
0answers
35 views

STM32F103C6 hodls SCL because of RxNE set BTF set and DR hasn't been read after first data byte received (hard fault when the data is received)

I'm trying to send a dat from master to a slave (the STM32F103C6) with HAL functions, with HAL_I2C_Slave_Receive() -no interrupt mode- the reception works flawlessly but with HAL_I2C_Slave_Receive_IT()...
0
votes
1answer
51 views

__enable_irq() Intrinsic Infinite Loop

I'm implementing a system based on the STM32L0 line of microcontrollers that uses an external interrupt to trigger an SPI read from an external sensor (a DW1000 UWB module). I am not running any sort ...
0
votes
1answer
55 views

Interrupt deduplication with discrete components

I am playing with interrupt mode 2 on a z80. Once pulled low it will disable interrupts and make a subroutine call to 0x0033. Before returning from the interrupt handler, interrupts should be ...
0
votes
1answer
164 views

WEMOS D1 R1 Interrupt repeats continuously, when triggered, Is it bouncing? How to fix it?

I am having such a nightmare to make it work, I am using a WEMOS D1R1 to handle the movement of an encoder via external interrupts. Instead if detecting the edge (L to H), it detects the status, so ...
7
votes
2answers
427 views

How to set an oscilloscope for measurement of interrupt service routine execution time

I have been developing control software and I need to know how much time it takes to execute an interrupt service routine (ISR). I have decided to use a dedicated GPIO pin of my microcontroller and an ...
1
vote
0answers
87 views

Configure STM32 to sleep inside an ISR

I am doing a test project to test the STM32's sleep mode feature. The project involves two microcontrollers: STM32F411 with a push button, which when pressed, sends data through SPI to an STM32F303 ...
0
votes
1answer
57 views

Does not Reset Handler move along with NVIC vector table?

My board: STM32F407G-DISC1 (based on STM32F407VGT6 microcontroller) See reference manual. (pages around 371 are related) My understandings Each interrupt service routine is located in a memory address,...
0
votes
2answers
46 views

Brown-out detection with an external clock ATmega1280

I'm using ATmega1280 with an external clock and I have some questions about the "safe operating area" for preventing EEPROM corruption with BOD. The external clock is: Crystals 14.7456MHz ...
0
votes
0answers
42 views

Using 32 bit variable in microcontroller to find elapsed time

I am trying to establish a time line (updated by soft counter) which would never end within embedded system product lifetime. For this purpose I think of using a 32-bit variable i.e. ...
0
votes
1answer
44 views

Bug and Best Practices for Interrupt Handling/Organization

I've read a few documents on best practices for interrupt handling and thought I was doing things correctly, ensuring the variable set in the ISR was declared volatile. In my code the interrupt ...
1
vote
1answer
101 views

Base addresses and offset values for registers, STM32 documentation

See the document here. From page 193: This table looks like stating that the base address for NVIC block is 0xE000E100. The table below from page 208 states that <...
0
votes
1answer
37 views

Control software for three phase induction motor

I have been writing a control software for field oriented control of three phase induction motor. As far as the platform I have been using the FreeRTOS real time operating system. My plan is to ...
1
vote
2answers
71 views

Cortex M0 - Defining an interrupt routine in assembly

For a project I have some code that needs to be written in assembly due to precise timing requirements. I'd ideally like to implement my code in a timer interrupt routine. Right now, in C++ I can ...

1
2 3 4 5
15