You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does anyone have problem with attachInterrupt while using hd44780ioClass/hd44780_I2Cexp.h?
The Arduino Uno gets freeze while running the folowing code (it's only a part of it).
#include <Wire.h>
#include <hd44780.h>
#include <hd44780ioClass/hd44780_I2Cexp.h>
#include <util/parity.h> //comment out if you don't use an AVR MCU
int interruptPin = 3;
int ledPin = 13;
//hd44780_I2Cexp lcd(0x3f, I2Cexp_BOARD_SUNROM);
hd44780_I2Cexp lcd;
volatile unsigned long lastInt = 0;
volatile unsigned long long currentBuf = 0;
volatile byte bufCounter;
void setup(){
Serial.begin(115200);
Wire.begin();
lcd.begin(16, 2);
pinMode(ledPin, OUTPUT);
pinMode(interruptPin, INPUT);
attachInterrupt(digitalPinToInterrupt(interruptPin), DCF77_ISR, CHANGE);
lcd.setCursor(0, 0);
lcd.print("up:");
lcd.setCursor(0, 1);
lcd.print("down:");
lcd.setCursor(0, 0);
}
Thank you. Any suggestion is welcomed.
The text was updated successfully, but these errors were encountered:
You have not shown any of the main code but
I'm guessing this issue is caused by something that is being done in the ISR that was attached.
The Wire library uses interrupts, if interrupts are blocked or masked when calling a Wire library function, the Wire code can get stuck in an infinite look looking for an event (that is set by the Wire ISR) that will never happen because the Wire library ISR isn't getting to run.
So for example, if your attached ISR runs and attempts to use the Wire interface by using the hd44780 library, that will cause the Wire library to hang (because at that point interrupts are masked) and your ISR will never complete.
Hello,
Does anyone have problem with attachInterrupt while using hd44780ioClass/hd44780_I2Cexp.h?
The Arduino Uno gets freeze while running the folowing code (it's only a part of it).
Thank you. Any suggestion is welcomed.
The text was updated successfully, but these errors were encountered: