well my program compiled smoothly but it didnt work as I expected.. here it is .. "btw iam a newbie .. and this is my first atempt to use the thing" ..
#################################################
Define loader_used 1
include "modedefs.bas" 'include serout defines
clear
init:
TRISB=%00000000 'all ports B output
TRISA=%11111111 'all ports A input
TXEN var PORTB.0
PWRUP var PORTB.1
TXP var PORTB.2
RXP var PORTA.0 <--- here is the pin where I recieve the serial data from
LED var portb.3
EYEMOD1 var Byte
RXDATA var byte
TXDATA VAR BYTE
CHILD1 var byte
num var Byte
PORTB=%00000000
EYEMOD1=%10110100
CHILD1=%00000011
RXDATA=%00000000
main:
Receive:
High PWRUP
LOW TXEN
Pause 3
Serin RXP,T9600,1000,Standby,["A"],RXDATA <<--- iam suspecting this
if RXDATA=EYEMOD1 then
goto transmit
else
LOw PWRUP
PAUSE 2000
goto Receive
endif
Standby:
Low TXEN
Low PWRUP
Low led
pause 5000
goto Receive
Transmit:
High PWRUP
HIGH TXEN
pause 3
TXDATA=RXDATA | CHILD1
Serout TXP,T9600, ["A",TXDATA]
PAUSE 1000
goto Standby
END
################################################## ##
Bookmarks