Thanks a lot for that code.
Could you explain how to calculate the mainloop time? Because I want to try with 250ms.
BTW, here is the code I modified from yours. I basicaly change the display rutine so I can use the 4511, but I think I modified the main loop time.
DEFINE OSC 20
TRISA = %11111111
TRISB = %00000000
OPTION_REG = %1111000
INTCON = %10100000
ToBeDisplay var word
num var byte
displayloop var byte
OverFlowVar var word
delay var word
ToBeDisplay = 0
tmr0 = 0
on interrupt goto SetVarToBeDisplay
MainLoop:
DisplayRefresh:
for displayloop = 0 to 111
num = ToBeDisplay dig 0
portb = num
high portb.4
gosub DelayBetweenEachDigit
low portb.4
num = ToBeDisplay dig 1
portb = num
high portb.5
gosub DelayBetweenEachDigit
low portb.5
num = ToBeDisplay dig 2
portb = num
high portb.6
gosub DelayBetweenEachDigit
low portb.6
next
ToBeDisplay = OverFlowVar + tmr0
OverFlowVar = 0
tmr0 = 0
goto DisplayRefresh
DelayBetweenEachDigit:
for delay=1 to 307
@ nop
next
@ nop
@ nop
@ nop
@ nop
@ nop
@ nop
@ nop
return
disable
SetVarToBeDisplay:
OverFlowVar = OverFlowVar + 256
intcon.2 = 0
tmr0 = 0
resume
enable
Bookmarks