A couple of notes:
TRISA = 0 'outpu <------ might only set porta.0 as an output(?)
use TRISA = %00000000 to make sure
TRISB = 1 'input <------ will only set portb.0 as an input
use TRISB = %11111111 to make sure all
of port B is set to input
start:
serin PORTB.3,n2400,[B0]
pause 1 <------ don't pause here, you want to read the serial
and get done what you want done and get
back to reading the serial port as quick as
possible
if B0 = $aa then led1
if B0 = $aa then led2
if B0 = $5a then led3
if B0 = $5a then led4
goto loop
led1:
porta.0 =1
pause 200 <----------- take out all these pause 200 lines
goto start
led2:
porta.1 =1
goto start
led3:
porta.2 =1
goto start
led4:
porta.3 =1
goto start
loop:
porta.0 =1
goto start
end[/QUOTE]
And you last post, 'where is the serin command?'. I'm using the hardware serial port driven by the 'on interrupt' command. Read the PBP manual a bit on it, then read the datasheets on the serial port and interrupts.
Give me a few minutes. I'll rework your code into something useful.
JDG
Bookmarks