Holtek HT48 HT46 Keyboard Scan Program Manual

HT48 & HT46 Keyboard Scan Program is a keyboard scan program that can scan a 4×4 keyboard array and display key values.


Holtek HT48 HT46 Keyboard Scan Program Manual - cover page
Brand
Holtek
Category
Other device
Document type
Programming Manual
Language
Chinese
Pages
4
File format
PDF
File size
137 KB
Published
25 September, 2011
Updated
30 September, 2023
Models
HT48, HT46
MD5 checksum
BFC059897C60ED0A5DCC3F36506E2837

About this manual

The document describes a 4×4 keyboard matrix with 16 keys and four LEDs that display the pressed key's binary code. It details the hardware configuration, assigning PA0‑PA3 as outputs, PA4‑PA7 as inputs, and PB0‑PB3 as the LED output ports.

The program code scans each row, detects pressed keys, reads column data, and converts the position into a 4‑bit binary value shown on the LEDs. Subroutines for key reading and delay handling are provided, along with explanations of each code section. This manual is written in Chinese.

What's inside

  • Introduction
  • Circuit Design
  • Scanning Process
  • Program Listing
  • Key Scan Subroutine
  • Delay Subroutine
  • Program Explanation

Specifications

Keyboard matrix size4×4
Number of keys16
Number of LEDs4
PA output pinsPA0~PA3
PA input pinsPA4~PA7
PB output pinsPB0~PB3

Frequently asked questions

How many keys does the keyboard have?

The keyboard matrix contains 16 keys.

What does the program display when a key is pressed?

It shows the 4‑bit binary code of the pressed key on four LEDs.

What happens if two keys are pressed at the same time?

Only the first key detected by the scan is processed and displayed.

Download PDF (137 KB)

More Holtek Manuals


View all Holtek manuals →