TEV-KB0

The TEV-KB0 board carries 16 keys and 4 green LEDs. The keys are arranged as a 4x4 matrix, with 4 scan lines and 4 return lines. Each scan line additionally controls one green LED. Schematic diagram of the TEV-KP0 board can be found on Tibbo website.

TEV-LBx Board Connector

The TEV-KB0 board is connected to the TEV-MB0 motherboard through a 2x12-pin connector. Each two pins of the connector are combined together for better electrical contact. Therefore, the connector effectively has 12 lines.

TEV-KB0

Pin #

Function

Keypad

1

VIN (12V)

 

2

5V

 

3

3.3V

 

4

GND

 

5

GPIO24*

Scan1, LED1

6

GPIO25*

Scan2, LED2

7

GPIO26*

Scan3, LED3

8

GPIO27*

Scan4, LED4

9

GPIO28*

Return1

10

GPIO29*

Return2

11

GPIO30*

Return3

12

GPIO31*

Return4

Required initialization code in Tibbo BASIC/C application

This section assumes that you are familiar with Tibbo BASIC/C and TIDE software. These are documented in the TIDE, TiOS, Tibbo BASIC, and Tibbo C Manual.

For correct board operation, click Project-> Settings, and select "EM1000" or "EM1000G" platform. Additionally, click Customize to open a Customize Platform dialog. In the dialog, double-click the Keypad (kp.) Object line and choose "Enabled".

The following initialization code should also be added to your project:

** Tibbo Basic **


kp.scanlinesmapping="24,25,26,27"
kp.returnlinesmapping="28,29,30,31"

io.num=PL_IO_NUM_24
io.enabled=YES

io.num=PL_IO_NUM_25
io.enabled=YES

io.num=PL_IO_NUM_26
io.enabled=YES

io.num=PL_IO_NUM_27
io.enabled=YES

kp.enabled=YES

All key-related events are served in the event handler for the on_kp() event. The key_code argument carries the code of the key. Keycodes of each key are indicated in parentheses on the drawing above. For example, key <5> has the code of 12Hex.

Each scan line of the keypad also controls one LED. To turn the LED on, set the corresponding scan line LOW. This will not affect the operation of the keypad.