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
6
votes
2answers
593 views

Nanosecond interrupt accuracy on a 64MHz microprocessor

I am currently designing a PCB with a 64MHz nRF52832 bluetooth MCU. I have an interrupt connected to this MCU which needs to be detected with 1-3 nanosecond accuracy. Unfortunately, the 64MHz MCU has ...
2
votes
1answer
581 views

AVR: why each Interrupt Vector occupies two instruction words

During my study of Atmega328 datasheet I found that each interrupt vector occupies two addresses and after searching i can not find why that. That is a screen shot from atmega328p datasheet page 82
-3
votes
1answer
107 views

Interrupts and Storing [closed]

Which critical processor information is stored when a program is interrupted by a hardware interrupt source ? Where does the CPU keep the information ?
3
votes
1answer
4k views

How to distinguish between GPIO interrupts from the same interrupt handler?

I'm trying to interface a few modules to my STM32L476 board for which I need to enable two GPIO interrupts from the same port (portA, pin 5 and portA, pin 6), but the interrupt handler for these pins ...
0
votes
2answers
1k views

Delay doesn't work (avr attiny 26, delay.h)

I am trying to learn how to write programs to microcontroller, and started with very simple things like LED blinking with given frequency, or controlled by button. However, I have problems with using ...
2
votes
2answers
464 views

Unexplained interrupt behavior in AVR ATMEGA324P Timer Counter ISR

I have an ATMEGA324P controlling a dual motor driver circuit. I'm using the 16-bit Timer Counter 1 in Phase and Frequency Correct mode to create (2) PWM outputs using the ICR1 as the TOP value and the ...
0
votes
1answer
119 views

MCU (Atmega644p) PWM without interrupts

I have an Atmega644p which is connected over SPI to a MCP2515 can-controller. In the MCU I use time based interrupts to send messages to the can-controller, which he translates and sends onto the ...
1
vote
1answer
652 views

NodeMCU / ESP8266 - Light Sleep Wakeup via SIM808 RI (Falling Interrupt)

I have a NodeMCU v1.0 and a SIM808 Circuit board. To save power I put the NodeMCU into Lightsleep via: ...
3
votes
0answers
352 views

STM8 nested interrupt bug, not described in current errata sheet ES019

If main process execute WFI with AL bit set in CFG_GCR, changing I1/I0 priority bits in the ISR cause CPU stalled when nested IRQ occured. Preconditions: all ITC_SPR1 registers has default value 0xFF....
0
votes
2answers
3k views

Arduino Atmega328 sleep mode with internal timer interrupt

I am trying to reduce the current consumption of my Atmega328 -Arduino- by using the sleep modes. In my code, I want to wake-up every 10ms, read the value from ADC, ...
0
votes
1answer
208 views

Why is MSI and MSI-X enabling at the same time prohibited?

The PCIe spec says that only one of MSI or MSI-X can be enabled. Else system behavior is undefined. What is the reason behind this? What is the problem if both are enabled for a PCIe function? ...
0
votes
1answer
500 views

Error in programming STM32F4 Discovery with IAR?

I program STM32F4 using External Interrupt, and there is an error below: Error[Li005]: no definition for "SYSCFG_EXTILineConfig" referenced from C:\Users\AnhDoan\Desktop\STM32\IAR[GPIO ...
2
votes
1answer
952 views

STM32 - AHB Prescaler disabling Systick

I'm writing bare metal firmware for an STM32F070. When I set the AHB Prescaler (AHBCLKDivider) to a value greater than 1, the ...
2
votes
2answers
822 views

Ultrasonic sensor(ping) and deep sleep Arduino

Is it possible to use an ultrasonic sensor to wake up an Arduino which is in deep sleep when an object is detected within a few cm and then do stuff?
0
votes
0answers
188 views

How can I echo characters from UART0 to UART1

I am looking for a good tutorial or help in working with two UART's at the same time. I have UART1 connected to a BT modem and UART0 connected to a cell modem. I want to be able to have good two way ...
0
votes
2answers
860 views

Where should an ISR be declared in a library?

Suppose I have a library consisting of TWI.h and TWI.c which contains an ISR defined according to AVR-GCC syntax. For example: ...
3
votes
2answers
520 views

How to manually clear OC1A and OC1B?

On the arduino uno (= ATmega328/P), how can I manually clear the timer 1 output compare signal? The purpose of the code is to generate some output pulses after a precise interval from the input pulse....
-1
votes
1answer
101 views

What happens if we send consecutive CAN frames and wait for their acknowledge back?

I have a general question about CAN transmission and the acknowledgment. I want to send multiple CAN frames (burst frames), and after I receive them all in HOST, I want to read their ack from the Bus:...
1
vote
2answers
693 views

ATMega328P free-running ADC interrupt not firing

I'm playing with an ATMega328P running off a USBtiny 1.0, and have the following set up: Potentiometer to ADC0. PB0 sourcing current for a LED. My program then mirrors ADC0 to the PWM on PB0, so the ...
-5
votes
3answers
828 views

Variables sharing between interrupts and main task [closed]

This has become one of the most confusing part for me in embedded development. Recently i have written a software for measuring the time period of pulses using input capture and that variable say ...
0
votes
0answers
96 views

STM32L073RZ freeze because of an InterruptIn

I have a problem, I use an InterruptIn in a class to generate interruption when a button is pressed. In this class I just have constructor, destructor and callback for the rise and the fall. When I ...
1
vote
1answer
1k views

How to set by software interrupt of USART in NVIC? - in fact emulate it

After putting data into STM32 USART register DR, data is being transfered and interrupt occurs(TXE,TXC). NVIC jumps into my IrqHandler code. How to set this same interrupt by software(and run ...
1
vote
2answers
3k views

What are the advantages or disadvantages that using internal interrupt instead of external interrupt in MCU?

in my project it seems I must using internal interrupt instead of external interrupt because my MCU run out of external interrupt pin. Here is an internal interrupt example I've found here. I am ...
2
votes
1answer
1k views

Problem initializing SPI TX interrupt in STM32F103

I am trying to establish SPI communication from master to slave. I am able to send bytes over to slave, and is now trying to send when the TX interrupt is triggered. Below is code I used for master ...
1
vote
1answer
96 views

Need help tracking down the source of a delay between timer interrupts on SAM MCU

I have a project that outputs a series of values to DACs with a precise timing interval. The problem is that sometimes there is a delay longer than expected between the system timer interrupt in which ...
4
votes
3answers
5k views

Understanding difference between Interrupt Address and interrupt vector address

In my undergrads, I was taught 8051 and in interrupts my professor had said that on interrupt SP points to the address that is hardcoded and Program goes to excute those instructions. But in between ...
0
votes
1answer
2k views

STM8S - Why does my Timer4 Overflow Interrupt not work?

This is my timer 4 init: ...
0
votes
1answer
758 views

dsPIC33E External Interrupts INT0,INT1,INT2 not firing

I have read every post I can find and still do not understand why external interrupts are not triggering, the following is my initialization, it is not clean, as I am in the process of trying ...
1
vote
3answers
584 views

ATmega1284P int0 interrupt sw0

I want to toggle the LED3 of the microcontroller when the button SW0 is pressed. I developed this code but it is not working and I dont know what is wrong. I search in the documentation and many foros ...
8
votes
6answers
1k views

Differences between Interrupts and sampling for hardware button?

I have a hardware button I connected to an interrupt, but my problem is it bounces a bit, making the button press unreliable. I think a good deal of these issues would be solved by sampling in the ...
0
votes
2answers
527 views

preventing Rx/Tx data clashing on a xmega USART

I am using the USART module on an atxmega128a1 to communicate with a PC, and I've noticed that receiving and transmitting a byte uses the same data register address: My question is then, if I am in ...
0
votes
1answer
599 views

dsPIC33E - I2C master interrupt flag is never set

I'm trying to design a program that polls a real-time clock (DS1307+) every second via I2C. The microcontroller used is dsPIC33EP64GS506. I use a master interrupt flag to wait until a task (start or ...
1
vote
2answers
6k views

External interrupts in stm32f10x

I'm not quite sure how external interrupts will work with several peripherals on the same EXTI line. For instance, if I configured interrupt on line X and on the same line(of course another GPIO port)...
1
vote
3answers
9k views

STM32F031K6 HAL UART Interrupts problem

I got a new STM32F0 31 K6 nucleo board and I need to make a GSM UART interface on that board. I need to send an AT and receive an OK from the GSM board as a first step.I am able to transmit AT ...
0
votes
1answer
1k views

ATTINY85 interrupt confusion

I'm trying to get ATTINY85 to trigger ONLY on HIGH interrupt, but no matter what combination of bits I set for GIMSK and MCUCR, I can't get it to work; Here's my code: ...
0
votes
0answers
272 views

How to add Lptmr ISR to Interrupt Vector Table for Freescale K60DN board, ARM Cortex M4 Processor

I am attempting to use the low power timer of the Freescale K60 board. I have an interrupt handler written, and now do not know how to add the address of the handler to the interrupt vector table ...
2
votes
2answers
412 views

Is setting software flags an effective use of interrupts?

I'm currently working on a microcontroller(Arduino) project in which I wish to use interrupts generated by pushbuttons and timers. However, I'm not sure if I'm 'effectively' using the interrupts. Here ...
-1
votes
1answer
161 views

access variable within ISR? [closed]

I am currently counting steps of the movement of my stepper motor in a ISR, but cannot figure out where i should read in the incremented value (step_count) for ...
0
votes
1answer
109 views

Why is the signal sawtooth shaped? [closed]

I am currently working with interfacing a stepper motor (4-pin bipolar), and providing it the propper input signal, such that it accelelrate and decellerate correctly. In recently also across an ...
2
votes
2answers
640 views

Interrupt Vector calculation in PowerPC based controllers

I am working with Freescale MPC5534 based on PowerPC arch. I am not able to understand how the address of a particular ISR is calculated during runtime. There are three registers involved, INTC_IACKR, ...
2
votes
2answers
879 views

Missed Interrupt Problem with Attiny85

I'm trying to use an Attiny85 (digispark) to wake another controller from sleep (an ESP8266). The Attiny is connected to an IR receiver which has an active low output. Basically I have connected an ...
0
votes
1answer
283 views

measuring cpu usage [closed]

I have several interrupts that are working and I want to calculate the idle time that cpu is doing, and calculate their cpu usage too. so I have a while loop while(); and the interrupts are working....
3
votes
1answer
1k views

How can I tell Microchip's XC8 compiler that I am using a custom interrupt handler? It tries to place other code at address 4!

I'm developing firmware for the Microchip PIC16F882 microcontroller using their MPLAB X IDE and the free version of their XC8 C compiler. I'm running into a small problem when trying to add a ...
2
votes
4answers
438 views

Protect user space critical section from interrupt

I am using Beagle Bone Black with Arch Linux ARM OS to communicate with ltc-6804 chip via SPI port. I have came to a point that the interrupt from the OS in the middle of sending read command and ...
2
votes
1answer
616 views

Atmega328P Watch Dog Timer - Delay Issue

I am trying to give delay of 0.5 seconds on 13 pin of the arduino using Watch Dog timer interrupt, the code complies and works fine but the led is blinking so rapidly that it seems like it is ...
0
votes
1answer
124 views

do two I/O microcontroller pins that are connected to each other require an external resistor?

I'm trying to make two atmel AT89C2051's communicate with each other serially but the serial ports on either won't be available because one serial port on one chip connects to the computer and the ...
0
votes
1answer
53 views

How to change the reading from an ADC of 10 bits to the timer 0 registers using a PIC18f4550?

I a reading an anlogue value using the 10 bits ADC from the Channel 0. I have implemented an interruption using timer 0, where I set some value for the registers of timer 0 (TMR0H and TMR0L - 8 bits) ...
1
vote
1answer
3k views

How to check if specific peripheral interrupt is enabled in NVIC?

I'm using an STM32F4 Discovery board with ST's standard peripheral library (SPL). I have a situation with a circular buffer: timer interrupt is polling buttons and filling a circular buffer every ...