Your welcome, Thanks for letting us know.
I will explain what was happening for anyone wishing to learn how the timer0 side works. Then it would be easier to create/alter flowcharts that involve timer0
For a brief explernaion of timer0 interrupt including why I added
See:
http://www.matrixmultimedia.com/mmforum ... =26&t=8660
With the original digital clock example which I have attached, if you look at the timer0 properties In INITIALISE macro (double click or right click timer0 icon and select properties), the prescaler is set for 1:128 and below it shows interrupt frequency at 150Hz.
This means that the timer0 macro is accessed once every 1/150 = (6.667ms to 3 decimal places) = 150 times a second hence 150Hz
That is why in the SECONDS macro there is a decision branch
, since 6.667ms x 150 = 1 second
So each time the SECONDS macro is accessed the SECOND_COUNTER is increased by 1, and when the value reaches 150, exactly a second has passed. The name SECOND_COUNTER is a bit missleading since when this value is increased by 1 its only 6.66ms has elapsed and not 1 second!
Going to the example armagon29 posted,
is changed to
.
Since this there is a calculation within the Yes part:
then after timer0 interrupt is been accessed ONCE!this decision will then be true, both
and
will increase by +1. Looking at the timer0 properties interrupt frequency is 19200Hz this will happen every 1/19200 = 52us. Thats why the timing is out.
Here's what I did. I decided that the timer0 interrupt should trigger every 100ms since flowchart is created so 10 x
increases
SECONDS_TENS
by 1, and 10 x
increases Seconds by 1. Therefore since to get 1 scecond, the interrupt has to trigger 100 times. Since you want to LCD to display every 10ms like a stop watch, I have changed interrupt to the nearest lower value to 100Hz = 75Hz, and used my program posted here:
http://www.matrixmultimedia.com/mmforum ... =26&t=8660
To obtain desired value for
.
Martin