Keypadpassword

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
bodexchrist
Posts: 19
Joined: Fri Jul 17, 2009 10:40 pm
Contact:

Keypadpassword

Post by bodexchrist »

Hello Benj,

I am trying to write a password code program using the keypad and lcd display.My program takes four numbers from the keypad and compare it with the set password,if it matches the " welcome" string will be displayed on the lcd else it displays "invalid code". The problem is that it works well with the simulator but it does not work the development board i donΒ΄t know the reason.Can you help me check it pleaseeeee. I have the code for your perusal.

Thanks.
Attachments
Flowcode6.fcf
This is the password program
(11.49 KiB) Downloaded 354 times

User avatar
Steve
Matrix Staff
Posts: 3426
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: Keypadpassword

Post by Steve »

There are many reasons why the simulation does not behave the same way as on the chip itself. Here's a few of the more common reasons:
  • inappropriate configurations word settings for your hardware
  • wrong clock speed and/or settings
  • not using the "start" macro to initialise the LCD

bodexchrist
Posts: 19
Joined: Fri Jul 17, 2009 10:40 pm
Contact:

Re: Keypadpassword

Post by bodexchrist »

Hi Steve,

I have checked the problem again and it still did not work. Please check it for me

Regards.

User avatar
Steve
Matrix Staff
Posts: 3426
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: Keypadpassword

Post by Steve »

According to your file, the oscillator in your hardware is a 19.6608MHz crystal. If this is not the case, you will need to change the clock speed setting and maybe the configuration data in the Flowcode file.

Apart from that, perhaps the hardware is not connected correctly. I can see nothing particularly wrong with the program.

You should create a simple "led flasher" type program to make sure that the clock and other hardware setttings are correct for your program. Once you have a simple program running, add small pieces of functionality to your program and repeat the test. Eventually you will find the reason why there is a discrepancy between the hardware and the simulation.

bodexchrist
Posts: 19
Joined: Fri Jul 17, 2009 10:40 pm
Contact:

Re: Keypadpassword

Post by bodexchrist »

I have tested the hardware with a couple of simple programs and it works well including the led flasher program you talked about.The major problem now is that when i press the wrong numbers on the keypad it actually works well but when i press any of correct numbers it does show anything on the lcd display.
I have checked the clock settings it looks ok .Please help me check it again ,this problem looks really strange to me.

User avatar
Steve
Matrix Staff
Posts: 3426
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: Keypadpassword

Post by Steve »

This is almost impossible for us to check because we do not have access to your hardware.

Also, you originally said it did not work. I took this to mean that the program was totally not working. Now I find out that it is working, apart from something to do with the keypad. If you do have a problem, can you please be a bit more specific as this will enable us to help you much quicker.

Your problem still points to an error with the hardware setup. You should create simple programs using the keypad to try to solve this problem.

bodexchrist
Posts: 19
Joined: Fri Jul 17, 2009 10:40 pm
Contact:

Re: Keypadpassword

Post by bodexchrist »

Thanx for your prompt responses ,i will have to try to sort it out myself.

stubbornbull
Posts: 6
Joined: Wed Jul 22, 2009 3:52 am
Contact:

Re: Keypadpassword

Post by stubbornbull »

hey

i followed a tutorial that is somewhat like this, i think its even on youtube. what i'm tryin to do is to make it a four digit code(like yours) but adding the * and # to it...so i guess it would be 5 digit code, * to turn on/reset alarm and the # to turn it off. if i ever get to run right i'll post it, i'm still kind of a greenhorn at this, best of luck to you

bodexchrist
Posts: 19
Joined: Fri Jul 17, 2009 10:40 pm
Contact:

Re: Keypadpassword

Post by bodexchrist »

Ok. i will be expecting your post.

stubbornbull
Posts: 6
Joined: Wed Jul 22, 2009 3:52 am
Contact:

Re: Keypadpassword

Post by stubbornbull »

bodexchrist wrote:Ok. i will be expecting your post.
pass is 1234 plus * for on/armed, or # for off/disarmed

i'm trying to make this back to a four digit code, and by using one code activate/deactivate the alarm, the alarm portion of this is going to be on a 16f88 and the keypad portion is going on a 16f877a. the alarm is also being done using flowcode/eblocks, when i get a better grip on this i'll post everything/pics so you guys got a better idea
Attachments
KEYPAD1.fcf
(20.85 KiB) Downloaded 349 times

bodexchrist
Posts: 19
Joined: Fri Jul 17, 2009 10:40 pm
Contact:

Re: Keypadpassword

Post by bodexchrist »

"pass is 1234 plus * for on/armed, or # for off/disarmed

i'm trying to make this back to a four digit code, and by using one code activate/deactivate the alarm, the alarm portion of this is going to be on a 16f88 and the keypad portion is going on a 16f877a. the alarm is also being done using flowcode/eblocks, when i get a better grip on this i'll post everything/pics so you guys got a better id"



You have done a good job so far, but i still cannot see the effect of the alarm. I was expecting to see how the alarm component is connected.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Keypadpassword

Post by Benj »

Hello

This example should help. It contains the normal keypad password code but then if the password is correct you can turn an alarm on or off.

Hope this helps.
Attachments
Keypad_Alarm_V3.fcf
(15 KiB) Downloaded 392 times

bodexchrist
Posts: 19
Joined: Fri Jul 17, 2009 10:40 pm
Contact:

Re: Keypadpassword

Post by bodexchrist »

Very clear to me now.


stubbornbull still expecting ur finished version .


Thanks

Post Reply