I have two interrupt pins on my Mega 2560 used for tracking the position and displacement of my motor encoder. I added a button-triggered interrupt for capturing RGB values of fluids (using the TCS230 sensor). When I pressed the button, I was able to successfully capture RGB values without interrupt the other timers in my loop() (even though the RGB values were completely off, didn't matter).
I have now been writing a procedure layout using the MD_TCS320.h library for the color sensor. I tested it on another, brand new Mega 2560 (using delay(250) as my timer, no button-triggering ISR). Everything went well, and the RGB values were on the dime (credit to the guy who made the library).
The MD_TCS320.h library uses another library, FreqCounter.h, which uses its own interrupt to output on pin 47 (which really isn't a specific interrupt pin as noted in the documentation for Mega 2560.) It also mentions that "Pins Unusable with analogWrite()" are 9,10,44,45,46. I am using all of them for other purposes (LCD particularly).
So....the problem. When I combine all of these functions with my original Mega 2560, and press the button for the ISR routine of "snap-shooting" an RGB value (which seems to me to be an interrupt within an interrupt), my Serial monitor freezes and so does my LCD....I don't think the Arduino can handle that much. (For the record, I commented out all Serial.print() functions and the result was still the same.)
I also have a temperature monitoring system that continuously runs in the loop() function...so that's another load.
Any ideas as to why this happens? Should I explicitly attach an interrupt to pin 47? Or is there too much going on?