Searching \ for 'sample pic code' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'sample pic code'.

Truncated match.
PICList Thread
'sample pic code'
1999\06\13@203752 by slowpicn

picon face
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 ....

1999\06\13@211818 by Tony Nixon

flavicon
picon face
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 spam_OUTpicnpokeTakeThisOuTspamcdi.com.au

1999\06\13@214755 by slowpicn

picon face
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:
{Quote hidden}

1999\06\13@220228 by Tony Nixon

flavicon
picon face
slowpicn wrote:
>
> this is close i think but i need more foot notes on what each piece the
> code does .

Your needs are a bit cloudy. Is the code sent in serially or parallel?
Which ports are used for what?

PortA is 5(6) bits wide, and PortB is 8.

Is changing the PortB value going to affect the INT pin (PortB[0])?

Your request seems fairly simple to implement, but it's hard to give a
specific answer to a not so specific question :-)

Email me privately if you like, to keep the bandwidth down, and I'll see
what I can do.

--
Best regards

Tony

'The Engine' - Design your own programmer.

http://www.picnpoke.com
Email picnpokespamKILLspamcdi.com.au

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...