Forums MikroC Pro for PIC Project Discussions keypad input problem.

This topic contains 25 replies, has 4 voices, and was last updated by  abdou oussalah 1 month, 2 weeks ago.

  • Author
    Posts
  • #2710

    bethel
    Participant

     

     

    After building the temperatures control project everything worked fine except the keypad that inputs ‘3’ on its own without being pressed while other keys dosnt work, after several process of trouble shooting which includes detaching the keypad which would cause it to stop inputting  ‘3’ but if I touch any of the terminals on the pic18f…where the keypad is connected to with my finger it continues inputting ‘3’. Please help my project defence is just few day away.

  • #2714

    Bitahwa Bindu
    Keymaster

    Can  you post the circuit diagram, screenshot of your hardware and the source code of your project we can have a look at it.

  • #2715

    bethel
    Participant

    The simulation on Proteus is working fine but on my practical work am having challenges sir.

  • #2716

    bethel
    Participant

    Here are the files

    Attachments:
    You must be logged in to view attached files.
  • #2719

    bethel
    Participant

    Sorry  plz this is the correct schematic

    Attachments:
    You must be logged in to view attached files.
    • #2721

      Bitahwa Bindu
      Keymaster

      Where is the picture of your physical hardware?

      Please post the full code, not just the c file. You must zip all your files together.

  • #2728

    bethel
    Participant

    Here is the zipped file sir

  • #2729

    bethel
    Participant

    File

    Attachments:
    You must be logged in to view attached files.
  • #2732

    Bitahwa Bindu
    Keymaster

    You said you are experiencing your problem after you built your project. How are we going to guess what could be wrong if the simulation works fine? We need at least to look close at your construction. That is why we asked you a photo of your project.

    Can you upload it?

  • #2733

    bethel
    Participant

    Sorry for the delay, the pics was actually bigger the the required size of upload, I was figuring a way of minimizing it. Thanks

    Attachments:
    You must be logged in to view attached files.
  • #2736

    bethel
    Participant

    Please am still very expectant of a solution to this issue as I have been working hard to find a solution but haven’t gotten any yet. Please help

  • #2747

    Bitahwa Bindu
    Keymaster

    In your code below ANSELD = 1; write these code:

    LATB=0;

    Check all your connections on the keypad and make sure your keypad is not making any contact if not pressed. Check continuity between column 3 and all the rows line. If you don’t press 3, they must not be any continuity.

    If possible, try to test with a different keypad.

  • #2749

    bethel
    Participant

    Thank you sir,  I have resolved the issue, in simulation resistors are only required in the colums while in real hard ware resistors are required in both rows and columns of the keypad.

    • #3130

      abdou oussalah
      Participant

      sir would you show me how did you do it in proteus those resistors

  • #2750

    Bitahwa Bindu
    Keymaster

    Hi Thanks for your feedback, it will assist others as well if they come across the same problem as you.

  • #2780

    katlego
    Participant

    Sir am having the same problem as him I tried to put resistors on both columns and rows but still doesn’t work please help

    No

  • #2781

    Bitahwa Bindu
    Keymaster

    What problem exactly you are facing?

    The other guy had problem with a key being displayed without being pressed.  Are you facing the same problem?

  • #2782

    katlego
    Participant

    Yes, it keeps in putting 3 even when I didn’t press 3

  • #2783

    Bitahwa Bindu
    Keymaster

    Are you doing this same project or a different one? Can you give us the details of your project like the PIC and if possible upload your code and schematic diagram we will have a look and see what could be wrong.

  • #2784

    katlego
    Participant

    Same project and I didn’t change the code just took the 1 u gave us, everything is the same and on proteus it works fine

  • #2785

    Bitahwa Bindu
    Keymaster

    Hi. Try these:

    1. Set the unused pins as output pin to ground with a 10k resistor to avoid floating, like the unused RB3:

    TRISB.B3 =0;  //Set as Output

    LATB.B3 =0; // Set Output low.

  • #3131

    abdou oussalah
    Participant

    thats my circuit before i added the 3 other resistor and still nothing change

    Attachments:
    You must be logged in to view attached files.
    • #3133

      Bitahwa Bindu
      Keymaster

      Hi.

      How will we see from the breadboard?

      Post either a Proteus schematic image to see which PIC you are using, how every device is connected or you can draw with a pen and attach the schematic image.

      If you modified the code that is published on our website or used a different PIC model, please upload the mikroC project as well.

    • #3134

      abdou oussalah
      Participant

      hi ! no i worked with the same program also the same pic 18F45K22 and also the same proteus schematic ! the one change its the keypad i did it with push button but its the same

      Attachments:
      You must be logged in to view attached files.
    • #3137

      Bitahwa Bindu
      Keymaster

      Where are the resistors in the columns on that schematic?

       

    • #3138

      abdou oussalah
      Participant

      sir thats before i added them ! there is after i added

      Attachments:
      You must be logged in to view attached files.

You must be logged in to reply to this topic.