The only issue is timing!
You have set TMR0 at 1/2 second intervals
Code:
ClockLoop: IF intcon.2=0 THEN ClockLoop 'Poll for TMRO overflow
INTCON.2=0 ' Clear TMRO overflow flag
HzTimer=HzTimer-$1000 'decrement timer count
IF HzTimer < $1000 THEN
IF Col=10 THEN ' update time'
SS=SS+1
IF SS=60 THEN ' minute
SS=0
MM=MM+1
IF MM=60 THEN ' hour
MM=0
HH=HH+1
IF HH=24 THEN HH=0
ENDIF
counter1 = (HH*60)+MM
ENDIF
ENDIF
Col=Col+1
HzTimer=HzTimer+$7A12 ' Add 0.5 seconds to count
ELSE
' Do something here but must be less than 65.5 mSec
ENDIF
And again this code works every second
Code:
case DAWN
lcdout $FE,$80+13,"DAWN "
if ss//1= 0 then
if ss != old_ss then
B_PWM=B_PWM+1
old_ss=ss
endif
endif
if B_PWM = b_max then
Blue_Day_Cycle = DAY
endif
Change your TMR0 code +$7A12 to a lower value for say 1 msec. Then include for milliseconds in your clock and change all of the ss//1=0 instructions to trigger every 73 ms. I guess there will be more issues thrown up but looks easy to me.
Bookmarks