Matrix keyboard

Z MAM wiki

(Rozdíly mezi verzemi)
Přejít na: navigace, hledání
m (typo)
(input pin config)
Řádka 15: Řádka 15:
*connect the keyboard, detect that ANY key is pressed
*connect the keyboard, detect that ANY key is pressed
*detect WHICH key is pressed
*detect WHICH key is pressed
 +
 +
 +
Input pins are configured by both DDRx and PORTx:
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! DDRx
 +
! PORTx
 +
! pin function
 +
|-
 +
! 0
 +
! 0
 +
! input without pull-up rezistor
 +
|-
 +
! 0
 +
! 1
 +
! input with pull-up rezistor
 +
|}
 +
 +
Good way to test input is to read PINx via SBIS or SBIC instruction.

Verze z 1. 3. 2012, 14:47

Matrix keyboard looks like this:


It can be connected like this (you may use different microprocessor, this is just an example):

Soubor:IC-matrix keyb.png


Choose whatever microprocessor you like (among those we have), connect also some LED(s) using ideas from our previous seminar and:

  • detect and indicate that one particular key is pressed (plan your keyboard connection but at this moment you may just use one wire instead of the keyboard)
  • connect the keyboard, detect that ANY key is pressed
  • detect WHICH key is pressed


Input pins are configured by both DDRx and PORTx:

DDRx PORTx pin function
0 0 input without pull-up rezistor
0 1 input with pull-up rezistor

Good way to test input is to read PINx via SBIS or SBIC instruction.

Osobní nástroje