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
1answer
82 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
53 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 ...
0
votes
1answer
38 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
14 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
60 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
55 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 ...
-1
votes
0answers
24 views

Double Can bus Mircrocontroller logic how to correctly implement it

I'm trying to make double can bus sketch on Arduino Due.and i'm facing an issue at the start.I can't figure out a way to make the logic asynchronous. since the inner logic of the each can bus have ...
0
votes
1answer
34 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
29 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
23 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
23 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
47 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
36 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
62 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
40 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
43 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
91 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
34 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
90 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
73 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
vote
0answers
63 views

Problem with counting inside INT0 ISR while in PowerDown

The issue that I have is in INT0 service in which it doesn't perform properly when MCU is set in PowerDown mode. I declared a global variable as "counter" and put it inside INT0 ISR but its value ...
0
votes
1answer
65 views

Missing buffers with serial communication

I am currently facing a problem with Serial communication with my arduino MEGA 2560. My project is to collect data from an encoder. There are 2 signals : ACP and ARP. For 1 rotation, there are 16 384 ...
0
votes
1answer
32 views

Behaviour of tone() not as expected within while loop

I have a smoke detector with a piezo buzzer. I want to operate the arduino in low power mode so that it will last on a 9V battery. I've attached an interrupt, and when the digital output of the MQ-2 ...
1
vote
1answer
157 views

I2C OLED conflicts with Interrupt

I'm using Nmradcc.h in combination with a OLED I2C. The nrmadcc.h is using a interrupt 0 on Pin 2, the OLED uses A4 and A5. After initialisation of the OLED and the Function The problem is, I can ...
0
votes
1answer
46 views

How do I code delay inside a ISR?

I have built a basic obstacle avoidance robot. When the sensor senses an obstacle it gives a RISING interrupt to pin 2. At this moment I want the robot to come back for 2 seconds and turn right for 2 ...
0
votes
2answers
52 views

Cancelling state of code before going to interrupt

Currently, I have two loops in my Arduino code. Certain cases take me from loop 1 to loop 2 I also have an ISR When my ISR condition is met the code is executed and part of the ISR code is supposed ...
-1
votes
2answers
135 views

Detecting when a timer interrupt does not run

I am dealing with code thatt i received that relies heavily on timer interrupts. i am using arduino Mega (Funduino) More specifically, when a signal arrives in a pin, an interrupt is run that starts ...
0
votes
2answers
45 views

Receive socket when in loop arduino (Interupt a while loop with a socket)

I'm currently working on an arduino project. Were the arduino is communicating with a NodeJS server via web sockets. The socket connection is working fine and has no problems. But the problem I ...
0
votes
0answers
31 views

Using interrupts to facilitate time-keeping

I am making a clock on an Arduino Mega using interrupts to facilitate time-keeping. The following is my timer breakdown: Timer0: Used for my calls to millis() which allows me to determine when a ...
0
votes
0answers
69 views

Radio receiver: deep sleep when no byte arrives, and wake up when a byte arrives?

This code works to listen for bytes via radio (with a 433 Mhz receiver module) with the Manchester library and Manchester code, and do an action when certain bytes are received: #include "Manchester....
0
votes
2answers
355 views

Disable interrupts when doing critical things?

I've got a few functions like this that log, or do more critical things like get/save configuration variables. /** Write weather data to csv commit: datetime,minHumidity,maxHumidity,...
0
votes
3answers
186 views

PCINT0, PCINT1, PCINT2, etc. on ATtiny45/85

According to the datasheet: we could think that, if we want to have a pin change interrupt for 3 pins, we have to create multiple instances: ISR(PCINT0_vect){ ... } ISR(PCINT1_vect){ ... } ...
0
votes
0answers
207 views

Sparkfun ESP32 WROOM Thing Plus Deep Sleep & Interrupts codes “marriage” problem

Would like to ask for assistance. Tried several routes. My knowledge is lacking and unable to progress further. I think I am very close to the solution (maybe couple of lines of codes away), but the ...
1
vote
1answer
385 views

How to assign an interrupt to a button press with an ATtiny? (interrupt not fired with my code)

(Here is finally a solution). I'm using the following code on a ATtiny45 to assign an interrupt to a button press (pin #7, PB2, INT0). However the LED doesn't blink when the button is pressed, as if ...
0
votes
3answers
54 views

ATmega328P - Problem using timer 2 for tone generation

I'm simply trying to use timer 2 for tone generation and what I get is a very faint and strange tone (almost like its modulated somehow as there is a "pulsing" to it). Here's my simple code: #include ...
0
votes
0answers
73 views

RadioHead Library and SPI Device (MAX7219) not working together

I am trying to use the RadioHead Library (receiving a 433Mhz Signal) and an LED Matrix (Max7219 via SPI) on the same Arduino Leonardo. Now either one works fine when only it is connecting. But when ...
0
votes
1answer
29 views

Setting a number inside a struct causes timer to misbehave

The following code: struct l{ uint8_t pin; uint8_t sensePin; float brightnessTarget; uint8_t PWMvalue; uint8_t inc; }; typedef struct l led; led* redLed; led* whiteLed; unsigned ...
0
votes
0answers
54 views

Multiple Interrupt Pins Generates Wrong Pulses

On MKR WAN 1300 board I added pulldown resistors to 0,1,4,5,6,7,8 pins to count pulses.I can catch interrupts, but sometimes pulses occur on other pins even though they are not touched. For example, ...
0
votes
1answer
130 views

Laser Controller using Arduino Uno

---> I am trying to create a controller using Arduino Uno that simply detects pulses from a waveform generator mimicking a Laser Machine and then switches between 4 state machines states at the output ...
0
votes
1answer
28 views

When does interrupt get fired

When does the ISR mapped to SPI_STC_vect (SPI transmission complete) get fired? Does it fire after a byte has been received (eight clock cycles) of when the slave select changes back to high to ...
0
votes
1answer
199 views

real-time reading of a quadrature encoder at full resolution with only one interrupt on ATmega328

I want to read a quadrature rotary encoders at full resolution with only one interrupt on Arduino Nano (ATmega328). So I found out that we can use XOR to reach a full resolution: Where pin 3 ...
0
votes
0answers
31 views

Alternative for Particle Photon's Timer

I am converting a program made for particle photon to a Mega, everything is working except for the interrupt timer. The code that is of concern is (it's a .cpp file being included in the main .ino) ...
0
votes
1answer
50 views

Variable updated in ISR is miscounting

I'm using a timer to fire a interrupt in configurable time periods. In that ISR, a pin is toggled, and a uint32_t variable is incremented. In the main program, a while loop waits until that variable ...
1
vote
1answer
116 views

Attiny85 Watchdog fires only once

I build something like a flashlamp with different modi. From the hardware site it's quite simmilar to the Nanjg105c. There is a Attiny85 which generates a PWM signal to an AMC7135. I have one push ...
1
vote
2answers
67 views

Interrupt is activated as soon as I insert a jumper wire into the port

I have written a very simple code to test the interrupt functionality of my Arduino Uno expansion board: const byte buttonPin3 = 3; void setup() { pinMode(buttonPin3, INPUT); attachInterrupt(...
1
vote
0answers
504 views

pulseIn on ESP32 return 0 regularly

I'm using pulseIn on an ESP32 for measuring a frequency between 500 Hz and 10 KHz. I measure both the HIGH and the LOW time, as all simple examples suggest. 95% of the time the result is correct, but ...
0
votes
1answer
170 views

24/14 second countdown timer or shot clock for basket ball start/stop button doesn't respond well

Start button doesn't respond correctly, i can't figure out whats wrong with the code ? pls help, this code is for 24 second and 14 second countdown timers in a same unit comes with three physical ...
0
votes
1answer
46 views

Is it possible to put priorities between external interrupts?

My question is quite simple. I am using one external interrupt on the Mega2560 to wake it up with an alarm from the rtc DS3231 and record data from sensors for about 30 seconds and I would like also ...
0
votes
3answers
223 views

Arduino Uno not working after Short-circuit

While wiring up my new Arduino Uno R3, I accidentally shorted the 5V pin and the GND pin (for less than a sec). It was powered by a 12V 500mAh power supply through the Arduino DC power jack. . The ON, ...
0
votes
0answers
105 views

How to manage interrupt from accelerometer BMA220?

I would like to use the interrupt register from the BMA220 accelerometer in order to detect high-g shock. I am using a Mega2560 and the sensor is powered by 3.3 V. I use a voltage divider to convert ...

1
2 3 4 5
10