Thanks for replying,
The relays that toggle work wonderful, and the ones that I want on only when I am pressing the switch, they just stay on. the relay circuits from their corresponding Pic output are Identical with a diode flyback protection.
Thanks for helping
Here is the code again with Loop1,
define osc 4
INCLUDE "MODEDEFS.BAS" 'Serial communication mode definition file
@ DEVICE MCLR_ON, INTRC_OSC, WDT_Off, LVP_OFF, BOD_OFF, PWRT_ON, PROTECT_Off
CMCON=7
keydata VAR byte
serpin VAR porta.1 'serial input pin
PORTA = 0
PORTB = 0
trisa = %00000010
trisb = %00000000

PAUSE 100 ' settle time

loop:

gosub loop1
branch keydata, [rly1,rly2,rly3,rly4,rly5,rly6,rly7,rly8]
GOTO loop

rly1:
HIGH PORTB.6
pause 50
GOTO loop

rly2:
HIGH PORTB.1
pause 50
GOTO loop

rly3:
HIGH PORTB.2
pause 50
GOTO loop

rly4:
HIGH PORTB.3
pause 50
GOTO loop

rly5:
HIGH PORTB.4
pause 50
GOTO loop

rly6:
toggle PORTB.5
pause 250
GOTO loop

rly7:
TOGGLE PORTB.6
PAUSE 250
GOTO loop

rly8:
toggle PORTB.0
pause 250
goto loop




loop1:
SERIN serpin,N2400,[254],keydata
return