I will try to skip all the details of my project, but hopefully give enough information for some clue to the solution. I can give more details if needed of course.
I am using scratch to control my arduino through a variation of the firmata firmware. I use hex files of the firmata firmware (modified). When I load my firmware hex file and try PC control, sometimes it works just fine , and sometimes it goes about 5 times too slow. When the board / firmware goes into the slow state, I can fix it by uploading an old version of the firmware from about 2 years ago, then immediately uploading my new firmware again. Then the new firmware works fine.
So I don't think that the problem is in my firmware code exactly, because I can fix it by uploading old firmware and then uploading my new firmware again.
So, when uploading a hex file (or an IDE sketch for that matter), is there SOMETHING ELSE that gets uploaded to the arduino board that is not in the sketch? Is there some other "firmware" or "boot file" (not sure what I am looking for) that get's updated when a sketch is uploaded?
Any clue why sometimes my firmware might run really slow, and then be fixed by uploaded old firmware and then re-uploading my present firmware.
Thanks for any advice! Intermittent problems are the worst !