Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC pin latch

Status
Not open for further replies.

hantto

Member
Hello!

Will a PIC output latch maintain its value if the port is swiched to input?
I.e. if I write 1 to GP0 and then swich it to input to read the port and then swich it to output again, will the port still be 1?
 
Yes, with a qualifier. If you use any instructions on the port that are known to cause the R-M-W (read-modify-write) problem, like bcf and bsf, the GP0 output latch may get set to whatever value the GP0 input is at.

Regards, Mike
 
Depending how fast you do it and the load it may work or not. It's a nice way to build a cheap touch sensor so far.
 
That's a nice little circuit. I'll have to build it sometime to test it's performance. Cheers!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top