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
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
445 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
630 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 ...
2
votes
0answers
2k views

How to properly send stop condition when using DMA with I2C?

I'm using DMA transfer to get 1024 bytes from master (STM32F407VG) to slave OLED screen (SSD1306). The library I'm using does this: ...
1
vote
1answer
694 views

Timer1 on ATtiny85 not working as expected

I am trying to use Timer1 on the ATtiny85 (Adafruit Trinket) to blink an LED every second. The prescaler value is 1024, and the compare register value is 28. I loop through this 279 times to get a ...
1
vote
1answer
988 views

How do I configure the LIS3DH as a pedometer that generates interrupts when walking?

I found a lot of algorithms for pedometers that assume a fast CPU with a decent ALU and high sampling rates, which I don't have. (Z80) However, the LIS3DH has various options for generating interrupts ...
4
votes
1answer
326 views

How to get I2C to shut up while waiting for data in master transmit mode on LPC1114

I have an LPC1114(FN28) that I am writing some code for. Currently I am trying to provide an asynchronous view of the I2C interface to my code (the chip has a built-in I2C controller). The controller ...
0
votes
0answers
135 views

PIC18 port b interrupt on change is very sensitive

I am running a stepper motor with my PIC18F46K80 microcontroller. This microcontroller offer me the port b interrupt on change feature which basically generates an interrupt if the state the port b ...
4
votes
2answers
1k views

Software timers and interrupts on a microcontroller

I have few questions on software timers and interrupts on a microcontroller. Just for information, I use a dsPIC33E microcontroller. The final goal is to implement a serial communication protocol: ...
5
votes
4answers
2k views

Multithreading on AVR

If I have an AVR micro controller and have an ISR coming up about every 100 micro seconds or so, can I change the stack pointer in the ISR and then fake multi threading? Psuedo code: ...
1
vote
2answers
730 views

How to use UART rx data from ISR to main loop?

I am using PIC18F and currently trying to interface it with SIM900. I am using UART Rx interrupt. ISR is working correctly but I wonder how to get data in main loop. Lets say : ...
3
votes
2answers
1k views

FPGA Interrupt in FreeRTOS

I am using freeRTOS in Zedboard. I am able to enable the PL-PS interrupt in bare-metal program. I couldn't really find any documentation/tutorial on how to link the FreeRTOS and the PL interrupt ...
1
vote
1answer
364 views

AVR ATmega: can I trigger external interrupt by setting corresponding INTF flag bit?

I'm writing a C program for ATmega64A which has a INT0 ISR. This ISR should be executed in case of INT0 falling edge OR if the TIMER3 goes overflow. To avoid doubling the code I'd like to trigger ...
4
votes
2answers
3k views

STM32F4: WWDG interrupt fires as soon as it's enabled

I'm doing some coding on an STM32F411 board, used the CubeMX & HAL Libraries for laziness. I'm trying to get the windowed watchdog (WWDG) up & running, and doing the very basic version (non ...
3
votes
2answers
152 views

Pic16 Timer0 puzzle

INTRO The whole point of a timer with overflow interrupt is that the interrupt will trigger on a precisely timed interval - so long as the code executed in the interrupt doesn't take longer than the ...
2
votes
3answers
1k views

Logging multiple sensors data to SD card at same time: writing hangs up

I'm making a data logger project with 5 different sensors which includes a 3-axis sensor runs at 800 Hz. My requirement is to log the data to an SD card. Here I have to log 3-axis sensor @ 800 Hz and ...
2
votes
2answers
637 views

CMOS circuit design: How to implement an interrupt circuit that detects minimum or maximum peak?

I have an input signal sine wave like but comes with a little distortion. I need to give an interrupt when it reaches to minimum or maximum value with an acceptable tolerance. this graph is from a ...
0
votes
1answer
642 views

Timer causes UART problem

I have a problem, found on both ATMEGA1284P and ATMEGA2560. I have set a 16-bit timer in CTC (tried both Timer1 and Timer5) to give an interrupt every 1ms so I can increment a 32-bit volatile time ...
0
votes
1answer
6k views

ADC continuous conversion STM32F103

I'm facing with a problem regarding continuous acquisition of ADC channel in STM32F103. I use the interrupt at the end of conversion to call a callback function to store the acquired value. The ...
0
votes
2answers
565 views

Modifiying variable inside of Interrupt vector. AVR

My question is again about modifying variables inside the ISR. If the variable used only inside of ISR, I don't have to declare it as volatile, right? After some researching, I figured out that ...
0
votes
1answer
81 views

AVR MCU running @ 32.7Khz Low speed LED multiplexing problem interrupt

Works fine with internal 8mhz, but when change to 32.7Khz, the multiplexing led display is not working properly (it's flashing very randomly). is this the limit of low clock speed or is there a ...
2
votes
0answers
651 views

AVR interrupt setup seems to stop program execution

On ATMEGA168PA I have problems with interrupt-driven character reception over UART. When I include the line setup_interrupt() it seems that program execution stops ...
0
votes
2answers
1k views

Can this stm32f0 interrupt routine that activates on every byte received be fast enough for 6Mbps?

I am using the STM32F0 discovery board. I am looking at this tutorial on UART with the STM32F0. http://letanphuc.net/2015/09/stm32f0-uart-tutorial-5/ ...
1
vote
2answers
361 views

Generating pulses via timer match output or timer ISR?

I'm using LPC1778 uC for a project and want to know what is the difference between generating pulses via timer match output and via toggling a pin in a timer ISR. What are the pros and cons of both ...
-1
votes
2answers
164 views

Methods of testing interrupts

I am maintaining and developing software in C for S12X micro controllers. The ISR for each interrupts (like I2C, Timer Interrupts etc) are very lengthy, like around 20 to 30 lines with several ...
3
votes
3answers
1k views

Polling vs Interrupt: which one is first in a bare-bone piece of hardware?

First of all, I must say that I have a computer science background, and I don't have much knowledge about hardware. I would like to ask this question because in software, what I often see is a loop, e....
-5
votes
1answer
112 views

Large timer interrupt instructions [closed]

Assume that it takes the micro-controller 1 microsecond to execute an instruction and the timer overflow has also been set to 1 microsecond and in the timer interrupt handler we have some instructions ...
0
votes
1answer
75 views

Variations in pulses generated and read by a uC

I have a 2 uC's(LPC1778 and a PIC), that perform 2 separate functions. The PIC generates pulses that are coded,where each bit of the code has a pulse duration of 1ms and a complete code is 8 bits long(...
1
vote
1answer
161 views

Priority among prioritised interrupts

I am using 2 interrupts on LPC1778. One for CAN and one for timer. The CAN interrupts whenever a new message is received. The timer interrupts every 200uS. The priority for timer interrupt is the ...
2
votes
3answers
1k views

Uart Transmit every 1µs Interrupt StM32 NucleoF401-Re

I am using the STM32 Nucleo F401-RE and HAL libraries. I would like to send value through UART to the PC console every 1µs interruption. Actually I want every 1 µs interruption to increment a ...
1
vote
3answers
201 views

Deciding Timer Interrupt time

I have used timer interrupt in my application, mainly for timing reasons like timeout detection for processes,pulse generation etc, every 1 ms. Now i have a doubt. Suppose in main(), if im doing ...
0
votes
1answer
327 views

How do you implement an Energia interrupt handler?

So, I have an application that needs to be very conservative with the power. I use the suspend() command to go into LPM4 and wait for an interrupt to occur. During the interrupt, I attempt to ...
1
vote
1answer
713 views

How do you use low-power mode on an MSP430G2553 using an Energia sketch?

I am using an energia sketch to program my MSP430G2553 controller. I need to know how to use low-power mode. Do I leave the loop section of the sketch empty and set up an interrupt in the setup ...
1
vote
1answer
2k views

How to count using Interrupts

I have an issue where I want to count how many times I hit a switch using an interrupt. I tried placing the count variable inside the main but it claims that count does not exist. I put count inside ...
1
vote
1answer
774 views

How to use the Non Maskable Interrupt on SAM4S?

I'm trying to use the NMI on a SAM4S (Cortex M4), but I'm finding some hard time to make it work. The main objective is to jump to the NMI handler whenever the power is about to go down, so that I can ...
1
vote
1answer
477 views

Does Interrupting a Microcontroller Data Receive with a Higher Priority Interrupt Cause Data Loss?

I would like to know what would happen if a Serial Terminal were to send a large amount of data to a PIC/AVR, for example over USART interrupt, which was then interrupted by a higher priority ...
4
votes
2answers
3k views

Reset Interrupt - Beginning or End of ISR?

Im working on a uC that has interrupts configured for various FIFO's present in the uC. Each FIFO is connected to a common bus and can receive data independently(at any point of time). Now, everytime ...
1
vote
1answer
2k views

stm32f207 ethernet interrupts problem

I installed RTX (rtos from Keil) and Ethernet library from STM for stm32f207 MC. I configured UDP using ethernet + LwIP as in examples from STM. Without RTOS UDP works fine. I send and get packets ...
10
votes
2answers
2k views

Enable interrupt but no ISR

I would like to know what happens if an Interrupt is enabled(ex:Arbitration Lost Interrupt in CAN module of NXP's LPC1778),but no ISR has been defined for the interrupt. When such an interrupt occurs,...
3
votes
2answers
6k views

STM32: UART Interrupt is triggering without any flags getting set

I am using the UART4 module of an STM32F105. I'm using the RXNE ("RX Buffer Not Empty") interrupt to grab data as it comes in. It's working as expected. When the RXNE interrupt is enabled it also ...
-2
votes
1answer
464 views

Interrupt programming PIC18F4520 :: Toggling LED

[Edit: replaced sideways photo with upright photo] I recently started using interrupts in pic programming. I started with this program but I am not able to go through what has been done in this ...
0
votes
2answers
2k views

Difference between FIQ and IRQ

Im working on TI based processors now and they have 2 types of Interrupt configuration(FIQ or IRQ).I have seen such interrupts before when i was doing a hobby project using a LPC1778 but since i didnt ...
1
vote
0answers
433 views

Context Switch without interrupt disabled?

I developing a program on ARM M4 where I don't actually want to disable interrupt even when doing a context switch. If any interrupt occurs during context switch, is it possible to handle it soon ...
2
votes
2answers
1k views

Systick interruption doesn't trigger when handling another interrupt

I am experimenting with the STM32f4 discovery and i tried to use a delay (based on SYSTICK) in an ...
0
votes
2answers
2k views

Sensing Voltage with a Digital Pin

I am relatively new with Arduino and did a little bit of research prior to this post. But I am trying to sense when I have voltage coming from an AC/DC converter (12Vdc) so I can switch from my ...
4
votes
1answer
769 views

UART Interrupt does not get more than one Char - PIC32MX110F106B

I am really struggling with an UART communication with my PIC32MX110F016. It is the first time I am trying to implement an UART communication with PIC32MX family but I find it difficult and I don't ...