Connect with us

Keypad with latched switches

Discussion in 'Microcontrollers, Programming and IoT' started by malsch, Sep 21, 2011.

Scroll to continue with content
  1. malsch

    malsch

    4
    0
    Apr 29, 2011
    Hi,

    i am using the 8051 and am having trouble with scanning a 2x8 keypad. This is due to the fact that the switches are latched ones (push to make switch). Also more than one switch can be pressed at one time.

    The code written, scans each column (the column which is being scanned is set to low) and when a switch is pressed, the output pin is set to low when the column is scanned. The problem arises when more than one switch is pressed in each column. I think this is because when more than one switch is pressed, both the input and the output pins are then set to low due to the two (or more) columns being shorted together. If anyone can help, it would be greatly appreciated. Thank you

    Code:

    #define Rows P1
    #define Columns P2
    #define DigitalOP P3

    void main(void)
    {
    while(1)
    {
    Columns=0xFE;
    BPMDelay(1000);
    Columns=0xFD;
    BPMDelay(1000);
    Columns=0xFB;
    BPMDelay(1000);
    Columns=0xF7;
    BPMDelay(1000);
    }
    }
     

    Attached Files:

    • 111.JPG
      111.JPG
      File size:
      47.7 KB
      Views:
      184
  2. Digital_Angel_316

    Digital_Angel_316

    41
    0
    Oct 1, 2011
    I think you are correct and must implement a multi- or n-key rollover. This may mean simply putting diodes in your switch matrix to isolate each key as it is scanned. Check the simple article at the link below and ask if it needs more explanation.
    http://en.wikipedia.org/wiki/Rollover_(key
    )
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-