Questions tagged [isr]

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.8k

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
1

votes
1

answer
98

Views

Using reti() at the end of an ISR

i have problem that this code doesnt work .. the ISR is working .. i tested the blinking of it in other code .. but to put the x++ in ISR and reading X in main() function it never blinks. .. im not familier with asm i thought this is compiler optomization so i put the variable volatile but it didn...
Hasan alattar
7

votes
1

answer
487

Views

Statically Defined IDT

I'm working on a project that has tight boot time requirements. The targeted architecture is an IA-32 based processor running in 32 bit protected mode. One of the areas identified that can be improved is that the current system dynamically initializes the processor's IDT (interrupt descriptor table)...
jkayca
2

votes
1

answer
1.1k

Views

Sequence of micro-operations for operations?

Consider the following sequence of micro-operations. MBR ← PC MAR ← X PC ← Y Memory ← MBR Which one of the following is a possible operation performed by this sequence? Instruction fetch Operand fetch Conditional branch Initiation of interrupt service Answer is option (4). My attempt : I...
2

votes
2

answer
225

Views

Calling printk in a simple IRQ handler crashes the kernel

I'm new to kernel programming and I couldn't find enough information to know why this happens. Basically I'm trying to replace the page fault handler in the kernel's IDT with something simple that calls the original handler in the end. I just want this function to print a notification that it is cal...
Awais Chishti
3

votes
1

answer
337

Views

RTOS - pending on different data in a queue

I'm programming a board from TI, and I'd like to somehow be able to have two different ISR's post to a task's message queue. That part works fine. However, on the receiving end, is there any intelligent way for the task to pend on its queue and perform a different operation on the data based on whic...
Ci3
2

votes
1

answer
463

Views

Driver with callback function

I have been working on some embedded software. This software is divided into two main parts. The first one is the application software and the second one is some system software. The system software consists of set of drivers and RTOS. I have been developing the application part and I have been usi...
Steve
4

votes
2

answer
2.6k

Views

How to wake up a FreeRtos task from a high priority ISR?

Using: Stm32F10x, F2xx, F4xx FreeRtos 8.1.1 gcc-arm-none-eabi-4_8-2014q2 I have an ISR which must run with high interrupt priority, so that's forbidden to call FreeRtos Api from within this ISR (see here and here). In some cases these ISR detects conditions, for which a sleeping FreeRtos task should...
Joe
2

votes
1

answer
818

Views

ISR syntax with ARM-GCC

The demo code on the web for defining an ISR for ARM is generally this: __irq void ISRFunc (void); Using ARM-GCC, this gives syntax errors on compile, I've tried obvious variants like _irq but they all have the same problem. Some google references state that you don't need to specify the function as...
BruceV
66

votes
11

answer
78.4k

Views

What is the difference between FIQ and IRQ interrupt system?

I want to know the difference between FIQ and IRQ interrupt system in any microprocessor, e.g: ARM926EJ.
Renjith G
3

votes
2

answer
651

Views

Unable to use ISR in xmega while using Atmel Studio C++ Build

Using Atmel Studio 6.2.1563, created an GCC C++ Executable build for ATXMEGA64A3U. Setup timer TCC1 to generate overflow interrupts every 1 millisecond. But compiler seems to ignore the ISR definition. ISR(TCC1_OVF_vect) { Cyclic_Do(); } In debug mode I see that timer is functioning correctly and OV...
vijay
6

votes
1

answer
627

Views

How does one read from an peripheral IO register using C/gcc?

I have an interrupt service routing on the AVR32. I need to read from the interrupt status register in order to cancel the interrupt. However I don't use the result of the read. I'd rather not use an asm instruction, but I am concerned that gcc will optimize away a read into a dummy variable. What i...
Robotbugs
2

votes
1

answer
2k

Views

C: UART, ISR, circular FIFO buffer: sometimes sends bytes in wrong order

I am pulling my hair out with an intermittent bug. I am receiving and transmitting bytes asynchronously (on a PIC16F77) and have implemented a circular software FIFO buffer for receiving and transmitting, combined with an interrupt service routine that is triggered when a byte can be sent or has bee...
Jodes
2

votes
1

answer
1.7k

Views

Concerned about drift of micros() value in Arduino program

I have a program that utilizes the Servo library and an external interrupt routine. From my understanding the Servo library uses a Timer1 interrupt to send pulses to the servo to maintain position. I am wondering what the impact is on the micros() count since it does not increment during an interrup...
pdfj
2

votes
1

answer
718

Views

Logging in ISR, sprintf(), printk(), else?

When trying to log/debug an ISR, I've seen: 1) sprintf() used as example in 'O'Reilly Linux Device Drivers' irqreturn_t short_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct timeval tv; int written; do_gettimeofday(&tv); /* Write a 16 byte record. Assume PAGE_SIZE is a multiple of 16...
user1559625
1

votes
2

answer
96

Views

Is it possible to set ISR Handler at runtime on M0+

I have a "default" resetVectors.c file for my SAMD21 ARM M0+. It has something that looks like: __attribute__ ((section(".vectors"))) const DeviceVectors exception_table = { ... }; in it that defines where different handler stubs. For testing purposes, I want to use one of the unused peripheral IRQs...
Travis Griggs
2

votes
1

answer
69

Views

Arduino/Attiny85: Delay in ISR and port manipuation

I'm trying to have on a pin an output inverted related to another output playing a tone(), but there is a delay of 35us @8MHz or 158us @1MHz clock. It seems there is a fixed 16us +142 clock cycles delay, because delay is not inversely proportional to the clock frequency. They are very, very long! Wh...
Gianluca
2

votes
0

answer
512

Views

PLP: Timer and Button Interrupt Service Routine

So I'm having trouble figuring out how to trigger a Timer interrupt (Every 200 cycles) and a button interrupt. When I hit the button interrupt all it seems to do is temporarily pause the counter for a split second and then continue counting. Then it never registers another button interrupt no matter...
P. Asllani
4

votes
1

answer
794

Views

What is the correct way of using C++ objects (and volatile) inside interrupt routines?

I am currently working with Atmel AVR microcontrollers (gcc), but would like the answer to apply to the microcontroller world in general, i.e. usually single-threaded but with interrupts. I know how to use volatile in C code when accessing a variable that can be modified in an ISR. For example: uint...
Vincent Zalzal
8

votes
2

answer
10.3k

Views

How CPU finds ISR and distinguishes between devices

I should first share all what I know - and that is complete chaos. There are several different questions on the topic, so please don't get irritated :). 1) To find an ISR, CPU is provided with a interrupt number. In x86 machines (286/386 and above) there is a IVT with ISRs in it; each entry of 4 byt...
ultimate cause
2

votes
1

answer
466

Views

MIPS: why is ISR surrounded with rdpgpr $sp, $sp; wrpgpr $sp, $sp instructions?

I'm working with PIC32 MCUs (MIPS M4K core), I'm trying to understand how do interrupts work in MIPS; I'm armed with "See MIPS Run" book, official MIPS reference and Google. No one of them can help me understand the following: I have interrupt declared like this: void __ISR(_CORE_TIMER_VECTOR) my_in...
Dmitry Frank
2

votes
1

answer
323

Views

How can I use an interrupt service routine to detect button events on this MSP430 code?

below is a code for the MSP430G2 micro-controller. I am having trouble adding to this assignment so far to include using the Interrupt Service Routine to my code. This code is a two bit counter which counts up using the S2 button on the launchpad and then counts down using an externally attached swi...
Beshoy Hanna

View additional questions

Смотреть фильмы онлайн бабушка легкого поведения 2 фильм бесплатно