Questions tagged [interrupt]

Interrupts allow the processor to suspend normal operation temporarily so that a high-priority software or hardware event can be handled instead.

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

Generating Externally Triggered Complimentary PWM with Arduino Due

I need a 2KHz complimentary PWM waves with adjustable duty and phase that is triggered by an external 4KHz source. After reading the datasheet I think there might be 2 way to do this: Use a TC unit ...
1
vote
1answer
64 views

Is it advisable to use Serial.write in an ISR when loop() routinely uses Serial.read?

I do not know much electronics. I have Nano v3 as I2C master, it reads 5-byte packets (of delimtted data) from PC's USB port, processes it and forwards it. I now need to implement a way to signal PC ...
0
votes
1answer
38 views

LED does not blink - Arduino UNO+WiFi R3 ATmega328P+ESP8266 board

As I am learning the Arduino coding, I want to see if my program can turn on the LED light. I have tried all the things, but the code does not start the LED light I have installed on the board. The ...
1
vote
1answer
48 views

Arduino Uno's Timer maximum frequency using Timer Compare Interrupt, not Timer Output Pins (e.g. OC0A)

I want to achieve the generation of a custom binary signal over a digital pin at the highest possible frequency on Arduino Uno. Using Timer's output pins (e.g. OC0A), one can get a pin to toggle at a ...
1
vote
1answer
33 views

where is the digitalPinToInterrupt macro defined

I am new to arduino, and it's confusing to me how you can just write code in the IDE and use functions or macros such as #define ISR() in the avr-libc library without having to include the header file ...
1
vote
0answers
22 views

Arduino unable to wake up using interrupt after sending SMS

my use case is that I am building a distance sensor using Arduino Uno. The idea is when the distance is between a threshold, an SMS is sent from the device. I am using DS3231, SIM800L, and HCSR04 for ...
1
vote
1answer
50 views

Alternative to a delay so it can be interrupted

I have task which includes a 30s delay in the void loop. During this delay I want to be able to press a key on a keypad and have a message displayed on the serial monitor as an emergency stop. Since ...
0
votes
1answer
20 views

Set interrupts that are not GPIO or Timer in ESP32

I am making a project on ESP32. It reads certain sensor values, stores them in RTC memory and sends them by MQTT after a certain time. I wish that it transmits data immediately if there is a ...
0
votes
0answers
32 views

Interrupt keeps firing

I have wired up a 6502 to run a program, and to check what is happening on address and databus, I have built a monitor setup with an Arduino Mega2560. The monitor should read from the buses, each time ...
2
votes
1answer
30 views

When accessing a variable from an ISR, is a volatile pointer enough?

Let's say I want to modify a global variable from inside an interrupt service routine. I must ensure that any variables I modify are volatile. Does it work to use a volatile pointer to data I want to ...
1
vote
0answers
47 views

Debouncing interrupt using capacitor

I'm currently working on nodeMCU and need to use interrupt pin. I find out there are bouncing problem when using interrupt thus i use capacitor 100uF to solve this problem. The question is by using ...
1
vote
1answer
59 views

Hardware interrupt calling two ISRs

I've spent three days on this, and either I'm blind to something, or something just ain't right. Doorbell. Front door switch and back door switch. Two interrupt service routines, one attached to each ...
1
vote
0answers
75 views

Arduino mega PinChangeInterrupt with 16 bit timer

With reference to this question ::I have written a program by using 16-bit timer, The program is as follows . volatile uint32_t ovfCount = 0; struct Pulse { uint32_t last_toggle; uint32_t width; ...
1
vote
1answer
67 views

Issue using Arduino Mega Timer2 with PinChange Interrupt

I was working on a program to measure the pulse width , for that I thought of using Timer 2 in Arduino mega along with pin change interrupt, The program I have written is as follows volatile float ...
1
vote
2answers
68 views

How to exit out of a timer interrupt (ISR(TIMER1_COMPA_vect))

I have a code here where I collect an array of data and do some data analysis with the data. The only thing I'm struggle with is how to exit the ISR after I am done running my code. I am using a pre-...
2
votes
3answers
86 views

Collecting data from a timer interrupt and storing it into an array

My question is: how can I use an ISR and store the data I get from my analog inputs into an array for easier data analysis. More specifically, I want to collect my data using an ISR function (internal ...
1
vote
1answer
44 views

Input Capture Mode PPM signal

Greetings to all members of the Forum. I would like to express my deepest gratitude, with respect to the title of this post. The last week I am trying to capture and decode a PPM Signal from an RC ...
0
votes
0answers
25 views

OCR0 software PWM “strobes” when additional code is run

I'm having a strange issue with an arduino-ish program. As a MWE, I'm trying to PWM control an LED with interrupts, while also doing other stuff in the background. If I just use the code below, ...
1
vote
1answer
66 views

Doing several things at the same time with functions, objects or interrupts?

First of all, thank you for taking the time to read this. I am a newbie, so apologies (done examples on arduino website, basic C++). I'm trying to get an idea of what the best way to structure a ...
1
vote
1answer
54 views

4 Bit Counter up and down

we are asked to create an Arduino code that would run a 4 Bit Binary UP counter once a push button switch is pressed and then 4 Bit Binary Down counter on the second click. Then vice versa. This ...
0
votes
1answer
28 views

RFM95 digital io to control mute on PAM8403 to get rid of hiss while receiving

I am building a solution with an ESP32, a PAM8403 amp, a parallel TFT display, and a RFM95 LoRa module. All works great but I want to get rid of the noise that is generated when Lora is in receive ...
0
votes
1answer
78 views

Arduino, problem with interrupt and SSD1306 OLED

I'm not that good at this. Calculates RPM through Peripheral Speed and Interrupt. Everything works fine when I show this in the IDE with Serial.print without OLED. When I connect an SSD1306 OLED I2C, ...
0
votes
0answers
58 views

void timerIsr() doesn't work and the oscilloscope doesn't show anything

I have a project on simulation and realization of a pulsation detector. The cardiac part is coupled to an electronic thermometer in Proteus, but void timerIsr() isn't called and doesn't show anything ...
0
votes
1answer
54 views

Why NVIC_EnableIRQ handler function only run once?

I have a code that spit out random number when the ISR register is ready: #define TRNG_KEY 0x524E47 uint8_t lut[10] = {0xF6, 0x12, 0xAE, 0xEC, 0xD8, 0x7C, 0x7E, 0xE0, 0xFE, 0xFC}; uint32_t msk = ...
1
vote
0answers
42 views

Interrupts aren't working unless Serial.flush() is called first. Why? [closed]

I have a robot that has encoders attached to the motors, and I use interrupts to detect pin changes and count the number of pulses (ticks) from the encoder. I have the robot run the motors until a ...
1
vote
1answer
130 views

How to implement brown out detector arduino ESP32?

We are using ESP32 with arduino sdk for developing our application. In our application we need to implement BOD to detect with specific voltage level. Basically we want to set specific voltage level ...
0
votes
2answers
50 views

Do interrupts block other interrupts?

If I have an interrupt attached to two pins and the handler of the first is still executing when the second interrupt fires, does it: a) queue the second interrupt, b) ignore the second interrupt (...
0
votes
1answer
27 views

Initialising timer interrupt crashes Mega 2560

Below is the entirety of my prototype code, the cycling of pin 13 is what I use to confirm the board is restarting. The board resets continually on this implementation of initialising the interrupt. ...
1
vote
0answers
36 views

How to implementing timer interrupt with a sensor device using A0 and A1 pins

I was wondering if there is a way to program a timer interrupt to collect sensor data at a specific sampling rate? I want to attach two strain gauge sensors to A0 and A1 pins and collect the data at a ...
1
vote
1answer
76 views

seeeduino can-bus shield v2: can't read can bus and write on SD card

I'm using a seeeduino V4.0 and a CAN-BUS shield v2.0 with industrial grade SD card. I'm using the default library given by the wiki of seeed. I've simulate a can bus with two mcp2515. I can read it ...
1
vote
2answers
145 views

ESP8266 and Interrupts - not possible?

I'm planning to use an ESP8266 (Wemos D1 Mini) to use as a software SPI monitor to send over WiFi. As a test, I've done a cut-down sketch that just counts the interrupts, a simple frequency counter. I'...
4
votes
1answer
373 views

ATTiny13 Interrupt Issue

I have recently been working on a project that I had initially been designing with an Arduino Nano, and I was able to create functioning code for my application, but for cost / space reduction I ...
0
votes
2answers
65 views

Code Optimization: Interrupt when a value reaches 0

I have this working program that I wish to improve efficiency as much as possible. It will blink slow, then faster and faster until it restarts. It works, but my main concern is, currently, I am using ...
2
votes
1answer
43 views

Adding a common activation pin to a group of buttons

I'm working on an Uno, which has only two interrupt capable pins, but i need at least three buttons to wake it up from its power saving mode. Is there a way to wire buttons such that, in addition to ...
2
votes
1answer
40 views

Arduino with interrupts enters in a locking state

I am quite noobish with using the interrupts on Arduino and I am facing a strange problem. I am using an Arduino Pro Mini, a light sensor and an RTC module(DS3231) which has set 2 alarms, one at ...
1
vote
0answers
40 views

Can someone check my schematic and code? My Led is not turning on

Led1 is on the left Led2 is on the right The code is making LED1 blink every second but it should also turn on Led2 so that whenever I press the push button it should turn off Led2. But Led2 isn't ...
1
vote
1answer
47 views

what to write instead of delay() in interrupt function?

I was trying to develop a traffic light signal controller . when the button is pressed, the pedestrian green light will turn on faster than before . I used delay() in Interrupt function, But it is not ...
2
votes
2answers
65 views

Why impedance between I/O pin and ground drops when Arduino is not powered

I have a 4KHz 5V pulsed signal connected to Arduino UNO pin2 (ISR). When the board is powered, the pulse is attached to ISR rising edge, and is working as intended. I don't know the output impedance ...
0
votes
0answers
44 views

INT0_vect is slow?

I want to wake up my AtTiny45, but it looks like it needs a few nudges sometimes. I have a pull down button connected to INT0. I made sure INT0 wakes up when the button is pressed, and as soon as the ...
0
votes
1answer
58 views

Arduino to AtTiny change of pin interrupt behaviour?

I have a project which, to save on battery, is put to sleep until an interrupt pin is rising from LOW to HIGH. This works well on Arduino Nano, however the translation doesn't on the ATTiny. #include &...
2
votes
3answers
323 views

How to use ADC interrupt on STM32 blue pill

I'm currently using the STM32F1xx boards from http://dan.drown.org/stm32duino/package_STM32duino_index.json To program my blue pill but I can’t find how to write the interrupt for the ADC. I’ve set ...
4
votes
1answer
219 views

Arduino timer interrupts for PID

I'm working on a robotics project where an arduino nano is acting as the motion controller. I'm trying to use a trapezoidal motion profile generator and PID loop to follow that profile, but I found ...
0
votes
0answers
90 views

#include <stdatomic.h> generates compile errors with no code

Consider the following (non)code example: #include <stdatomic.h> void setup() { // Nowt. } void loop() { // Nowt squared. } This generates compile errors for several lines of code in ...
1
vote
1answer
78 views

For Loop function to iterate through outputs after interrupt

I would like help to continuously loop over my output pins after each sleep cycle. I am trying to increment through each output pin during each successive interrupt. Introducing this myIteration ...
4
votes
1answer
417 views

How to get variable from callback function?

There is a library davetcc / IoAbstraction. The only library working as expected with my rotary encoder. The problem that on rotation I can only see serial output with position data, but I cannot get ...
1
vote
0answers
32 views

Which pin triggered MCP23017 interrupt

This is my first post here, so apologies in advance if I've done something against any forum guidelines! I have a project where I am monitoring multiple switch states with an Arduino using multiple ...
2
votes
0answers
135 views

Wake up from a pin, Sleep when work is done

I have a project which needs to sleep most of the time, and when a button gets pressed, it does its thing which is producing a fading sound wave (using interrupts) until it's time to sleep again. The ...
2
votes
1answer
46 views

Is it possible to detach an interrupt for a certain ammount of time

Hardware: Arduino Uno Software Version: 1.8.13 My sketch has an interrupt service routine that triggers with the rising edge of digital pin 2. What I want to do now is detaching the interrupt as soon ...
0
votes
1answer
120 views

SPI transactions in Arduino

I have a task where I should do SPI transactions in interrupt mode. Means I have to handle data in IRQ handler (both for tx and rx bytes). How should I approach? I have a arduino board (2560) and a ...
0
votes
1answer
89 views

ISR Issue: Arduino Pro Micro

I'm trying to do a small test where I am using the ISR on the Arduino Pro Micro it up from sleep mode. I'm using a Force Sense Resistor (FSR, a resistor that changes it's resistance depending on how ...

1
2 3 4 5
11