mikroC Keypad library doesn't work

General discussion on mikroC.
Post Reply
Author
Message
underworldman
Posts: 270
Joined: 29 Jan 2010 16:36

mikroC Keypad library doesn't work

#1 Post by underworldman » 29 Jan 2010 16:43

Hello everyone,

I'm new here and i noticed that the 4x4 Keypad library for mikroC is absolutely unstable. The problem is that this library only works when you connect the keypad to PORTD as shown in the help of the mikroC compiler.

Could someone try connecting exactly as it is in the help, but this time with PORTA or PORTB?

It WON'T work!

I'm too lazy to write & debug the keypad and lcd configs in assembly, as this might take me days so i wanted someone to be of assistance with mikroC.

Regards,
Underworldman

underworldman
Posts: 270
Joined: 29 Jan 2010 16:36

This problem is solved

#2 Post by underworldman » 30 Jan 2010 16:21

Hello everyone; PROBLEM SOLVED.

I just thought that anyone in future who might be having the same problem might wonder how to solve it, so here's the solution:

A dude by the name Losic Tihomir directed me as follows:

For PIC16F887: The ANSEL register must be initialized to configure an analog channel as a digital input. Pins configured as analog inputs will read ‘0’.
http://ww1.microchip.com/downloads/en/D ... df#page=42

You need these two lines in main program:
Code:
ANSEL = 0;
ANSELH = 0;

Once more i thank you Losic Tihomir, very helpful person :)

Rk17
Posts: 3
Joined: 24 Feb 2012 18:38

Re: mikroC Keypad library doesn't work

#3 Post by Rk17 » 24 Feb 2012 19:17

Sir i also need help regarding my keypad library, it doesnt work as well.
this is the schematic of the module im using,

(file attached)

its rows are connected to the pull-up resistor unlike the one showed in the mikroc manual which the columns are the one connected to the pull down resistor to ground

can you please help memodify the code to work :(
please..... i cant use my training module right now because of this problem. thanks in advance sir!
Attachments
keypad.JPG
keypad.JPG (70.16 KiB) Viewed 2623 times

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: mikroC Keypad library doesn't work

#4 Post by filip » 27 Feb 2012 09:41

Hi,

I'm glad that you have solved your problem.

Regards,
Filip.

Rk17
Posts: 3
Joined: 24 Feb 2012 18:38

Re: mikroC Keypad library doesn't work

#5 Post by Rk17 » 27 Feb 2012 13:57

sir it still is not working on actual. But on simulation it works perfectly, i use proteus isis. What seems to be the problem, I cant figure it out sir pliz help me. :( Pliz take a second look at the schematic of my keypad, is it ok? or could it be the cause of the problem? :(

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: mikroC Keypad library doesn't work

#6 Post by filip » 28 Feb 2012 10:23

Hi,

Please see the datasheet and the schematics for the proper design and usage of the Keypad 4x4 :
http://www.mikroe.com/eng/products/view ... 4x4-board/

You will also find there the proper examples in mikroC that have been tested on our hardware.

Regards,
Filip.

Post Reply

Return to “mikroC General”