Go Down

Topic: Clock with Arduino (Read 14796 times) previous topic - next topic


Feb 09, 2010, 04:29 pm Last Edit: Feb 09, 2010, 04:30 pm by mem Reason: 1
are you using 0018?

version 0017 disabled interrupts in delayMicroseconds and the LCD library does use this function.

Sounds like that may be the cause of you problem. Try it with 0018 if you are not yet using that.


I think I've read that the LCD library disables and re-enables interrupts. Maybe that's why millis is not keeping an accurate count.
The art of getting good answers lies in asking good questions.


Feb 09, 2010, 04:37 pm Last Edit: Feb 09, 2010, 04:39 pm by GrooveFlotilla Reason: 1
think I've read that the LCD library disables and re-enables interrupts

Can't think of any good reason why it should.  :o

Some delays, certainly, but the rest is just "digitalWrite"s
Some people are like Slinkies.

Not really good for anything, but they bring a smile to your face when pushed down the stairs.


It was a side affect of the way delayMicroseconds works that has been fixed in arduino release 0018


mem - you sir win a cookie.  I upgraded to v18 and it is now running perfectly.  I'll have to try my original code with the rest of the software but the timer works fine now  :D


Good to hear you have it working.

btw, the code posted in reply #14 has the advantage that is uses fewer variables and uses less processing time (it does two additions each second rather than two divisions each time through the loop).

Go Up