Questions tagged [isr]

1

votes
1

answer
86

Views

How do I specify an interrupt vector based on a parameter?

I am working with an Arduino Mega 2560 and have an application which requires the use of one of three different timers based on a parameter passed in by the caller. I need to be able to do something like this: ISR(TIMERX_COMPA_vect){ foo; bar; } Where X is the number of the timer passed in by the ca...
1

votes
0

answer
48

Views

What are the names of the kernel threads that represent ISR top-half and bottom-half?

Using google, I know that the linux kernel interrupt handling thread is divided into two parts, the top-half thread and the bottom-half thread. I want to see on which CPU these two kernel threads reside. I use top command on Fedora 19 to find the interrupt service routine (ISR). Taking NIC ISR as e...
cwang.sh
1

votes
0

answer
342

Views

Strange behaviour of STM32 ADC with external trigger

I'm on STM32L476. I have setup my ADC to be triggered by TIM15. There is only one channel, single conversion mode. On ADC side, to enable interrupts I clear the ADC ISR register and then set ADC_IER, before starting the conversion. If I enable in AED IER both EOSIE and EOCIE, everything works fine i...
1

votes
1

answer
285

Views

ADC interrupt not getting called

I want ADC Interrupt Service Routine to be called after each End of Conversion. However it is not being called. Here's is my code: #define RCC_APB2ENR (*((volatile unsigned long*) 0x40021018)) #define ADC1_CR1 (*((volatile unsigned long*) 0x40012404)) #define ADC1_CR2 (*((volatile unsign...
Muzahir Hussain
1

votes
1

answer
868

Views

How to measure ISR execution time?

I am on linux kernel 2.6.32. I am facing an issue in which one of the two ISR (serial and ethernet) are taking more time (hundreds of microseconds) on several occasion/under some scenarios which I don't know. I would like to get the time difference every time the ISR executes. What would be the bes...
user1867459
1

votes
1

answer
86

Views

Digi S2B Modules, button interrupt routine

I'm designing an application using Freescale CodeWarrior IDE with Digi Extension. I've created samples application and used them. That worked quite fine but I had some problems with IRQ. If I use an IRQ component, I'm not always entering the interrup routine. I mean that when I press the button, I d...
Dounie
1

votes
1

answer
213

Views

Multiple triggers on a single interruption on Arduino

I am working on Arduinos and I would like to use interrupts to use a rotary encoder. But I would like to reduce the interrupt code to the minimum. Can I use multiple triggers on a single interrupt? I would like to replcace my actual code : attachInterrupt(0, ChangeA, CHANGE); To something like atta...
Alexis Paques
1

votes
1

answer
145

Views

is it possible compare a 16-bit value with a 8-bit compare match ISR

I am trying to make a servo controller that have a higher resolution than the ATtiny85 8-bit timer/counter. So far I have managed to get about 2000 positions on my servo (1µs/step) within a time frame of 21'000 µs. I have also managed to move 5 servos sequential and with different speed, but now I...
CrowStudio
1

votes
1

answer
1.4k

Views

Interrupt service routine in C++

For a real time embedded system I'm trying to provide an interrupt handler, which allows for registering any non-static method pointer (as well as the object's instance of course), which gets called, when the interrupt occurs. In C, this was easy to do, e.g.: void (*func)(void*) = 0; //
SirFrancisDrake
1

votes
1

answer
237

Views

Is there a way to use clock interrupts on raspberry pi 2 running windows iot

I am developing signal generator Windows Iot universal javascript application to Raspberry Pi 2. I connected MCP4921 DAC to it thru SPI. What I am trying to do is to generate sine wave with given frequency, amplitude and offset. I already got device working, but when I try to produce accurate wave,...
EspeH
1

votes
1

answer
78

Views

CTL_UNSUPPORTED_CALL_FROM_ISR with CrossWorks Library

I use the CrossWorks target library with a stm32f controller. In my project I have some external pin interrupts enabled. So far they work, and because I more or less stole the configuration from previous projects I would be inclined to say that it should be correct. All of the ISR handlers look some...
jwsc
1

votes
4

answer
2.5k

Views

C++ ISR using class method?

Is it possible to use a class method as the Interrupt Service Routine? I have an ISR written and working in C using a function: static void interrupt far ISR(...) {} I've tried in C++ to create a method (prototype): void interrupt far ISR(...); Then the implementation: #pragma interrupt void interru...
SPlatten
1

votes
1

answer
162

Views

My first PIC32MX ISR not firing, code is hanging

I'm just getting started with a PIC32MX340F12, and MPLABX. My first attempt was to write a timer interrupt, so I worked with the datasheet, compiler manual, and examples and came up with the below. But it doesn't work... the interrupt never fires, and in fact if I leave both the timer interrupt en...
Chris
1

votes
1

answer
154

Views

STM32F4, strange behavior between an IRQ Handler and a function with shared variables

I am facing with a weird behavior in my program. For the context, I am programming a STM32F469 microcontroller. The IDE used is SW4STM32 (with Eclipse Neon version (4.6.3)). To go straight to the point, here is what I have : void foo(void){ while(1){ if(var.x == 1){ var.x = 0; var.y = 1; // Some irr...
vionyst
1

votes
1

answer
298

Views

ESP8266 Timer1 conflicts with Neopixels WS2812 library

I want to add a Timer1 ISR to have a firing every 0.25 s and do some light motion with the WS2812 240 strip led. Things were working well on Arduino Nano because it has a cli(); TCCR1A = 0; // pas de PWM ou OCR TCCR1B = (0
Lotfi
1

votes
1

answer
59

Views

Create interrupt (ISR) to create smooth robotic arm motion

My school has a robotic arm (UR-10) that's hooked up to some buttons and I wanted to program it so the arm could move left and right smoothly when those buttons are clicked. Currently, I'm finding the arm just moves then stops then moves and stops in a jerking fashion. I wanted to implement an inte...
NoviceCoder
1

votes
1

answer
1.1k

Views

Why is RB interrupt routine running twice?

I have some code below that has a slight bug that I don't know how to fix. Essentially what is happening is my high ISR is running twice after the the flag is set. It only runs twice and is consistent. The subroutine should run only once because the flag is set when the input on RB changes, and the...
Scott James Walter
1

votes
3

answer
2.9k

Views

What is this concept of Pending Interrupts

I am unable to fathom the term Pending Interrupts. I mean, the way I see asynchronous events is like 'Time, tide and Interrupts' wait for none. Then what is this pending interrupts. How can I service a request that has come in the past, which has gone. Can someone please explain with a scenario wher...
RootPhoenix
1

votes
3

answer
142

Views

ISR vs main: what are the trade offs of running in one or the other?

I know it has to do with time and efficiency, and how ISRs take time away from other processes, but I am unclear why this is. I am always told to keep ISRs very short. I am a bit confused why this is.
cdesantis01
0

votes
0

answer
3

Views

How to loop arrays so one fills up whilst the other empties into the serial monitor?

I am an amateur when it comes to Arduino coding, so I am reaching out on here for help as I cannot find the answer anywhere else. I have data coming in from a microphone on A0, the Arduino then takes this data every 125ms using an internal interrupt and stores it in an array in the ADCH. From her...
Matt Drumm
1

votes
1

answer
1.2k

Views

Circular-buffer used in ISR, declared volatile, gives error. Why ? How to fix this?

There is an Arduino library called 'ByteBuffer' (found here), which is a circular buffer implementation. I modified it slightly (calling it 'ByteBufferPro'), by chopping off support for all non-byte data-types, and adding few convenience methods. I intend to use this in my Interrupt-Service-Routine,...
icarus74
0

votes
0

answer
7

Views

Why are FIFO One-quarter full, Half-full, three-quarter full interrupts provided in a UART RX FIFO? What are their use cases?

I am implementing a protocol decoder which receives bytes through UART of a microcontroller. The ISR takes bytes from the UART peripheral and puts it in a ring buffer. The main loop reads from the ring buffer and runs a state machine to decode it. The UART internally has a 32-byte receive FIFO, and...
Sreekesh Sreelal
1

votes
2

answer
166

Views

Every IRQ and ISR causes a GPF

I am developing an operating system. My GDT has three entries. I've created the IDT and implemented ISR and IQR. I also remapped the PIC. The problem is that after every interrupt handler follows a General Protection Fault. This is the assembly code which calls the interrupts: .extern fault_handler...
les
0

votes
1

answer
20

Views

AVR interrupt's variable updated in main

Using a 8-bit AVR micro, I arrived to a simple situation which might not be that easy to solve. Consider the following snippet: static volatile uint8_t counter; //fires often and I need all the values of the counter. void isr(void) { counter++; } int main (void) { while(1) { send_uart(counter); coun...
Daniel
4

votes
1

answer
1.1k

Views

Does ISR (Interrupt Service Routine) have a separate stack?

When using an RTOS (ex FreeRTOS), we have separate stack spaces for each thread. So what about ISR (Interrupt Service Routines), does they have a separate stack in the memory? Or is this configurable? If they don't have a stack where the local variables declared in ISR get stored?
Ginu Jacob
0

votes
0

answer
6

Views

How would an ISR know what pin cause the interrupt?

Interrupts can be enabled for a specific pin(s) on a digital I/O port, correct? How would the ISR determine which pin caused the interrupt? Because the vector table has only one slot for the Port1 ISR. So the same ISR function gets called no matter which input pin on Port1 needs attention unless I'm...
Lucas Seran
8

votes
2

answer
335

Views

68040 Takes Wrong Branch of If Else

Any good 68k assembly programmers out there?? I'm using a commercial Green Hills compiler for a Motorola 68040 and I'm seeing some very strange behavior from the code. Sometimes, the code will do an if/else comparison, and take the wrong branch. For example: float a = 1, b = 2; if (a < b) do c; else...
Samuel
1

votes
1

answer
2.9k

Views

Interrupt service routine for watchdog timer on STM32 Discovery

I recently bought a STM32 Value line discovery kit to work with STM32 devices. I'm working on a project now which requires a watchdog. It's called IWDG in STM32. But my problem is that I need an ISR when the watchdog is triggered. Does anyone know how to implement this (or even have an example)?
Lars Jansen
2

votes
2

answer
3.3k

Views

How to enable interrupt function in sw4stm32

I use SW4STM32 toolchain,I want to bliking led using timer2 when overflow, in STM32103RET, here is my functions to turn led on and of. void TurnOnLed(){ HAL_GPIO_WritePin(GPIOA,GPIO_PIN_10,GPIO_PIN_SET); } void TurnOffLed() { HAL_GPIO_WritePin(GPIOA,GPIO_PIN_10,GPIO_PIN_RESET); } the timer2 initili...
Hamid
2

votes
1

answer
81

Views

Interrupt / Stack Pointers / PIC Microcontroller

I am currently working with the PIC16F1829 micro controller. However, I am stuck on interrupt routine appropriate execution method. I want the interrupt routine to exit out of the infinite loop in all of the functions (LED animations), that are listed as different switch cases in the main() superloo...
Rytis Be
2

votes
2

answer
656

Views

Is it possible the to lock the ISR instructions to L1 cache?

I am running a bare metal application on one of the cores of ARM cortex A9 processor. My ISR is quite small an I am wondering whether it would be possible to lock my ISR instructions in the L1 cache? Is it possible? Is there any one who would explain some drawbacks of doing it? Regards, N
Nuetrino
4

votes
3

answer
6.8k

Views

Can breakpoints be used in ISRs?

Can breakpoints be used in interrupt service routines (ISRs)?
23

votes
4

answer
17.9k

Views

How to save the registers on x86_64 for an interrupt service routine?

I am looking at some old code from a school project, and in trying to compile it on my laptop I ran into some problems. It was originally written for an old 32 bit version of gcc. Anyway I was trying to convert some of the assembly over to 64 bit compatible code and hit a few snags. Here is the orig...
Mr. Shickadance
3

votes
2

answer
2.1k

Views

Context switching in function vs interrupt call? [closed]

I understand the basic difference between function call & interrupt (ISR) jump from below SE question. difference between function call & ISR But I am still not clear about, what are the registers will be pushed /pop to/from stack in both the cases? How context switching will happen in both the case...
kapilddit
2

votes
1

answer
308

Views

Call Int 13h in a ISR

I have written a ISR for int 9h by assembly in Real Mode. In this ISR, I call INT 13h, AH=0x02 for writing some data on Hard Disk. But data aren't written on Hard Disk. Also int 13h, ah=0x02 doesn't work too (Read data from Hard Disk). after call int 13h, Carry Flag is On, but AH and AL are zero. W...
CoyBit
28

votes
3

answer
26k

Views

Signals and interrupts a comparison

Based on various references, my subjective definition of signals in Linux is 'The triggers that are used to notify the processes about an occurrence of a specific event.Event here may refer to a software exception.Additionally signals may also be used for IPC mechanisms.' The questions I have are I...
Vivek Maran
6

votes
1

answer
104

Views

Optimizing shared array access with temporary volatile qualifier

I was wondering if in the following scenario a temporary volatile qualifier would yield correct behavior. Assume an ISR collects values in an array and once enough values have been collected it signals readiness. int array[10]; // observe no volatile here int idx = 0; // neither here volatile bool...
cheind
1

votes
3

answer
1.2k

Views

Is there a difference between an ISR and an interrupt handler?

I'm studying operating systems and I encountered both the terms ISR and interrupt handler. Are they two words for the same mechanism? If not, what is the difference?
2

votes
2

answer
773

Views

8086 Assembly keyboard ISR implementation

I can't understand why the keyboard interrupt service routine I wrote for my program (should print 'hello world' each time I press a key) only occurs once when I execute the .exe on dosbox. Here is the code: NAME keyb PILE SEGMENT STACK db 20 dup ('LA PILE ') PILE ENDS DONNEE SEGMENT mess...
Bongodam
1

votes
2

answer
517

Views

Programming NVIC on STM32 (without libraries)

I have thoroughly searched the Datasheet and User's Manual for the STM32F4 MCU I am using (including PM0214 for STM32F4xx MCUs) as well as even information online about general MCUs to develop an understanding of how one would go about programming interrupts without a library... but to no avail. Is...
spooksmus

View additional questions