• 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.

I need to do a password-lock with PIC16F84A in C language ??

Not open for further replies.


New Member
I'm using the four bits RA0-to RA3 that comes from my mt8870(dtmf receiver)

I wanna a have a five digit password.

If somebody knows how to do that, I'll apreciate to learn it.


New Member
ehh.. I suppose that is fairly simple
just get the input, and compare with the password
if it is equal, then unlock (through some external circuit), otherwise, dont bother it, and remain lock
This can be done easily even using assembly


The best choice is probably to design a state machine for your pushbuttons and states. You would usually have a state for button pressed and then button released and with four inputs, it becomes fairly easy to design an arbitrary length password. Each correct button press just moves you to the next state, the last state being "unlock" or whatever. Each incorrect press moves you to either an error indicator state or back to the start state. You debounce the switches in software and it becomes fairly simple.
Not open for further replies.

Latest threads

EE World Online Articles