this is close i think but i need more foot notes on what each piece the code does . the chip would need to watc its inputs at turn on to set the code then after its set it would compare what it sees at its inputs to this code if its a match then the chip goes to a loop that displays what it sees coming in (porta) over to the outputs(portb) however if it sees the code again or its int pin is hit high then it goes back to watching its inputs for the code (back to the begining if you will) like i said i need good doccumentation of this. thanks for your response. Tony Nixon wrote: > > slowpicn wrote: > > > > does anyone have sample pic code for pic16f84 to make it watch its > > inputs for a specific code (example 1,2,3 in binary) then once it sees > > this code it displays everthing at its inputs to its out puts until a > > outside key says shut down then it goes back to watching inputs for code > > again? anyone please .... > > Don't know if this is what you meant, but... > > MnLoop movf portb,w ; read portb > movwf Temp ; store it for future testing if need be > > xorlw 1h ; test for 1 > btfss status,z > goto MnLoop ; not 1 > > movf portb,w ; read portb > bsf status,rp0 > clrf trisb ; portb = outputs > bcf status,rp0 > movwf portb ; data onto portb > > wait nop > btfsc porta,0 ; wait until porta,0 = lo > goto wait > > bsf status,rp0 ; portb = inputs again > movlw 0xff > movwf trisb > bcf status,rp0 > goto MnLoop > > -- > Best regards > > Tony > > 'The Engine' - Design your own programmer. > > http://www.picnpoke.com > Email picnpoke@cdi.com.au