I'm busy writing a asm program for the 16f877 and have a question or two on the flowchart logic I'm using.
Its a bit difficult without a diagram but here goes.
Its for a combination lock with a few fancy features.
I'm using a interrupt which increments counters which is used to keep track of the date/time.
1) When the main prog starts I write the date/time on the lcd.
2) If key pressed check if its the # key.
3) If not # then save key and goto 1
4) If # pressed then check if code is *1
5) if not *1, then check if code matches passord, do some stuff, goto 1
6) If *1 then goto change password routine.
7) goto 1
Now my question - everything is working fine but when I press *1 and go to the password change routine I then do another loop to read in old password and new password. While in this loop I read the keypad for old and new password.
If for example someone enters the password change routine by mistake and then doesnt go any further its stuck in a loop. The date/time on the LCD won't get updated.
What the best method to exit this routine if its never completed - much like a timout reached then goto 1
I thought about using another timer - if it reaches 30 secs then goto 1
Is there an easier way?
Hope this kinda makes sense
Its a bit difficult without a diagram but here goes.
Its for a combination lock with a few fancy features.
I'm using a interrupt which increments counters which is used to keep track of the date/time.
1) When the main prog starts I write the date/time on the lcd.
2) If key pressed check if its the # key.
3) If not # then save key and goto 1
4) If # pressed then check if code is *1
5) if not *1, then check if code matches passord, do some stuff, goto 1
6) If *1 then goto change password routine.
7) goto 1
Now my question - everything is working fine but when I press *1 and go to the password change routine I then do another loop to read in old password and new password. While in this loop I read the keypad for old and new password.
If for example someone enters the password change routine by mistake and then doesnt go any further its stuck in a loop. The date/time on the LCD won't get updated.
What the best method to exit this routine if its never completed - much like a timout reached then goto 1
I thought about using another timer - if it reaches 30 secs then goto 1
Is there an easier way?
Hope this kinda makes sense