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
3
votes
3answers
244 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: ...
0
votes
0answers
40 views

Which Arduinos support ATOMIC_BLOCK?

Is there a definitive list of which Arduino architectures support the ATOMIC_BLOCK() macro, and a list of #defines for each ...
1
vote
2answers
61 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
15 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
37 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
33 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
41 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
54 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
78 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
384 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
43 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
44 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
35 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
41 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
36 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
35 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
35 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
61 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 ...
0
votes
1answer
37 views

A statement which is not clear to me on NVIC configurations

See the document here. I am interested on using external interrupts, and trying to configure NVIC at register level. The statement below, which can be found in page 215, confused me: Each priority ...
0
votes
1answer
70 views

How to implement C language driver for SPI peripheral [closed]

I have been implementing device driver for the SPI peripheral of the MCU in C language. I would like to exploit interrupt mechanism for reception and also for transmission. As far as the reception ...
0
votes
0answers
72 views

STM32: Why can't I use scan mode in interrupt-driven ADC?

I'm using an STM32F103C8 to read 3 ADC channels, and have used CubeMX + HAL to configure the ADC to shuttle the ADC values into a buffer. I've been able to accomplish this with DMA and polling: I've ...
2
votes
3answers
165 views

getting interrupt from ignition circuit

This transistor ignition circuit for a model petrol engine is built from a proprietary kit. I have made it up and it works. Now I want to take a signal from it as an external interrupt to an Arduino ...
0
votes
0answers
50 views

STM32G474 HAL Interrupt problem

I've just started learning STM32. I want to make a simple code that uses UART in interrupt mode. Unfortunately I can't make it work. I want an interruption occur when the microcontroller receives a ...
1
vote
1answer
55 views

Is this the correct truth table to determine whether or not to execute an interrupt in a RISC V system?

I'm working on implementing the privileged RISC V ISA, which can be found here. I'm looking at the bottom of page 20, and the interrupt conditions are stated very confusingly: Global interrupt-...
0
votes
0answers
21 views

Multiple Sensor Interrupt Combine?

I built an IoT device that sleeps and wake with Texas TPL5111. (Timed wake system with external wakeup option). Also i have external sensors and want to awake system with sensor interrupts. 2 wan on ...
1
vote
0answers
61 views

TXE Interrupt is not generated ARM STM32F103C6

I'm trying to write a class to have the possibility of sending data using UART by TXE (TDR is empty) Interrupt. The class uses only USART1. The class has a ring data buffer to send. I have written a ...
0
votes
0answers
32 views

AVR Interrupt: LED kept blinking and won't stop

Lately I realize I am still a newbie, when you can't blink a freaking LED properly. It's kinda sad. I try to simplify this LED code to the simplest form possible, and it still won't work properly. ...
0
votes
0answers
49 views

Using interrupts with W65C02 and W65C22

I’m trying to use the interrupts of the 6502 and 6522. I want to read the value of PORTA whenever the “READY” line I have is HIGH. I think I understood that I have to put the “READY” line on CA1 and ...
1
vote
3answers
101 views

How to leverage CAN bus Mailboxes in my embedded systems?

I don't understand how to leverage CAN bus Mailboxes in my embedded systems. I think I don't use them properly because I don't understand the problem they are trying to solve. Here's a simple example ...
0
votes
1answer
27 views

How are these Data Buffering Methods same or different from each other?

I am trying to understand the operation of a Serial Bus protocol converter chip. It connects with the serial bus on one side and on the other side it provides its data on the MCU host interface. ...
1
vote
1answer
39 views

Where is Interrupt Vector Table stored in ATmega32A?

Given that Atmega32A has three types of memory : 1) SRAM. 2) Flash (Program memory). 3)EEPROM. In which section the Interrupt Vector Table is stored ?
0
votes
2answers
107 views

PIC18F Rotary Encoder Code Help XC8

I'm trying to interface a rotary encoder with my pic18f4550. Just trying to get it to increase/decrease the variable output and then display that value through the ...
1
vote
0answers
58 views

What is the difference between TIMx_IRQHandler and HAL_TIM_PeriodElapsedCallback function?

I am a beginner, I am using the stm32F103 interrupt function TIM1_IRQHandler function to count, but HAL_TIM_PerodElapsedCallback can also achieve accurate counting, which one should I choose to use? ...
0
votes
0answers
50 views

Atmel SAM3X / SAM3A, handle interrupts from Parallel Input/Output Controller (Peripherals)

I want to enable the PA8 pin in a processor (Atmel SAM3X / SAM3A). I have set: PIOA_MDER[7]=0 PIOA_MDDR[7]=0 PIO_OER[7]=0 PIO_ODR[7]=1 so that the tri-state ...
1
vote
0answers
36 views

Dealing with flash erase time

I am trying to use an STM32 micro-controller as a USB mass storage device using an AT25SF041 flash chip for the memory. I know flash integrity degrades over time but its only going to have a file ...
0
votes
1answer
26 views

Multiplies I / O reading with interruption in stm32f767zi

I am developing a board where 40 low I / O ports will be read, and I would like when I detect a low border to activate interruption for reading the port. in the documentation it says that "Up to 168 ...
0
votes
0answers
31 views

ADC Triggering with TIM3 TRGO running in PWM mode in STM32F446

I have been trying to trigger an ADC using TIM6 with TRGO signal in STM32F446RE board. I am unable to do it. I have used CubeMX initialization and have been trying to use the HAL libraries for ...
0
votes
1answer
74 views

Interrupts and Assembly language

How to use the RBO external interrupt to read PORTB (RB4 to ...
0
votes
1answer
55 views

Error interrupt funcition with MPLAB X v5.30 XC8

I am programming a pic18f4550. When I try to compile the project I get two errors. According to what the console indicates, they are caused by the following function. ...
1
vote
1answer
63 views

How to achieve an interrupt frequency of 100 kHz on SAM E70?

Setup: ATMEL Studio 7, ASF3.47.0, SAME70 XPlained eval board. In the minimum working example shown below, I use the onboard LED for visualizing if the timer and interrupt enabling have executed. <...
0
votes
0answers
42 views

Hardfault or otherwise wonky timer behaviour - STM32 Cortex M7

I am using the line marked by the arrow in the code below as such and it works fine. If I uncomment // HAL_TIM_IRQHandler(&htim2); there is one hit on the ...
0
votes
2answers
83 views

AVR MCU Interrupt toggle a LED problem with 100 extra toggle

I am playing around with an AVR MCU. I am having trouble toggling a LED. It's being toggled faster than I have expected. It should be toggling at 500hz, but it's up to 600hz and not very stable. I ...
0
votes
0answers
25 views

I2S DMA interrupt gets fired but no data is available

I'm trying to read the I2S stream between a Raspberry Pi and a Hifiberry DAC with a STM32G071 and was able to implement the I2S DMA with the associated interrupt (or at least I think so). But ...
0
votes
1answer
46 views

Interrupts are firing when touching ground with metallic things

I'm making a circuit on a breadboard (before SMD design) for a battery-powered device. When USB is connected to any wall-adapter, the device wakes up when touching any ground wire on the breadboard ...
1
vote
1answer
62 views

Checking interrupt flags for UART data receiving and transmitting on STM32

I'm trying to develop a UART receiver/transmitter for an academic project. For now i developed the UART continuous data receiving part and it works quite well. Here is the code: Interrupt file: ...
0
votes
0answers
30 views

How can I add a SVCall handler to the Vector Table of a CC2652 device

According to the CC26xx Driver Library documentation there are two options for adding interrupt handlers, one dynamically and one statically. The static registration of handlers seems to be the ...
0
votes
1answer
28 views

in AVR, if i use .ORG 0 with the main program , where is the interrupt vector table and .INCLUDE file data go?

I am studying AVR from the book "the AVR microcontroller and Embedded system by Mohamed mazidi" and "atmega32A data sheet" in the book, it puts samples of cade which start like this ...
0
votes
3answers
84 views

Implicit declaration is invalid warning for __set_BASEPRI() function in Keil

I'm trying to use a __set_BASEPRI() function in Keil to set up interrupts in STM32F407 but it doesn't work when I compile the code and the IDE shows warning "...
0
votes
1answer
61 views

Which ASCII character could interrupt communication?

Which ASCII character could interrupt or terminate or otherwise disturb communication on the reciever part. Not including acknowledgment, handshakes, identification or other programmed protocols. ...
0
votes
2answers
87 views

Verilog design question: How to generate internal interrupts without delay?

I made a single-cycle RISC CPU in Verilog, and it works well on a real FPGA I have. It has multiple components that communicate over an internal bus. One of these components is a programmable timer, ...

1
2 3 4 5
15