been trying to get this program to work again forever. its compiled for a 16f690. at current it is just on a breadboard. it only works for say 5 cycles err.. iterations sp?.. anyways it goes through its program say 5 times before it just up and quits. I know its running through because I test the output pins and it pulses and pauses for the set times and just stops..

the operation is as follows.. main processor receives the word "relay" with serial input command from the slave 12f509 outputing the word "relay"

not currently implemented
main processor sends a command back out to the slave 12f509 to trip the relay..

just trying to get the main code below to work on a 16f690 currently.. this is driving me mad.. I see nothing too wrong with the code to cause it to do this. all the settings are set to no mclr (input only) and intoscio (checked them on the code uploader too)


Code:
 define osc 4
INCLUDE "modedefs.bas"
@ device PIC16f690, MCLR_OFF
info var byte[10] 'really should be 5 long, but I lengthened it just for the halibut.


info[0] = "t" 'trying to appease the compiler.. not really needed
info[1] = "t"
info[2] = "t"
info[3] = "t"
info[4] = "t"
info[5] = "t"





trisa = %00000000
trisb = %00000000
trisc = %00000000

        'trisa.0 = %0   'me trying to manually set tris registers
        'trisa.1 = %0
        'trisa.2 = %0
        'trisa.3 = %0
        'trisa.4 = %0
        'trisa.5 = %0
        
        'trisb.4 = %0
        'trisb.5 = %0
        'trisb.6 = %0
        'trisb.7 = %0
        
        'trisc.0 = %0
        'trisc.1 = %0
        'trisc.2 = %0
        'trisc.3 = %0
        'trisc.4 = %0
        'trisc.5 = %0
        'trisc.6 = %0
        'trisc.7 = %0


'ADCON0 = 0         'fiddling with additional registers trying to get
'ADCON1 = 0         'all outputs set to digital
'ADCON1 = 15        

ansel = 0
anselh = 0





poll:
        
        'SEROUT porta.0,N2400,["p"]        'I had set all pins to output data
        'SEROUT porta.1,N2400,["p"]        'originally, all pins worked at one
        'SEROUT porta.2,N2400,["p"]        'time using this.
        'SEROUT porta.3,N2400,["p"]
        'SEROUT porta.4,N2400,["p"]
        'SEROUT porta.5,N2400,["p"]
               
        'SEROUT portb.4,N2400,["p"]
        'SEROUT portb.5,N2400,["p"]
        'SEROUT portb.6,N2400,["p"]
        'SEROUT portb.7,N2400,["p"]
        
        'SEROUT portc.0,N2400,["p"]
        'SEROUT portc.1,N2400,["p"]
        'SEROUT portc.2,N2400,["p"]
        'SEROUT portc.3,N2400,["p"]
        'SEROUT portc.4,N2400,["p"]
        'SEROUT portc.5,N2400,["p"]
        'SEROUT portc.6,N2400,["p"]
        'SEROUT portc.7,N2400,["p"]
        
        
        
        pause 100
        SERIN portc.5, N2400, 1000, nxt, ["r"], info[0] 'Get input
        SERIN portc.5, N2400, info[1] 'get the word "relay"
        SERIN portc.5, N2400, info[2]
        SERIN portc.5, N2400, info[3]
        SERIN portc.5, N2400, info[4]
        
        
        SEROUT portc.0, N2400, [info[1], info[2], info[3], info[4] ]
        'above line: output received data "relay" to computer serial line
        
        pause 500
        
        
        
        
gosub poll
	
    
    nxt:
    serout portc.4, N2400, ["timeout"]
	return