So, all you're really trying to do right now is get a 'loop back' to work?
@ device hs_OSC, wdt_on, pwrt_on, protect_off
define osc 20
Include "modedefs.bas"
trisc.6=0:trisc.7=1:trisd.0=0:serialdata var byte : counter var word : counter2 var word
main:
counter=counter+1 : portd.0 = counter.1 'toggle led on portd.0 each time thru the loop
serialdata=0:serin portc.7, n9600, serialdata:if serialdata=0 then goto main 'get serial data, if none, restart loop
counter2 = counter2 + 1:serout portc.6, n9600, [ dec counter2 , ":" , serialdata , 13 , 10 ]:goto main
end
Bookmarks