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
1
vote
0answers
35 views

Counting UP/DOWN, START/STOP problem using interrupt

so to keep it simple, I'm using Arduino UNO and I have a circuit with two push buttons, one for UP/DOWN and the other for START/STOP, wired to one interrupt and a seven segment display, at each press ...
1
vote
2answers
66 views

stop motor instantaneous with hall sensor problem

I have a problem with stopping motor at same spot when magnet pass.. I tried to add interrupt and to make code as clean as possible but no joy so far. Any suggestions? sw will add later, just ignore.. ...
1
vote
0answers
47 views

Correct usage of SPI with ISR

My Arduino needs to do: Run ISR as many times as possible/ as fast as possible. Occasionally receive data over I2C. Output data over SPI in ISR. My question is regarding SPI and ISR. The ...
1
vote
1answer
39 views

Why does Arduino Due appear to halt after single call to ADC_Handler?

In the simple example below I just software trigger an ADC acquisition and then set the builtin LED's digital out in the interrupt handler. I don't know why the program appears to halt however. void ...
2
votes
1answer
57 views

Comments change compiled behavior (sysTickHook weak reference override)

I have a very simple routine that lights up the built-in LED (pin 13) when a system tick timer fires off its interrupt. I override the weak reference to int sysTickHook(void) found in hooks.c. I found ...
-1
votes
1answer
34 views

Cannot change pointer for port in main loop

I am testing on an Arduino UNO. I want to use timer1 and interrupts to create various LED patterns. The LEDs may span multiple ports i.e PORTB and PORTD. I want to use a "volatile uint8_t*" ...
1
vote
1answer
48 views

Adding an Interrupt to ATtiny45 with Arduino

I recently wrote a simple script to...we'll say, "flash some LED's" and uploaded it to an attiny45. In short, the script cycles through 3 LED's and turns them on for a specified frequency, ...
2
votes
2answers
157 views

Keypad pin as an interrupt (Wiring or programming)

I have this project of a "phone". It consists of: Arduino DUE, 4x4 Keypad, SD Data shield, a phone receiver detect (on/off) an Amp and a Speaker. In the beginning, after the phone receiver ...
3
votes
2answers
243 views

MPU6050 Arduino Jeff Rowberg library interrupt Issue

I was trying to get the data from MPU6050 using the Arduino library mentioned here. The following code is an edited version of the sample code given in the library folder which seems to be working ...
2
votes
0answers
75 views

External Interrupt and Input Capture pin | Arduino MEGA

I have a code for finding the rpm of one system calling here as engine , the engine have a hall sensor output and I have tried the following Code #define SERVO_MIN 2000 #define SERVO_MAX 4000 struct ...
3
votes
1answer
70 views

False interrupt triggering Arduino Mega

I am using Arduino mega with 4 interrupts to find the rotation speed of 4 motors . For this I have used INT2, INT3, INT4, INT5 and the code for the same is given below struct Pulse { uint32_t ...
1
vote
1answer
65 views

Interrupt takes longer than expected [closed]

I am trying to write a delay function in C, which should take 0.5 seonds then carry on. I am aware that there are libraries for this purpouse, I want to make it myself. #include <avr/interrupt.h>...
1
vote
0answers
59 views

Arduino powered with 12v and interrupt noise

Hi i've a big problem with my project. I realized a simple project with Arduino Uno: i've attached interrupt to pin 2 to read water flow. If I power on Arduino from 5v usb all works as expected: my ...
1
vote
1answer
73 views

I am building a coin operated machine and am using arduino uno its working but i have to press the switch twice for credit to show on seven segment

int pin1 = 8, pin2 = 9, pin3 = 10, pin4 = 11; volatile byte num = 0; int coinPin = 2; void setup() { Serial.begin(9600); attachInterrupt(digitalPinToInterrupt(coinPin), inc_counter, RISING ); ...
1
vote
1answer
40 views

Using Arduino LMIC library with EnableInterrupt

I am using the EnableInterrupt library, infact the only library that I can find that allows me to use six interrupts to wake the Arduino. However when I use it with the LMIC library (Matthijs Kooijman ...
1
vote
2answers
113 views

Back EMF from Relay causing trigger on INPUT pin

I am wiring up a light show for my pickup truck. I have installed various high power spotlights and light bars into a dedicated relay/fuse box in the engine bay. These relays are wired into a switch ...
1
vote
1answer
52 views

Push button unexpected increment/decrement. I'm using attachInterrupt

I'm new to Arduino and need assistance from knowledgeable people. I'm having a problem with my code, which allows the user to increase or decrease the number by pressing buttons. From time to time, ...
0
votes
1answer
62 views

Save Watchdog ISR Return Address in EEPROM

If the WDT ever fires, from the ISR I save some info in EEPROM for later diagnostics before I drive the reset pin. Stack size, heap size, etc. It might also be useful to know where the code was when ...
0
votes
1answer
28 views

Unable to get readings for "Motor with Encoder"

I've posted to the DFRobot forum, who makes the FIT0186 motors, but no one seems to be replying there. So, excuse the copy pasting. It's probably an issue with the motor/encoder, but perhaps it has ...
1
vote
1answer
33 views

Arduino Nano skips statements after Interrupt

I am using an Arduino to control an AC Phase Control Circuit to control some lamps. The problem is that the interrupts seem to break the code inside the loop(). This Code should just blink one lamp. ...
0
votes
2answers
121 views

Invalid use of void expression (how to use function pointer with input)

I'm defining an attachinterrupt and I'm running into an error. The line in question is: void setup() { attachInterrupt(digitalPinToInterrupt(stallsense1), changedirection(1), RISING); ...
1
vote
1answer
35 views

How to get time from RTC after wake up from sleep?

I have a setup with an Arduino Pro Mini, a DS1307 RTC, a microSD shield and a microswitch. I've set an interrupt to the microswitch, so it'll wake up the Arduino when it changes status. Here is some ...
0
votes
1answer
25 views

Run computation only on request over serial

An Arduino Nano is set up to perform A/D conversions and send results out over Serial. Currently the code structure is like loop() { delayUntilNextTargetTime(); measure(); ...
1
vote
0answers
81 views

ESP32 can't enter interrupt anymore after interrupt appears during delayMicrosecond function

I have a strange problem with my ESP32 project. I use an ADPS-9960 for gesture control which triggers an external interrupt. In the interrupt handler itself I only set a variable that causes the ...
2
votes
3answers
84 views

Send button only works when pressed immediately after

I am new to Arduino and I am trying to create a Morse code based "chat". I can submit a message in Morse code using the send button (the one on the right,) and when I press the button on the ...
2
votes
0answers
50 views

Unknown text printing on Serial Monitor [closed]

I want to use the Serial Monitor for some debugging, but it prints something else. Edit- This only happens if I use the attachInterrupt() function I tried another program that does not use interrupts ...
0
votes
1answer
72 views

Check pin capabilities at compile time

Are there board-independent functions to check pin capabilities at compile time? I.e. Can the pin be used as output, as in digitalWrite()? Does the pin support PWM, as in analogWrite()? Does the pin ...
1
vote
0answers
117 views

Servo motor won't work for a specific code

I have written a code with interrupts to control the servo but my servos are not working. One is meant to work with interrupt but the other one has to simply move but it is also not working. Even the ...
1
vote
1answer
87 views

Dealing with noise in arduino interrupt

I'm makeing two modules, module2 gets sensor signal, and send wireless message to module1, with HC-12. Then module1 is going to do some work it is supposed to do. Circuit configuration is in the ...
0
votes
1answer
126 views

Using MCP23017 with 5 rotary encoders, WITHOUT missing a single step from any of them?

I have recently followed the instructions in the answer to this question: Reading several rotary encoders posted by maximilian-gerhardt I've wired everything up, and am using the interrupts example ...
1
vote
0answers
87 views

Issues with interrupts coming from RTC DS3231 and power supply interference

Several months ago I developed a device able to detect water flood in a closed space and do some operations in case (closing valves, issuing an acoustic and Bluetooth alarm etc.). After 8 hours it ...
2
votes
0answers
23 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
99 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
134 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
104 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
51 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
79 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
76 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
46 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 ...
2
votes
1answer
75 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
76 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 ...
2
votes
1answer
81 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
82 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
112 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
238 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
250 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
59 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 ...
1
vote
1answer
80 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
663 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
58 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 ...

1
2 3 4 5
12