I used to do uart using mikroC but now i need to do a simple serial communication between two pics the sender has a button on portb.0 acts as a start button and a led on the other receiver pic has a led on portb.0 to blink when button pressed Here's The Code
Sender:
INCLUDE "modedefs.bas"
#CONFIG
#endconfig
Define OSC 8
' Main program loop
start:
if portb.1==0 then 'button pressed
Serout portc.6, 2, ["A"]
endif
Goto start
End
Reciever:
#CONFIG
#endconfig
Define OSC 8
' Main program loop
start:
Serin portc.7,2,["A"]
if portc.7=="A" then
high portb.0
pause 500
low portb.0
pause 500
endif
Goto start
End
Bookmarks