Password keyboards are widely used in many fields such as finance, telecommunications, membership cards, etc. Nowadays, there are three main types of password keyboards in the market: PS2, serial port and USB. But as PC peripherals use less serial and PS2 interfaces, these two interfaces are gradually disappearing from personal computers, especially laptops. Nowadays, many USB PIN keyboards on the market are often implemented on the basis of the original design plus PS2 to USB chip (HID class) or UART to USB chip (CDC class), which results in incompatible hardware versions. Hardware version. The solution is based on a set of hardware structures, and the conversion between HID class and CDC class products is conveniently realized through software upgrade.

1 NUC120 Overview

The NUC120 series is a 32-bit microcontroller with embedded ARMCortex-M0 core from Nuvoton. The series can run up to 50MHz external clock with built-in 32 KB/64 KB/128 KB Flash memory and 4 KB/8 KB/ 16 KB of built-in SRAM; built-in timer, watchdog timer, RTC, PDMA, UART, SPI/SSP, I2C, I2S, PWM timer, GPIO, USB 2.0 FS device, 12-bit ADC, analog comparator , low voltage detection and undervoltage detection.

2 USB protocol introduction

USB Universal Serial Bus is not a new bus standard, but an interface technology applied in the PC field. The USB interface supports the plug-and-play and hot-swap functions of the device. The USB protocol divides devices into several categories, each of which is divided into several sub-categories to meet the application needs of different occasions. Each major category is identified by a type number, such as 01 for the audio device, 03 for the human interface device, and 08 for the mass storage device. There are four types of USB data transmission: control transmission, interrupt transmission, bulk transmission, and synchronous transmission. In the USB standard subclass, this article focuses on two subsets of the HID class and the CDC class.

2.1 HID class

The HID (Human Interface Device) class is a relatively large class that controls some aspects of computer operations, such as USB mouse, USB keyboard, USB joystick, USB touchpad, USB trackball, and telephone dialing. Equipment, VCR remote control and other equipment. In addition, one of the benefits of using HID devices is that the operating system comes with HID-like drivers, and users do not need to develop troublesome drivers, just use API calls to complete the communication. So many simple USB devices like to enumerate into HID devices, so you can use them without installing drivers.

2.2 CDC class

The CDC (Commuuica TIon Devce Class) class is a USB subclass defined by the USB organization specifically for use with various communication devices (telecom communication devices and medium speed network communication devices). Depending on the communication device for the CDC class, the CDC class is further divided into the following different models: the USB Traditional Pure Telephone Service (POTS) model, the USB ISDN model, and the USB network model. Among them, USB traditional pure telephone service model can be divided into Direct Line Control Model, Abstract Control Model and USB Telephone Model. Usually a CDC class includes two interface subclasses - the CommunicaTIon Interface Class and the Data Interface Class. This subclass can implement a protocol for virtual serial communication.

3 hardware design

3.1 Keyboard design

The matrix keyboard is also called the determinant keyboard. In this scheme, four I/O lines are used as the row lines, and three I/O lines are used as the column lines to form the determinant keyboard. The keyboard design scheme is shown in FIG. 1 . At each intersection of the row and column lines, set a button. Thus the number of buttons in the keyboard is 3 & TImes; 4. This determinant keyboard structure can effectively improve the I/O interface in the single chip system.

Utilization rate. Each I/O interface of the NUC120 series can be used as an external interrupt input pin. On the basis of this hardware, an interrupted or query-based programming idea can be used. This solution uses a separate timer to periodically scan the keys.

3.2 USB communication interface design

The NUC120 series comes with a USB interface that directly uses the built-in USB Serial Interface Engine (SIE) and is compatible with USB 2.0 full speed specifications.

Its main features are as follows:

â—† Provide 1 interrupt vector and 4 interrupt events (WAKEUP, FLDET, USB and BUS);

â—† Support Control / Bulk / Interrupt / Isochronous transmission type;

â—† Support pause function after no bus activity exceeds 3 ms;

Provide 6 endpoints and a maximum of 512 bytes of cache for configurable Control/Bulk/Interrupt/Isochronous transport types;

â—† Provide remote wake-up function.

USB communication interface circuit is shown in Figure 2. Current limiting is performed on the D+ and D- lines with a 100Ω resistor.

The nickel–cadmium battery (NiCd battery or NiCad battery) is a type of rechargeable battery using nickel oxide hydroxide and metallic cadmium as electrodes. The abbreviation NiCd is derived from the chemical symbols of nickel (Ni) and cadmium (Cd).

Pocket Type Nickel Cadmium Battery capacity range is from 10ah to 1200ah, have three series: low discharge rate, medium discharge rate and high discharge rate. 

Pocket Type Nickel Cadmium Battery

Nickel Cadmium Batterie,Nicd Battery Pocket Plate,Railway Nicd Battery,10~1200Ah Nicd Battery

Henan Xintaihang Power Source Co.,Ltd ,