Questions tagged [interrupts]

Interrupts signal the processor events that need immediate attention. They could emitted by hardware or software. The response to interrupts takes place in an interrupt handler (interrupt service routine, ISR) that is called after suspension of the current running code and saving the processor's state.

Filter by
Sorted by
Tagged with
0
votes
2answers
37 views

Communicate with GPIO HIGH/LOW between 2 PIs

I have 2 raspberry PIs 1x PI3 and 1x PIZero with camera attached. I want to set up a system to have a output GPIO pin on the PI3 and a input pin on the pizero connect so that when I set the PI3 pin ...
0
votes
1answer
36 views

RPi.GPIO “flush” interrupts

Intro It seems to me that when one adds and event detection, then removes it and the adds it again, something strange happen: 1) an event is removed to the "detection list"; 2) the event happens; 3) ...
0
votes
1answer
27 views

Why i2cdetect slave can not detect polling way but interrupt can?

I had tried to use rpi as master to detect slave. The slave is MCU, using polling to answer rpi's request. However, when I tried to use rip to check the slave address, using command : i2cdetect -y 1 ...
0
votes
0answers
20 views

Interrupt driver code between rpi3 and rp3+

I am a new learner in raspberry pi. I refer a driver code for gpio input interrupt from https://github.com/jacky0328/hello-world I write a more simple example code below to test input interrupt, it ...
0
votes
1answer
40 views

Setting gpio input interrupt with direct memory access?

I am new learner for raspberry pi 3B+, I ever study stm32 mcu, but it's my first time to use an Linux OS on a developing board. I read the BCM2837-ARM-Peripherals manaul and learn how to turn on and ...
0
votes
0answers
24 views

Interrupt triggers without button pressed what can i do?

I have two buttons: a red and a green one and i want to measure how often each one gets pressed and i want to write into a csv file. The problem is even without me pressing the buttons the pi gets ...
1
vote
0answers
46 views

Interrupt issue - Wiringpi and pigpio show different values for pin

I am having an issue with raspberryio/wiringpi interrupts. A lot of extra interrupts are generated. My configuration is as follows: Physical pin 16: Set as input Pulldown resistor Interrupt ...
1
vote
0answers
29 views

Pin interrupt intermittently not triggered with MRAA/WiringPi library

I am working on a project to fetch sensor data from an Arduino with a RPi3B+ board. I use SPI bus to perform the data transmission. Every time when the data in Arduino is ready, Arduino will pull down ...
1
vote
0answers
136 views

Interrupts with MCP23017 using the mcp23017 dtoverlay

I'm at my wits end with this one. Okay, so we've got an MCP23017 with its INTA wired to the Pi gpio12 (bcm) in /boot/config.txt dtoverlay=mcp23017,addr=0x20,gpiopin=12 so far so good. I'm looking ...
0
votes
0answers
70 views

LCD Display with I2C gives garbage when called by interrupt

I have problems with a 2x16 LCD Display controlled via I2C. I use python 2.7 and have a Raspberry Pi Zero W. When called from the main loop everything works fine and I can access the display with ...
1
vote
0answers
337 views

Access Timer Interrupts in Raspian

I want to write a C program that runs some code at a fixed interval (somewhere between 200us and 1ms, TBD). Is it possible to use the hardware timer interrupts to execute code without resorting to ...
0
votes
0answers
291 views

Python script wait for button press before starting/stopping a separate python script

I've written a python script (shown below) which starts and stops another separate python script (datalogger) once a button is pressed. The datalogger script records logic levels (0 or 1) and stores ...
2
votes
2answers
252 views

SPI xfer2 callback possible?

I would like to control 10 different devices with SPI. As there is not enough ChipSelect outputs I use GPIO to toggle a MUX on the clock. Problem is I have to wait until the SPI is done transmitting ...
1
vote
1answer
263 views

GPIO interrupt detecting wrong values

I have a device which is based on Raspberry pi. It is known as ionoPi which is basically an i/o expansion board for Raspberry pi. I am writing a python script which detect signal change on input 16 ...
1
vote
0answers
217 views

Raspberry Pi3 should I use multi-threading, interrupts or callbacks?

Project Description I am interfacing industrial PLC's with the Raspberry Pi 3 in order to read the efficiency of the given line, and display live results. In essence I need to do the following things:...
0
votes
1answer
364 views

Unosquare.RaspberryIO: unregister from InterruptCallback

I'm developing an application on C# using Unosquare.RaspberryIO. My question related to interrupts and callbacks. According to the documentation, it's possible to register callbacks. For example: pin....
-1
votes
2answers
110 views

C Interrput every rsing edge 100kHz

i've a 100kHz signal and i want to detect every rising edge. I'm using ISR but edge isn't detected and when detected it's 46µs after the edeg. How to do? [EDIT] Here's the code with pigpio library: ...
0
votes
2answers
680 views

GPIO.add_event_detect requires root

I am trying to run a program using GPIO from a normal user. I checked that /dev/gpiomem has the correct permission (root:gpio 0660) and that my user is member of group gpio. The following works ...
0
votes
2answers
1k views

GPIO.wait_for_edge and signal.signal()

I have the below sample code that is trying to implement a safe shutdown mechanism ( yet to fully implement) For some reason, I am not able to catch any signals using the registered signal handlers. ...
0
votes
1answer
191 views

GPIO switch interrupts work just once?

i have this strange problem with interrupts. I use GPIO switches to change a variable that defines what my code is doing. As soon as one of those interrupts worked once, none of them workes anymore. ...
2
votes
0answers
721 views

Why does the keyboard interrupt not work? [closed]

The code below runs on boot via this command in the /etc/rc.local file: python3 /home/pi/Desktop/booth.py. When a button is pressed, the PiCamera preview begins, which covers my whole monitor screen ...
4
votes
3answers
9k views

Debouncing buttons with RPi.GPIO — too many events detected?

I'm using RPi.GPIO to handle events from a simple pushbutton. Pushing the button connects the associated GPIO pin (4) to ground. I would like to trigger an event when the button is released (e.g., ...
0
votes
1answer
607 views

Wiringpi interrupts

If I make an interrupt and use a goto statement to go from the interrupt function to the main function will I start running into problems: with the flow of my program and with bugs. Will I start ...
1
vote
2answers
268 views

Clear GPIO Event Detect Status

At page 96 of the Manual for the BCM2835, the synopsis for the "GPIO Event Detect Status Registers (GPEDSn)" states that "The bit is cleared by writing a “1” to the relevant bit." However, regarding ...
0
votes
1answer
84 views

How do I use a hardware interrupt to restart a main loop?

I am making a Raspberry Pi librarian which can keep track of available books and who has taken out a book. Users scan NFC cards to begin the process of borrowing a book. The main program is an ...
0
votes
1answer
523 views

Access Raspberry Pi3 Timer using Python

there is a way to get access and then configure Raspberry pi Timers using a Python? I saw some code to do that but it always be in C. Like here [BareMetal] Timer on Raspi All this I need to send ...
2
votes
1answer
1k views

RPi.GPIO interrupt

Is there any way to pass args to the callback function when using GPIO.add_event_detect(17, GPIO.FALLING, callback=my_callback, bouncetime=300)
0
votes
0answers
237 views

Playing audio mess with GPIO.add_event_detect in Python

I have these lines of code running in Python on my Pi 3: os.system('mpg123 -q /usr/local/marbik/public/evilcave.mp3 &') GPIO.add_event_detect(17, GPIO.FALLING, callback=GPIO17Callback, bouncetime=...
0
votes
1answer
241 views

are spurious interrupts common?

I'm trying to control nexa units with RF-modules connected to a raspberry pi and have written a little program in C to sniff the transmitted message from the nexa remote control. The software uses an ...
0
votes
2answers
6k views

How can I detect how long a button is pressed?

Running Python on a Raspberry Pi Zero. I have one button connected to GPIO26, set for input and pulled up. I setup my interrupt like this: GPIO.add_event_detect(26, GPIO.FALLING, callback=...
1
vote
0answers
59 views

Why is Linux switching off the ARM timer interrupt shortly after I enable it?

When I set the ARM timer control register's "timer enabled" bit, it clears the interrupt "enable basic IRQs" bit for the ARM timer after a brief delay. Why is this happening? I ran this test: #...
0
votes
1answer
372 views

Volume dial - ADC interrupts with SPI

I'm trying to implement a volume dial. I've got a potentiometer hooked into ADC 0832B (http://www.ti.com/lit/ds/symlink/adc0832-n.pdf), timing diagram below: When I turn the volume dial, I want an ...
2
votes
2answers
426 views

Inconsistency between GPIO block diagram and interrupt table in the BCM2835 datasheet

I'm looking at the BCM2835 datasheet https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2835/BCM2835-ARM-Peripherals.pdf. On page 89, there is a block diagram for the GPIO module, as ...
0
votes
2answers
326 views

Is there a way to have Multi-Condition Interrupt

In Python, Does anyone know if there is a way to have a multi-input interrupt? I have a 4 button input and I want to be able to have a special condition to reset. I know interrupts are written like: ...
0
votes
1answer
756 views

Why isn't gpio_set_debounce working in my Raspberry Pi Zero kernel module?

I'm stuck on example 1 from this tutorial. I found the Raspberry Pi code for it here. I uncommented the gpio_set_debounce line and compiled the module, but my switch still bounces a ton, resulting in ...
3
votes
1answer
642 views

Use of gpio interrupt 2 rather than interrupt 3

I have studied in bcm2835 manual that its gpio peripheral can generate three interrupt lines. But in the same manual (interrupts section) I found that there are four gpio interrupts, gpio_int[0] to ...
0
votes
1answer
240 views

Giving a process exclusive use of a CPU core on a Pi 3

On the quad-core CPU Pi 3, is there a way of giving one single-threaded process exclusive use of a single, named, core? Interrupts would also need to be routed away from the chosen core. The purpose ...
1
vote
1answer
696 views

SPI control of WS2801 LEDs, fails when using GPIO interrupts

I have three libraries (is library the right word?) that I'm using in my Python code: An Adafruit NeoPixels library, which comes from the rpi_281x library to control them via PWM, on GPIO pin 18. ...
0
votes
1answer
1k views

Write interrupt data into a Raspberry pi Register on C?

I'm trying to read interrupts and detect direction of interrupts from an encoder using a raspberry pi , it is USdigital Brand "H6BM-1000-500-IE-S-H" , it has 1000 signals per revolution , the thing ...
0
votes
1answer
1k views

Fastest Hardware Interrupt software?

I'm wiring my Raspberry pi to a USdigital encoder , especifically this model "H6BM-1000-500-IE-S-H" , it has 1000 signals per revolution , I've followed the tutorial on http://raspi.tv/2013/how-to-...
1
vote
0answers
589 views

Ultrasonic Sensor HC-SR04 Lag Problem (20Hz only) in PID control loop

Good day, I am currently working on an autonomous quadcopter project. I am using the HC-SR04 sensor for altitude hold, however in testing the sensor, the maximum data throughput of the sensor is only ...
1
vote
1answer
858 views

Using INT interrupt line on PCF8574 I2C 8-bit IO-expander on Bit-banged RPi GPIO?

I am planning to use a triplet of RPi GPIO pins as an additional bit-banged I2C bus on my RPi. This will be run at a lower than typical rate (and level-shifted via a 3.3 to 5.0 V I2C shifter unit) so ...
3
votes
1answer
3k views

Raspberry Pi 2 B GPIO pwm and interrupt pins

Good day! I would like to use pwm and interrupt on raspberry GPIO pins but i don't know which GPIO pins are actually dedicated for pwm output and which is for hardware interrupts, is there a way for ...
1
vote
0answers
488 views

Button Interrupt Problem

I'm working on a project for my Raspberry Pi. I have stumbled upon a problem with creating interrupts through a button on my breadboard. I have bought a PiCamera and I intend to make it so that ...
2
votes
1answer
545 views

Button Interrupt Doesn't Work

I'm working on a project for my Raspberry Pi. I have stumbled upon a problem with creating interrupts through a button on my breadboard. I have bought a PiCamera and I intend to make it so that ...
1
vote
1answer
1k views

Wiring Pi interrupt not working

I have a Pi hooked up to the output and reset nodes of an NOR gate S-R latch. For those of you who don't know what that is, basically I have an input in GPIO pin 11 that goes high (3.2V) whenever the ...
8
votes
1answer
1k views

How to write device tree overlay for analog device touchscreen ad7879 i2c

I wrote a device tree overlay for driver ad7879-i2c touchscreen (compiled as module using Raspberry Pi source, files: ad7879-i2c.c, ad7879.c). Driver gets loaded but i guess parameters are not passed ...
1
vote
2answers
361 views

Is it normal when a pin goes low it triggers a interrupt on an another one?

I have the following : Output Pin 17 (wiringPi pin number 0) to a relay module -> a LOW means the relay will let current pass. 5V pin to power the relay module Input Pin 22 (wiringPi pin number 3) ...
2
votes
2answers
1k views

using try-catch to catch gpio interrupts

Is it possible to interrupt a try-except code in python with gpio interrupt to generate exception? In the "try" part i'm openning a socket and use socket.serve_forever(). I want to make a hard-reboot ...
2
votes
1answer
4k views

WiringPi: using interrupts with Python

I want my RaspberryPi to perform some actions when the light in a room is switched on or off. To do so, I connected a photocell to the GPIO pins. Previously, I used some python 3 program that queried ...