Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
4 answers
138 views

Atmega328p stops mid instruction when in interrupt

I want to make a basic temperature/humidity/CO2 controller with a SDC41 sensor and i want to use an INT0 interrupt to switch from normal controller mode to menu mode to change set values. When i press ...
Stefan Manolescu's user avatar
1 vote
0 answers
69 views

Arduino Nano 33 IoT: PWM read jitter

I am trying to read two 2 kHz (500 μs period) PWM waves (from two Hall-effect sensors) at two digital pins of an Arduino Nano 33 IoT simultaneously with on-duty ranging from roughly 30 to 70%. One ...
rtx_q505's user avatar
-1 votes
1 answer
144 views

SX1276 Interrupt Flags never clear, and digital IO lines never rise/fall

I am using an SX1276 chip from Paradisetronic. I adapted the Arduino RadioLib library to my board (Beaglebone Black Rev C). I noticed that the IRQ flags will not be cleared. According to the manual (...
lrdewaal's user avatar
1 vote
0 answers
96 views

Fall edge interrupt constantly triggering without any visible edge

I'm trying to implement a button-operated sleep mode toggle on a Sparkfun Artemis module. Button press one puts the Artemis to sleep, button press two wakes it up. I'm coding it in the Arduino IDE and ...
E.HP.S's user avatar
  • 359
0 votes
0 answers
54 views

Experiencing Much Higher Data Rate than Timer Interrupt Settings While Reading IMU Data via I2C on Arduino

I am currently using an Arduino MKR ZERO to gather IMU data from three MKR IMU SHIELD boards(BNO055 IMU). I have utilized the <Adafruit_ZeroTimer.h> library to set a timer interrupt with a ...
JING's user avatar
  • 1
0 votes
1 answer
297 views

How can I change SPI ports on an Arduino?

My end goal is to read information from an nRF24l01 module connected to my Arduino UNO R3 and generate an interrupt while doing that. I have read that for hardware interrupts, only pins D2 and D3 can ...
insipidintegrator's user avatar
0 votes
1 answer
54 views

How to make a circuit which can give divided voltage to ADC and can send a trigger pulse to INT0 when I press a button?

I connected 4 buttons to the ADC module of AVR-ATMega328p with different resistor values, To know which button is pressed this ...
in.yssh's user avatar
  • 45
2 votes
0 answers
90 views

Nucleo32 with STM32F303K8 crashes when setting PA2 as Interrupt and triggering it

I am using a nucleo 32 for my project. I am using arduino and creating a TCP modbus and RTU modbus server. I have set the pins as folows: Description Type Arduino STM32 Pin Number Pulse input 1 ...
DriesVanDB's user avatar
0 votes
1 answer
72 views

Why are pulses not generated? [closed]

Task: Implement interrupt processing when the button is pressed, and the very start on the rising edge, the interrupt pin and to which the button is connected 11. Implement the processing of the ...
Good York's user avatar
0 votes
0 answers
160 views

ADXL345 Interrupt doesn't work

I am using adxl345 with arduino. I am using sparkfun's library. I am using adxl345 with I2C. I can read adxl345 value without any problem and I can detect inactivity and activity. ...
Tryingtogetsome's user avatar
0 votes
1 answer
159 views

Reading data with ADXL345 only when new data arrives

I am using ADXL345 with Uno and ESP32. I am using ADXL345 with 50 Hz like this : ...
Tryingtogetsome's user avatar
5 votes
1 answer
1k views

Why is HAL_GetTick not protected by a CRITICAL SECTION?

I'm trying to better understand atomicity in embedded systems. While researching the topic, I encountered this problem: In the STM32 HAL, the system tick is provided by ...
gbt's user avatar
  • 713
0 votes
1 answer
188 views

ATMega328p with SSD1306 and DHT22, help in code

Hi I am trying to make a project that uses DHT22 (Temperature & Humidity Sensor) and SSD1306 (OLED Display) with the ATMega328p. I want the OLED Display to be normally off and should turn on for 5 ...
dracarys's user avatar
  • 121
0 votes
0 answers
36 views

Measure acceleration for X mins

I have a situation where I have to check if a body is motion or not for x minutes. If it is in motion for x minuteds then the function should return true, else it should return false. I have an ...
EngGuy's user avatar
  • 1
1 vote
2 answers
980 views

Why does attachInterrupt() not run even though my interrupt pin is changing from LOW to HIGH / HIGH to LOW?

I have an arduino uno and I am running this code here: ...
Trev347's user avatar
  • 1,204
2 votes
3 answers
501 views

Arduino Uno prescaler, not measuring what I expected

I'm using the following code to set a pin high or low (each cycle.) I measure that pin with a logic analyzer. I use an Arduino Uno with 16MHz frequency. I set a timer interrupt with a prescaler of 64, ...
Mart's user avatar
  • 376
2 votes
1 answer
444 views

MCP23017 open drain interrupts not working as expected

I have multiple MCP23017 ICs with their interrupts all connected in serial. The interrupt pins are configured to be open-drain. All the A port interrupt pins are connected together and all the B port ...
P4rk's user avatar
  • 23
-1 votes
3 answers
962 views

How to read multiple quadrature encoders using an Arduino

I am developing a 4-wheel mobile robot. Each motor has a quadrature encoder with 2000 pulses per revolution (PPR). I have tried to read the encoders' pulses using an interrupt, but the counted values ...
Saravana kannan's user avatar
-1 votes
2 answers
470 views

Why is my interrupt so slow/inconsistent? Arduino external interrupt as pedestrian crossing button

So this is the setup; It's a traffic light system with 2 road lights and a pedestrian crossing. The normal sequence is alternating between main road green and secondary road green. It reads these ...
EmptyAtoms's user avatar
0 votes
1 answer
559 views

Can a Triac be driven using only positive voltage due to the laws of Q1 and Q4 quadrants?

I have a BTA12-600B Triac and an Arduino. Is it possible I can trigger both positive and negative amplitudes of an AC cycle by suppling only a positive voltage from the Arduino digital pin to the ...
S To's user avatar
  • 11
0 votes
2 answers
197 views

SPI communication with MLX75306 optical sensor array

I am having some trouble talking to an optical sensor array with SPI (MLX75306, data sheet). I am using an Arduino Nano Every. I am not familiar with SPI communication and I have the feeling I am ...
Priegel's user avatar
  • 31
1 vote
2 answers
556 views

Combining interrupts and debouncing on a keypad

I would like to interrupt a program when a key is pressed on a keypad, and figure out which key has been pressed. I do not care much for ghosting effects, this is supposed to be operated with one ...
user42875's user avatar
  • 1,374
3 votes
5 answers
1k views

How can I debounce a switch on both positive and negative-going edges?

I would like to connect a mechanical switch to an interrupt pin on an Arduino Uno processor where the interrupt is configured for CHANGE interrupts (i.e., triggers on either a positive-going or ...
Jim Luby's user avatar
-3 votes
3 answers
700 views

How to write own ISR handler [closed]

I am learning about AVR programming and I know we have to use avr/interrupt.h library to use interrupts. However, my main reason to learn AVR programming is to program without any library so I want to ...
Syed M Erdum Adnan's user avatar
1 vote
0 answers
424 views

Wake up with external Interrupt from deep sleep mode (Adafruit Feather 32u4)

I have an Adafruit Feather ATMega 32u4. I want to put it into sleep mode and wake it up with pressing a switch as an external interrupt. This is what I tried so far and which worked: switching a LED ...
Larsi's user avatar
  • 11
0 votes
0 answers
245 views

Why Arduino not receiving RS485 data?

I am trying to send data from Arduino mega (message "ping") to Arduino nano, then send back (message pong) to the mega board, I am not receiving "pong" back to the mega board, why ...
kobi89's user avatar
  • 194
3 votes
3 answers
2k views

How does the Arduino NANO deal with simultaneous external interrupts?

I am a beginner with Arduino NANO and this is something I've been trying to figure out for a few hours now. Say, in setup(), I have the following snippet of code: ...
user208872's user avatar
0 votes
2 answers
2k views

WEMOS D1 R1 Interrupt repeats continuously, when triggered, Is it bouncing? How to fix it?

I am having such a nightmare to make it work, I am using a WEMOS D1R1 to handle the movement of an encoder via external interrupts. Instead if detecting the edge (L to H), it detects the status, so ...
tgtech's user avatar
  • 1
0 votes
2 answers
221 views

Interrupts are firing when touching ground with metallic things

I'm making a circuit on a breadboard (before SMD design) for a battery-powered device. When USB is connected to any wall-adapter, the device wakes up when touching any ground wire on the breadboard ...
Helyon's user avatar
  • 73
1 vote
3 answers
5k views

Counting pulses using Arduino Uno

I am trying to count pulses from a waveform generator using an Arduino Uno. The waveform generator is set at the following settings: Waveform Type: Pulse Freq: 20 Hz (50ms) Amplitude: 3.0 Vpp Offset: ...
sk95's user avatar
  • 25
1 vote
0 answers
167 views

How to set registers of accelerometer BMA220?

I first wrote my problem in Arduino Stack exchange (https://arduino.stackexchange.com/questions/68438/how-to-manage-interrupt-from-accelerometer-bma220) but I was told that I might get a better help ...
JamesONeil's user avatar
2 votes
1 answer
793 views

Arduino to Attiny841 with ATTinyCore -- pins not working

I have code that works using Arduino. Because I wanted to size down the project, I replaced it with an Attiny841. Process: I soldered the 841 on an adapter and checked all pins using a multimeter ...
Nils Deschrijver's user avatar
2 votes
0 answers
652 views

Pulses counting problem from npn proximity with interrupts in arduino

I am interfacing an open output npn proximity sensor with Arduino nano. I have used very silly approach of voltage divider as I was not sure that in open output sensor you can get whatever voltage you ...
Saqib Sohail's user avatar
4 votes
2 answers
682 views

Is it a good idea to refresh a display (8x8 LED matrix in this case) inside an interrupt handler?

Let's say I have an Arduino connected to a 8x8 LED matrix. In my case, the LED matrix is driven using two 74HC595 shift ...
tigrou's user avatar
  • 1,923
1 vote
1 answer
392 views

Is it the right use of the RTC RV8523 to wake up an atmega328p?

I'm using the RV8523 to wake up every 2 minutes an arduino atmega328p. The rtc is wired like this : Where INT1 is wired to Port D pin 3. The internal pull up resistor is activated and yet it's ...
A.Girafe's user avatar
1 vote
1 answer
213 views

Interrupt circuit

I'm using an 'Arduino like' board with a PIR sensor that gives 3.3V when movement is detected. The board usually stays in sleep mode, and wakes up when a LOW value is given to a specific pin. What'...
Nicola's user avatar
  • 143
3 votes
1 answer
1k views

How to reliably update PWM duty cycle on an Arduino Due with a SAM3XE

I have an Arduino Due, which has an Atmel SAM3XE MCU. I want to generate a PWM signal and I want to change the duty cycle every cycle of the PWM reliably so I can generate an output signal such as a ...
Matttoni's user avatar
2 votes
2 answers
1k views

ATtiny13A's timer appears to be very inaccurate, is it normal? [closed]

I wrote this blink program for my ATtiny13A and tried to measure the accuracy with an Arduino Uno but the timer seems to be quite inaccurate. On the ATtiny I am running on the ...
Pouria P's user avatar
  • 320
4 votes
3 answers
944 views

Interrupt Arduino if voltage is below some level or a switch which will not allow current to pass across if no sufficient voltage

I'm a very beginner in electronics. Actually from software field. With some craze started with Arduino. What am trying to implement is a simple interrupt mechanism which will interrupt Arduino if AC ...
Sandeep Thomas's user avatar
2 votes
2 answers
1k views

Ultrasonic sensor(ping) and deep sleep Arduino

Is it possible to use an ultrasonic sensor to wake up an Arduino which is in deep sleep when an object is detected within a few cm and then do stuff?
Vladimir's user avatar
  • 157
4 votes
2 answers
974 views

How to manually clear OC1A and OC1B?

On the arduino uno (= ATmega328/P), how can I manually clear the timer 1 output compare signal? The purpose of the code is to generate some output pulses after a precise interval from the input pulse....
AJMansfield's user avatar
1 vote
2 answers
4k views

What are the advantages or disadvantages that using internal interrupt instead of external interrupt in MCU?

in my project it seems I must using internal interrupt instead of external interrupt because my MCU run out of external interrupt pin. Here is an internal interrupt example I've found here. I am ...
Yank's user avatar
  • 179
2 votes
2 answers
2k views

Missed Interrupt Problem with Attiny85

I'm trying to use an Attiny85 (digispark) to wake another controller from sleep (an ESP8266). The Attiny is connected to an IR receiver which has an active low output. Basically I have connected an ...
localhost's user avatar
  • 302
0 votes
2 answers
950 views

Modifiying variable inside of Interrupt vector. AVR

My question is again about modifying variables inside the ISR. If the variable used only inside of ISR, I don't have to declare it as volatile, right? After some researching, I figured out that ...
DaurenD's user avatar
  • 81
0 votes
2 answers
3k views

Sensing Voltage with a Digital Pin

I am relatively new with Arduino and did a little bit of research prior to this post. But I am trying to sense when I have voltage coming from an AC/DC converter (12Vdc) so I can switch from my ...
Mason's user avatar
  • 1
0 votes
3 answers
1k views

Convert reed switch disconnection or SPST off to single "LOW" pulse

I'm trying to wake up my Arduino and run some code when a reed switch or SPST switch connected to an interrupt is opened. If my Arduino is in powered off mode, only LOW interrupts are accepted (not ...
Victor Van Hee's user avatar
1 vote
2 answers
3k views

Determine input frequency of square wave w/ ICR in Atmega328p

I'm trying to obtain the input frequency of a square wave using the input capture register of an Atmega328p. So far, it works sporadically -- which is to say, when I input a 75 kHz square wave, the ...
user3753934's user avatar
2 votes
3 answers
5k views

Arduino analog interrupt LDR

I am using an LDR on an Arduino Pro Mini with an analog interrupt. The Arduino goes to deep sleep when there is no light or it's not busy: Sleepy::powerDown(); ...
Rebel Designer's user avatar
0 votes
3 answers
1k views

AVR-C turning led off after number of blinks with interrupts

so what I am trying to do is that I am trying to make the led blink for a certain number of times before it turns off. I want to avoid using delays so I tried utilizing the interrupt and I also used a ...
Redrachet2's user avatar
1 vote
1 answer
10k views

Stop timer set new value and start again AVR (Interrupt)

I have AVR MCU. I am playing with timer now. What I need ? I have timer counting up with some frequency. In each interrupt I am incrementing variable, and somewhere I need to check value of this ...
solderingiron's user avatar