@ device INTRC_OSC_NOCLKOUT
cmcon = 7
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 20h
DEFINE HSER_BAUD 2400
Include "modedefs.bas"
TRISB = %01000000
RCSTA=%10010000
PIR1=%00000000
PIE1=%00100000
INTCON = %11000000
On interrupt goto lemon
i var byte
aval var byte
bval var byte
cval var byte
dval var byte
eval var byte
fval var byte
gval var byte
hval var byte
aval = 1
loop:
if aval > 0 then
high portb.2
endif
for i = 1 to 255
pauseus 50
if i = aval then
low portb.2
endif
next i
goto loop
lemon:
disable
high portb.2
pause 500
low portb.2
PIR1=%00000000
'HSERIN [aval, bval, cval, dval, eval, fval, gval, hval]
enable
resume
END