Questions tagged [interrupt]

Use for questions related to interrupt signals and interrupt handling.

In computing, an interrupt is an asynchronous signal indicating the need for attention or a synchronous event in software indicating the need for a change in execution.

A hardware interrupt happens in response to some hardware event (say mouse movement) and causes the processor to save its state of execution and begin execution of an interrupt handler. At the same time, the possibility for this interrupt is disabled (to prevent it happening repeatedly) and must be re-enabled by software after the current interrupt has been serviced.

Interrupts are usually identified by number, and normally there is a system table somewhere in the OS that maps this number to the address of function that must service the interrupt.

Software interrupts as seen by the programmer do not differ much from the usual function calls. However they are usually implemented as specific instructions in the instruction set so may require less code to be called. Software interrupts are processed in a very similar way to the way hardware interrupts are processed, often using similar context switching and a shared interrupt table for both.

3261 questions
1
vote
3 answers

Switch to Kernel Mode - Privileged Instruction

I studied that The instruction to switch to kernel mode is an example of a privileged instruction. The hardware allows privileged instructions to be executed only in kernel mode. But if the switch to kernel mode can be only executed in Kernel Mode…
Tantaros
  • 113
  • 1
  • 7
1
vote
1 answer

PIC32MZ UART RX Interrupt

Porting from PIC32MX to MZ (PIC32MZ2048EFG100) and am banging head against wall trying to generate a simple RX interrupt on UART3. Please see code below. void main(void} { __builtin_disable_interrupts(); //Ensuring all pins config as…
1
vote
1 answer

What's the difference between Thread.interrupt() and Thread.currentThread.interrupt() in Java?

I wonder that whether Thread.interrupt() and Thread.currentThread.interrupt() do the same thing or will give the same result? If not, what's the difference? The similar quesiton is: what's the difference between Thread.sleep() and…
Hesey
  • 4,957
  • 6
  • 31
  • 31
1
vote
0 answers

Keypad 4*4 with Arduino

I am using keypad 4*4 with an Arduino Mega, I have sensors connected to the Arduino I want to press a key from the keypad and have response in the same time, I don't want to wait till the loop continue, I want to save up to 10 numbers entered from…
1
vote
1 answer

Interrupt STM8s issue with SDCC compiler

I want to use interrupts on the SMT8S003K3 (STM8SVL-DISCOVERY) and somehow it does not get recognized when I use the interrupt on a other file where my main() is located. I made two tests: - first I modified this code to Standard Peripheral…
K0ertis
  • 121
  • 1
  • 9
1
vote
1 answer

TM4C123GX - why isn't 16/32-bit Timer0A interrupt working?

I'm trying to program a TM4C123GX Launchpad in Assembly to turn on an external LED periodically using the 16/32-bit Timer0A. I followed the instructions in the user manual (TM4C123GH6PM) but for some reason it isn't working. I turned on the timer…
Fua
  • 55
  • 9
1
vote
1 answer

Simulate a Hardware Timer Interrupt in C

I want to understand RTOSs better and therefore started implementing a scheduler. I want to test my code, but unfortunately I have no HW lying around right now. What is an easy way to pretend executing an ISR corresponding to timer in C? EDIT:…
m3x1m0m
  • 105
  • 8
1
vote
2 answers

handling reset in embedded systems

I was asked to work on bootloader program for embedded system. Main function of bootloader is to execute application. Normally, without bootloader, memory organization for application was rather simple: 0x00 Reset 0x00000004 intrreupt…
JosiP
  • 2,619
  • 5
  • 29
  • 33
1
vote
2 answers

C: Using static volatile with "getter" function and interruptions

Suppose I have the following C code: /* clock.c */ #include "clock.h" static volatile uint32_t clock_ticks; uint32_t get_clock_ticks(void) { return clock_ticks; } void clock_tick(void) { clock_ticks++; } Now I am calling clock_tick…
Peque
  • 13,638
  • 11
  • 69
  • 105
1
vote
1 answer

Why can't I break an *.Rdata loading process?

It seems that R is not responding when trying to break loading an *.Rdata file with load("*.Rdata"). What is the reason and is there a way around? I tried to break several file loading processes with different files and sizes. The only possibility…
jay.sf
  • 60,139
  • 8
  • 53
  • 110
1
vote
1 answer

External Interrupt Setup on STM32L1 doesn't run ISR

for 4 days now, I am struggling to set up External interrupt on my STM32 and I have gone through tons of reading and other people's code to get it. But no luck. I have two buttons and when pressing either one of them I expect to light up an LED,…
1
vote
1 answer

Weird behaviour of timer2 on ATmega328

I'm currently working on a piece of code, which should wait for a comparator interrupt and execute some other code after a set amount of time. Now, I thought using Timer2 in CTC mode would be a good idea to make sure that the program waits for the…
Gnarflord
  • 230
  • 2
  • 9
1
vote
1 answer

ARM Cortex M NonMaskable Interrupt is NonClearable also?

I am working with a very custom and not public Secure IC which has ARM Cortex M3 core. In case of hw security violation, this IC triggers an NMI interrupt so it is fine, I am doing whatever I need for violation. But It always enters into NMI…
muratcakmak
  • 325
  • 2
  • 14
1
vote
1 answer

I2C in Master mode Reading 2 bytes from LIDAR SF20

I have STM32F103 microcontroller and I want to interface it with LIDAR using I2C bus in Interrupt mode. It's working fine in Polling mode. Problems i have faced is: -- Bus has not been released after reading 2 bytes. can some one explain me that how…
Vikas
  • 76
  • 9
1
vote
0 answers

AVR external interrupt code gets blocked

I am working on Arduino sleep and an external interrupt. I got sample code from here, which works fine. I have made certain changes and additions in the code, at AVR wake up I am checking a button state, waiting until the button is pressed. The…