Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Adam said:I commented out the hserin line, and put some code in its place to flash a led when a serial interrupt occurs (I fiqured I better get interrupts to work before I try and read the serial buffer)
@ 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