Firstly I have to say, I am very new to the Arduino, but I'm loving it. I used to do some microcontroller developments some 12 years ago with the 8051, but this is just fantastic.
Anyway, I am trying to utilize one of the hardware interrupts (Pin 2, int0) and I'm finding strange behavior.
I have a 1Hz clock on Pin 2 and a simple serial.println("Test") in the interrupt function. This works fine and if I add more println's it also works fine up to the point where I add a 6th or 7th println in the function, then nothing prints to the serial port at all. I am also trying to query a RTC within the ISR and nothing is printing. The code is below:
Wire.beginTransmission(0x68);//Send the address of DS1307
Wire.endTransmission();//The end of the IIC communication
Wire.requestFrom(0x68, 7);//IIC communication is started, you can continue to access another address (address auto increase) and the number of visits
seconds = bcd2bin(Wire.read());//read time
minutes = bcd2bin(Wire.read());
hours = bcd2bin(Wire.read());
week = Wire.read();
days = bcd2bin(Wire.read());
months = bcd2bin(Wire.read());
Year = bcd2bin(Wire.read()) + 2000;
Serial.print(Year, DEC);//Serial display time
Serial.print(" week: ");
Am I trying to make this ISR do too much?
Note: all variables have been set as volatile according to tutorials I have read.
Any help to make me understand would be greatly appreciated.