Jump to content

Assembly PIC Microcontrollers: Need help with project

- - - - -

  • Please log in to reply
3 replies to this topic

#1
manbearpig001

manbearpig001

    Newbie

  • Members
  • PipPip
  • 27 posts
Hey guys
It's been a whole since I have worked on this idea, but here is the project: The hardware is a circuit consisting mainly of a relay switch driven by a 18f4525 pic microcontroller. This microcontroller should be running a program constantly, that checks if buttons connected and displayed in a keypad are being pressed. This acts as a lock/unlock method with a 'password'. When the user types in the code, it sends 1 logic to the output pin that runs a transistor which turns on the relay, which activates the locking device. There are also output pins running a 7seg led, so that when the user presses any key, it displays what number the user presses. For this to work, I have the understanding that I need to be running an interrupter in the program. The hardware is nearly finished, just a little wiring left, but I have been struggling with the software.

If anyone could help me out with ideas/code samples on how I can check all input pins statuses, and if the pin being held high is the correct input pin at the correct time please post here. Keep in mind, if any other buttons are pressed, it needs to reset, so that the user cant just press random keys until it opens..

Thanks in advanced.

#2
Roger

Roger

    If nothing goes right, go left.

  • Administrators
  • 718 posts
  • Programming Language:C, PHP
  • Learning:Python
Can you post what you have already? That way, it's easier for someone to help you.
Check out our update Guidelines/FAQ. When posting code, remember to use code tags - Posted Image.

#3
manbearpig001

manbearpig001

    Newbie

  • Members
  • PipPip
  • 27 posts
I actually finished this project. If you want, I can post my source code. My solution was to periodically check each input port, and if an incorrect button is held high, I add one to a constant. If the constant is more than one, then I know that an incorrect button is pressed. I continue this until each correct button is entered.

#4
Roger

Roger

    If nothing goes right, go left.

  • Administrators
  • 718 posts
  • Programming Language:C, PHP
  • Learning:Python
Nice!
It'd be nice to post the code here. If anything, it can be helpful for someone else that has a similar question.
Check out our update Guidelines/FAQ. When posting code, remember to use code tags - Posted Image.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users