Code: Select all
define lcd_bits 4
define lcd_dreg portb
define lcd_dbit 0
DEFINE LCD_rsreg porta
DEFINE LCD_rsbit 3
define lcd_ereg porta
define lcd_ebit 2
define lcd_liines 2
output portb.5
symbol Rx=portb.5
pause 300
intcon=%00100000
option_reg=%10000100
brojac var word
sek var byte
minut var byte
minut=0
sek=0
on interrupt goto isr
intcon=%10100000
brojac=0
tmr0=131
main:
if brojac=250 then
lcdout $fe,1, dec minut dig 1,dec minut dig 0,":",dec sek dig 1, dec sek dig 0
sek=sek+1
if sek=60 then
sek=0
minut=minut+1
endif
brojac=0
endif
goto main
disable
isr:
brojac=brojac+1
tmr0=131
intcon.2=0
resume
enable
end
Molim pomoc, ne znam gde je probelem. Hvala unapred!