constants [[rcreg $fae] [rcsta $fab] [spbrg $faf] [pir1 $f9e] [txsta $fac] [txreg $fad] [t2con $fca]] global [position destonation place rec-cmd] to powerup write spbrg 25 ; sets baud rate to 19200, assuming 4MHZ write rcsta $90 write txsta $24 write t2con 6 main end to startup uart-send $55 main end ;in your main program make a loop that regularly looks at bit 5 of pir1 ;if it is high then read the received data byte from rcreg to main loop[ wait 2 if testbit 5 pir1 [ print read rcreg clearbit 5 pir1 ] if testbit 2 rcsta [ clearbit 4 rcsta mwait 10 setbit 4 rcsta flash ] ] end ;when you want to transmit to your slaves call this function ;with the data byte you want to send like this: (uart-send 55) to uart-send :n waituntil [testbit 1 txsta] write txreg :n end