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
0
votes
0answers
33 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
0answers
39 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
66 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
81 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
28 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
58 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
169 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
19 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 ...
1
vote
0answers
55 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
31 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
39 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
35 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 ...
0
votes
1answer
56 views

Animation of led strip with ESP32 does not work when WiFi is in use

I am using the ESP32 for a simple project. I know how to animate an led strip using atmega328p with arduino but when I animate it on the ESP32 it does not work that great. It will be nice if I can use ...
1
vote
2answers
114 views

Detecting an incoming 7.875 kHz pulse to use as trigger

I have written a code that detects an incoming pulse (square) of 7.875 kHz to trigger the output High for the entire duration of pulse, and trigger the output low if the pulse is off or not detected. ...
2
votes
1answer
41 views

Timer question: Phase Correct PWM at specific frequency

I am trying to create a sinusoidal wave segmented in 64 Frame, each holding a Duty cycle precisely varying from 0x00 to 0xff. This is for an Arduino Nano. I have trouble understanding the following: ...
0
votes
1answer
153 views

Which Arduinos support ATOMIC_BLOCK?

Is there a definitive list of which Arduino architectures support the ATOMIC_BLOCK() macro, and a list of #defines for each architecture? I've tried searching through the Arduino cores on GitHub to ...
0
votes
0answers
31 views

esp32 pico kit - actual clock speed vs crystal vs max_speed etc

I am trying to understand how the clock speed in the esp32 works. I am running arduino ide 1.8.12 with 1.04 board definition - on a pico kit 4 module . The device datasheet says it has a 40mhz crystal....
0
votes
0answers
45 views

watchdog timer giving me fits on ESP8266, how to find relevant code from Serial output describing the RST?

I've written a pair of sketches for two NodeMCUs to implement a noise meter. The master MCU voltage samples off an opamp's output pin and periodically digests 500 samples at a time into an RMS-type ...
1
vote
1answer
36 views

How to specify a timer's name depending on the chip it will be compiled to?

I need to enable a timer interrupt for a chip, and in the mean time, I am testing the code on Arduino Nano rather than (feed the chip, test the chip)++. So as part of the code I have to TIMSK0 |= (1 &...
0
votes
0answers
31 views

ds3231 rtc module weekly alarm

I have a ds3231 and Arduino UNO and I need to get an interrupt from ds3231 once a week for example every Fridays. I've searched a lot in the internet and forums but did not find any library or code ...
0
votes
2answers
43 views

External Button Interrupt (Digital Pin 3) of Arduino not working

I am trying to execute external button interrupt with Arduino and 16*2 alphanumeric LCD. What I am trying to do is when I press the button then the screen should switch between different options. When ...
0
votes
1answer
66 views

Connect two SD cards to one Arduino board and copy from one to another

I'm trying to connect 2 SD cards to an Arduino Uno board. My first question is: Is it possible to connect two SD cards to one Arduino simultaneously? The second question is: If it is possible to ...
0
votes
1answer
37 views

Arduino using delay in I2C receiveEvent

I have read before that you can't use delay() inside I2C receiveEvent because it is an ISR. What I want to do is as follows: I have a servo connected to my Arduino Uno and I want to control that using ...
1
vote
1answer
56 views

Is it possible to get which pin generated interrupt?

I wrote some code that handles rotary encoder using an interrupt, but I would like to get which pin generated the interrupt, so I'll be able to handle many interrupts in a single method. Something ...
0
votes
5answers
108 views

Simple serial message not consistent (sometimes jumbled up)

I have the following code, it works (most of the time) - yet it's not 100% reliable and now and then will send through a double message on one line or 2 subsequent alpha characters: const byte ...
0
votes
2answers
176 views

Serial Interrupt

I want to create a simple program, that responds to me sending a character over the Arduino IDE console. I am using an arduino UNO. Here is my program: volatile bool MeasReceived=false; ISR(...
2
votes
1answer
64 views

Mega: attachInterrupt on pin 18/19/20/21 not working

Task: I'm trying to create a fan-control with the arduino mega. I'm generating a PWM signal on pin 6 and 7 and want to use interrups to measure the rpm of the fans. Problem: On pin 2 and 3 everything ...
0
votes
1answer
108 views

Running hardware interrupt function on NodeMCU ESP8266, Exception(0) after four iterations, can't disarm interupt function

I've been trying to test the stability and consistency of hardware interrupts on my NodeMCU ESP8266. I'm using the Arduino IDE. This sketch should not require any external circuitry and I think, but ...
0
votes
1answer
208 views

Esp32 external interrupts sometime is missing

In short. ESP32, two water meters (hot and cold). Booth, hot and cold, some interrupts are missed. When i connect ESP32 to serial monitor and watch then all interrupts are detected (about 5-10 minutes)...
0
votes
0answers
33 views

LiquidCrystal swap lines with interrupt

#include <Wire.h> #include <LiquidCrystal.h> int temp; const int rs = 13, en = 12, d4 = 11, d5 = 10, d6 = 9, d7 = 8; LiquidCrystal lcd(rs, en, d4, d5, d6, d7); char Nick[15] = {' ', ' ', '...
0
votes
1answer
58 views

Is my sketch 'thread safe'?

I come from a .Net background, typically I would 'lock' operations on an integer when I have thread-safe requirements. I'm not sure that applies to my sketch here? Could I potentially bypass an ...
2
votes
1answer
112 views

Use ISRs inside a library more elegantly

At the moment I try to make a library which uses attachInterrupt(?,?,RISING) to read a sensor. The article of Nick Gammon on Calling an ISR from a class helped me a lot, but his "Glue routines" get ...
-1
votes
2answers
89 views

Running a motor for a 3 seconds continuously with and without interrupt

I have interfaced a dc motor and IR sensor to my nano. The DC motor is supposed to run only if the IR sensor detects an obstacle. Now, I'm trying to get the motor to turn off if continuously ...
2
votes
1answer
99 views

Arduino Project Interrupt Error?

I have a project to be made i.e. water Billing System using RFID(Mfrc522) on Arduino NANO. There is one difficulty that I haven't been able to overcome. I hope someone could help me out. Project flow: ...
0
votes
0answers
23 views

DS3231 clock module with cascaded FC-16 led matrix modules + Arduino Nano

I am using a DS3231 real time clock module and 4 cascaded FC-16 modules(they are basically MAX7219 led matrices based modules). My goal is to display a timetable, a schedule for a classroom on the ...
0
votes
1answer
105 views

Arduino Nano, DS3231 RTC clock module and 4 cascaded FC-16 led matrix modules

Like I said in the title, I am using a DS3231 real time clock module and 4 cascaded FC-16 modules(they are basically MAX7219 led matrices based modules). My goal is to display a timetable, a schedule ...
1
vote
1answer
84 views

Interrupt every second on ATTiny84 (and sleep the rest)

I'm building a digital watch just like in this post, except I'm using an ATTiny84. However, the ATTiny84 doesn't have an asynchronous Timer2 like the ATMega328 and does not have a power save mode, so ...
0
votes
1answer
211 views

Can I Interrupt on any keypress on this keypad?

I'm learning how to write code interrupt code. I just experimented with my first toy example that I got from here: const byte ledPin = 13; const byte interruptPin = 2; volatile byte state = LOW; ...
0
votes
1answer
31 views

Confused as to how 2 of my interrupts are firing from just 1 pin input?

I have the following code which uses interrupts to set a flag for whether serial IO should happen to update my PC about a particular pin input. So I have interrupts on pins 2 and 3. I am using the ...
0
votes
1answer
29 views

Pushbutton and switch case follow up question

PROBLEM STATEMENT: A circuit is measuring various parameters (Temperature, Humidity, etc.) through sensors connected to it continuously. When a Push Button is Pressed and Hold for 2 seconds in ...
0
votes
1answer
32 views

How to bridge free-running multichannel adc to serial?

I want to get meteo sensors values, and turn avr based 16mhz arduino (i have mega, but that seems not matter alot vs uno) into multichannel oscilloscope. Task details. Desired data rate is 8(uno) to ...
1
vote
0answers
51 views

One ISR should be called, but both ISR has been called on Arduino UNO

I experimenting with the interrupt ISR using Arduino Uno. In my circuit, I am taking two mechanical switches that are connected with Uno's interrupt pins, pins 2 and 3, and also taking a built-in LED ...
0
votes
1answer
82 views

How to use attachInterrupt() in ATtiny85 with Arduino IDE?

It's possible use external interrupts/attachInterrupt() with the ATtiny85 when I program with Arduino IDE? If is possible, how many inputs (for external interrupts) the ATtiny85 have and which are ...
-1
votes
1answer
65 views

PWM supplying led breaks down at near to zero threshold

I use timer1, mode 8, on both pin 9 and 10 at 1 kHz my PWM signal breaks down when I turn the potentiometer just above where I set the zero at, no matter where I set the zero at. I power the Arduino ...
0
votes
1answer
68 views

Interrupts inside a class attaching to the function of the class

Hello i have a class and i would like to attach an interrupt inside the class and attach it to a function of the class. class counter{ public: counter(int pin){ Ipin=pin; } void ...
-2
votes
1answer
129 views

Having issue with a redeclaration as a different kind of symbol

Been struggling with this for a few days and I suspect that i have several issues but I cannot find them. Project: Need a serial count that counts by 5-50 and a button interrupt should trigger a ...
0
votes
0answers
97 views

Detecting the stop of execution of a timer interrupt

This is my timer interrupt: void setup() { attachInterrupt(digitalPinToInterrupt(INTERRUPT_PIN), count_time_of_k_pulses, RISING); pinMode(OE_BAR_PIN, OUTPUT); pinMode(S0_PIN, OUTPUT); ...
0
votes
1answer
41 views

Continue playing sound during interrupt routine

I'm trying to play a tone (on an Arduino Mega through the tone library) and have the tone not be interrupted if an interrupt routine is called while the tone is playing. I'm not sure it's possible. ...
0
votes
2answers
95 views

How to multitask with interrupts on Arduino?

I am trying to build a cashless RFID based water dispensing unit. I am using Arduino mega 2560, PN532, relay, flow sensor. Here is the flow of the program in I2C mode; I have two functions, one to ...
0
votes
1answer
213 views

Faster TimerOne with Teensy 4.0 (600MHz)

I have a teensy 4.0 which runs at 600MHz, and is double superscaler (i.e. can execute two instructions per clock cycle, sometimes). I need an interrupt to happen faster than every microsecond. I've ...

1
2 3 4 5
10