Go Down

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

mem

#30
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.

PaulS

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.

Groove

#32
Feb 09, 2010, 04:37 pm Last Edit: Feb 09, 2010, 04:39 pm by GrooveFlotilla Reason: 1
Quote
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
Per Arduino ad Astra

mem

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

Waterppk

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

mem

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