This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Matrix Keypad for Atmel AT89C51SND1

Hi all,

I'm quite new at this, so please bare with me. I have a question regarding Atmel AT89C51SND1. For my application I need 12 different keys. As i understadn the AT89C51.. has 4 interrupt driven keys.

My guess is I can setup a 4 x 3 matrix keyboard? But, I need help in understanding how I would go about doing this in C.

Also, more specifically I need to know, if a user presses a key then how would I know which one of the 12 keys was pressed?

Thank you very much for your help.

  • so please bare with me.
    I do not think so, but I will bear with you :-)

    I have a question regarding Atmel AT89C51SND1. For my application I need 12 different keys. As i understadn the AT89C51.. has 4 interrupt driven keys.
    I do not understand, the chip does not have keys

    My guess is I can setup a 4 x 3 matrix keyboard? But, I need help in understanding how I would go about doing this in C.
    C or assembler, no difference:
    1)enable col1, any rows low? if yes, process
    2)enable col2, any rows low? if yes, process
    3)enable col3, any rows low? if yes, process
    4)again from 1

    Also, more specifically I need to know, if a user presses a key then how would I know which one of the 12 keys was pressed?
    answered above

    Erik

  • I have a question, since the keypad is interrupt driven how would i deal with that?

    First i'll Enable Col 1, if any row is low it would jump it interrupt service routine?
    and then process to find which key in the row was pressed?

    and repeat the process for all 3 columns?

  • I have a question, since the keypad is interrupt driven how would i deal with that?
    Since you have to debounce anyhow, it makes no sense to make the keypad routine interrupt driven by key presses. Make it run every 10ms controlled by a timer. If you insist on interrupt when key pressed, just enable all columns when you are not in the ISR>

    Erik