Difference between revisions of "Universal 4x4 keypad"

From ScienceZero
Jump to: navigation, search
(Configuration mode)
 
(29 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
[[Image:Hexkeypad.png|thumb|400px|right|Universal 4x4 keypad diagram]]
 +
The universal 4x4 keypad uses a PIC16C84 or compatible running at 4 MHz to transmit keycodes from a standard matrix keypad over a selectable interface.
 +
 
==Keypads==
 
==Keypads==
3 predefined keypads and one user definable keypad. Selectable binary or ASCII.
+
3 predefined keypads, one user definable. Selectable decimal, ASCII or key number output.
===Telephone keypad===
+
Telephone   Calculator  User defined (default content)
  1 2 3 A
+
  1 2 3 A     7 8 9 +    7 8 9 /
4 5 6 B
+
  4 5 6 B    4 5 6 -     4 5 6 *
7 8 9 C
+
  7 8 9 C    1 2 3 *     1 2 3 -
* 0 # D
+
  * 0 # D    0 . E /    C 0 = +
 
+
===Calculator keypad===
+
7 8 9 +
+
  4 5 6 -
+
1 2 3 *
+
0 . E /
+
 
+
===User defined keypad===
+
  7 8 9 /
+
4 5 6 *
+
1 2 3 -
+
  C 0 = +
+
  
==Interface==
+
==Interfaces==
 
*RS-232
 
*RS-232
 
**16 to 43 478 Baud
 
**16 to 43 478 Baud
 +
**Data out and inverted data out for generating standard RS-232 voltages with no external components by using one data output as a virtual ground.
 
*SPI
 
*SPI
**83 kHz with enable
+
**83.33 kHz clock with enable.
 
*Parallel
 
*Parallel
**4 bit parallel output of key number
+
**4 bit parallel output of key number with 64 µs enable.
 
*MIDI
 
*MIDI
  
Line 31: Line 23:
 
*Selectable beep/LED
 
*Selectable beep/LED
  
==Pin assignemnt==
+
== Configuration mode ==
*RB0-3 = Keyboard output/Parallel data output
+
Hold down any key when turning on to enter configuration mode. Press 1 to identify keyboard type or key number two for the user defined map.
*RB4-7 = Keyboard input
+
* 1 - Initialise EEPROM to default settings
 +
* 2 - Beep On/Off (1|0)
 +
* 3 - Baudrate (00016-43478)
 +
* 4 - Character map (RAW=1 | Telephone=2 | Calculator=3 | User defined=4)
 +
* 5 - Character type (Decimal=1, ASCII=2)
 +
* 6 - Interface (RS-232=1 | SPI=2 | Parallel=3 | MIDI=4 | I2C=5(Not done) | 1Wire=6(Not done) | PS2=7(Not done) | OFF=8)
 +
* 7 - Define keys for user defined key map (key then 000-255)
 +
 
 +
Any other key than 1-7 to exit configuration mode
 +
 
 +
== Default settings ==
 +
*Interface - RS-232, 1200 Baud, 8N1
 +
*Keymap - Telephone
 +
*Type - ASCII
 +
*Beep - On
 +
 
 +
==Pin assignment==
 +
*RB0-3 = Keyboard row output/Parallel data output
 +
*RB4-7 = Keyboard column input
 
*RA0 = DATA (RS-232, SPI, MIDI)
 
*RA0 = DATA (RS-232, SPI, MIDI)
*RA1 = CLOCK (SPI)
+
*RA1 = CLOCK (SPI), /DATA (RS-232)
 
*RA2 = ENABLE (SPI, Parallel)
 
*RA2 = ENABLE (SPI, Parallel)
*RA3 = BEEPER/LED
+
*RA3 = Beeper/LED
*RA4 = Free
+
*RA4 = Not connected
  
 
+
== Connection diagram for keypad ==
==Connection diagram for keypad==
+
 
If the keypad is 3 keys wide; leave RB7 disconnected.
 
If the keypad is 3 keys wide; leave RB7 disconnected.
 
  RB0---X---X---X---X--
 
  RB0---X---X---X---X--
Line 52: Line 61:
 
       |  |  |  |
 
       |  |  |  |
 
       RB4 RB5 RB6 RB7
 
       RB4 RB5 RB6 RB7
 +
 +
== Source code and HEX file ==
 +
*Still testing... E-mail if interested.
 +
 +
[[Category:Electronics]]

Latest revision as of 20:19, 2 April 2009

Universal 4x4 keypad diagram

The universal 4x4 keypad uses a PIC16C84 or compatible running at 4 MHz to transmit keycodes from a standard matrix keypad over a selectable interface.

Keypads

3 predefined keypads, one user definable. Selectable decimal, ASCII or key number output.

Telephone   Calculator  User defined (default content)
1 2 3 A     7 8 9 +     7 8 9 /
4 5 6 B     4 5 6 -     4 5 6 *
7 8 9 C     1 2 3 *     1 2 3 -
* 0 # D     0 . E /     C 0 = +

Interfaces

  • RS-232
    • 16 to 43 478 Baud
    • Data out and inverted data out for generating standard RS-232 voltages with no external components by using one data output as a virtual ground.
  • SPI
    • 83.33 kHz clock with enable.
  • Parallel
    • 4 bit parallel output of key number with 64 µs enable.
  • MIDI

Misc

  • Selectable beep/LED

Configuration mode

Hold down any key when turning on to enter configuration mode. Press 1 to identify keyboard type or key number two for the user defined map.

  • 1 - Initialise EEPROM to default settings
  • 2 - Beep On/Off (1|0)
  • 3 - Baudrate (00016-43478)
  • 4 - Character map (RAW=1 | Telephone=2 | Calculator=3 | User defined=4)
  • 5 - Character type (Decimal=1, ASCII=2)
  • 6 - Interface (RS-232=1 | SPI=2 | Parallel=3 | MIDI=4 | I2C=5(Not done) | 1Wire=6(Not done) | PS2=7(Not done) | OFF=8)
  • 7 - Define keys for user defined key map (key then 000-255)

Any other key than 1-7 to exit configuration mode

Default settings

  • Interface - RS-232, 1200 Baud, 8N1
  • Keymap - Telephone
  • Type - ASCII
  • Beep - On

Pin assignment

  • RB0-3 = Keyboard row output/Parallel data output
  • RB4-7 = Keyboard column input
  • RA0 = DATA (RS-232, SPI, MIDI)
  • RA1 = CLOCK (SPI), /DATA (RS-232)
  • RA2 = ENABLE (SPI, Parallel)
  • RA3 = Beeper/LED
  • RA4 = Not connected

Connection diagram for keypad

If the keypad is 3 keys wide; leave RB7 disconnected.

RB0---X---X---X---X--
      |   |   |   |
RB1---X---X---X---X--
      |   |   |   |
RB2---X---X---X---X--
      |   |   |   |
RB3---X---X---X---X--
      |   |   |   |
     RB4 RB5 RB6 RB7

Source code and HEX file

  • Still testing... E-mail if interested.