System-level RF transceiver chip nRF24E1 and its application in wireless keyboard

The nRF24E1 transceiver is a system-level RF chip from Nordic VLSI. Using advanced 0.18μm CMOS process, 6×6mm 36-pin QFN package, based on nRF2401 RF chip structure, RF, 8051MCU, 9 input 10-bit ADC, 125 channels, UART, SPI, PWM, RTC, WDT Integrated into a single chip, internal voltage regulator (operating voltage 1.9 ~ 3.6V, recommended working voltage is 3.3V) and VDD voltage monitoring, channel switching time less than 200μs, data rate 1Mbps, maximum RF output decibels 0dB, no need External SAW (Sound Table) filter. The nRF24E1 is the world's first and worldwide low-cost RF system-on-a-chip with a 2.4GHz transmit and receive frequency band. Suitable for wireless keyboards and mice, wireless handheld terminals, wireless frequency identification, digital video, remote control and automotive electronics and other short-range wireless high-speed applications.
1 Introduction to nRF24E1
1.1 microprocessor
The instruction system of the nRF24E1 microprocessor is compatible with the instruction system of the industry standard 8051, but the instruction execution time of the two is slightly different. Generally, the execution time of each instruction of nRF24E1 is 4-20 clock cycles, while the execution time of each instruction of industry standard 8051 is 12~48 clock cycles. The nRF24E1 adds five interrupt sources for the ADC, SPI, RF Receiver 1, RF Receiver 2, and Wake-up Timer than the industry standard 8051; three timers identical to the 8052. The nRF24E1 contains one UART identical to the 8051. In the traditional asynchronous communication mode, Timer 1 and Timer 2 can be used as the UART (serial port) baud rate generator. In order to facilitate data transfer with the external RAM area, the nRF24E1 CPU also integrates two data pointers, and the clock of the microcontroller is directly derived from the crystal oscillator. The nRF24E1 function module diagram is shown in Figure 1.

This article refers to the address: http://


The microprocessor has 256B of data RAM and 512B of ROM. After a power-on reset or software reset, the processor automatically executes the code in the boot area of ​​the ROM. The user program is usually loaded from the E 2 PROM into a 4KB RAM under the boot of the boot area (this RAM can also be used to store data). If the mask ROM (ie, the included ROM) is not used in the application, the program code must be loaded from the external non-volatile memory. More common is the expansion of the E 2 PROM via the SPI interface, the model is recommended to be 25320.
Compared to the standard 8051, the nRF24E1's microcontroller adds some new features, so some special function registers have been added to control these new functions. New special function registers are RADIO (P2), ADCCON, ADCDATAH, ADCDATAL, ADCSTATIC, PWMCON, PWMDUTY, and so on. In the nRF24E1 microcontroller, the registers of the P0 and P1 ports are also different from those of the standard 8051. The other special function registers are the same as those of the standard 8051.
1.2 PWM and SPI Interface The nRF24E1 has a programmable PWM output. When used, the function of DIO9 (P0.7) can be changed by program, and the PWM can be programmed to operate in 6-bit, 7-bit or 8-bit.
The SPI's three ports are reused with GPIO (DIN0, DIO0, DIO1) and RF transceivers. The SPI hardware does not generate any chip select signals. Usually, the GPIO bit (P0 port) is used as the chip select port of the external SPI device.
1.3 RTC wake-up timer, WTD and RC oscillator The nRF24E1 has a low-power RC oscillator. When V DD ≥1.8V, it can work continuously, regardless of the application. The RTC wake-up timer and WTD (watchdog) are two 16-bit programmable timers whose operating clocks are LP_OSC of the RC oscillator. The wake-up timer and watchdog timing is approximately 300μs to 80ms, with a default of 10ms.
1.4 A/D Converter The nRF24E1 has a 9-channel 10-bit ADC with a linear conversion time of 48 CPU instruction cycles per 10 bits. The 9 inputs of the A/D converter can be selected by software. Channels 0 to 7 can convert the voltage values ​​on the corresponding pins AIN0 to AIN7 into digital values, and channel 8 is used to monitor the operating voltage of the nRF24E1. The A/D converter works in 10-bit mode by default and can be operated in 6-bit, 8-bit or 12-bit mode by software.
1.5 Wireless Transceiver
The nRF24E1 transceiver communicates with other modules via an internal parallel port or internal SPI port, and functions the same as the single RF transceiver nRF2401. The data preparation signal output by the DuoCeiver receiver can be made into a microprocessor interrupt signal or transmitted to the CPU through the GPIO port. The nRF2401 operates in the global open 2.4G to 2.5GHz band. The transceiver consists of a complete frequency synthesizer, a power amplifier, a regulator and two receivers. Output power, channel and other RF parameters can be controlled by programming the Special Function Register RADIO (0xA0). In transmit mode, the RF current consumption is only 10.5 mA, and in the receive mode is 18 mA (the program can be controlled by the transceiver on/off to save energy).
2 Basic knowledge of wireless keyboard<br> The wireless keyboard communicates wirelessly between the keyboard and the PC. The wireless module is generally implemented by radio frequency technology or Bluetooth technology. Due to the complexity of Bluetooth technology protocols, high cost and long development cycle, many wireless keyboards today use radio frequency technology to achieve wireless connectivity. In the field of radio frequency, Norwegian Nordic VLSI's RF chip performance is outstanding, its products are mainly nRF401 series, nRF903 series, nRF2401 series and nRF24E1 series. This article describes the design method of wireless keyboard using nRF24E1.
Most wireless keyboards are powered by batteries, so many energy-saving technologies are needed. For the purpose of energy saving, many wireless keyboards do not use the three LED indicators "Num Lock", "Caps Lock", and "Scroll Lock" on the wired keyboard. In addition, the wireless keyboard should use the RF module reasonably and efficiently, and the RF packet from the keyboard to the PC may contain up to eight keystrokes. The keyboard scan matrix scans about 500 times per second, and generally no more than one keystroke is detected per scan cycle. Because people can't feel the detection delay of 150ms, when the keyboard detects 1 keystroke and sends RF data packets to the PC, it can idle for more than 150ms until the next button is pressed, which can be minimized. Working time of the RF module [2].
For keyboards that only need to send data, the nRF24E2 can meet the needs of a general keyboard. If you want the keyboard to not only send information but also receive PC feedback, you need to use nRF24E1 as the wireless module in the keyboard. Two-way transceiver is more conducive to password creation, packet retransmission and the keyboard is in a power-saving state when the system is shut down.
3 nRF24E1 application in wireless keyboard
3.1 Keyboard scanning matrix
The interface between the nRF24E1 and the wireless keyboard is shown in Figure 2. The buttons of the ordinary PC keyboard are 104, and the matrix of the keyboard shown in Fig. 2 is 8 rows and 20 columns, and up to 160 button switches can be defined. Some of these buttons may not be defined during the design process. Each button is arranged at the intersection of rows and columns. When the button is pressed, the rows and columns that are connected to the button are shorted. For keyboard matrix scanning, the nRF24E1 clocks the column scan to the shift register. The column scan signal is composed of one "0" and 19 "1"s, and "0" is shifted backward by bit in the shift register, and the state of the keyboard line is scanned once for each movement. If a button in this column is pressed, the row value corresponding to the button is "0" and the others are "1".

During the keyboard scan, the buttons may be shaken, so you should consider the debounce problem when writing the software. Common debounce method: Once the system detects that a button has been pressed, it will delay the detection of the button after a delay of 30 to 50ms. If the state of the button detected at this time is still pressed, the button is treated as being pressed once.
3.2 System Software nRF24E1 has 4KB of on-chip RAM, which is enough for keyboard software. After the system is powered on, the program in the E 2 PROM is automatically downloaded to the 4KB RAM, and the MCU can directly read and write the code in the RAM.
Keyboard software features:
(1) Provide column scan information required for the shift register.
(2) Read the line scan value.
(3) The detection button is pressed and debounced.
(4) Send the scanned information of the pressed button to the PC.
(5) Energy-saving state cycle.
Wireless keyboards should use energy-saving technology to extend battery life. The nRF24E1 on-chip nRF2401's ShockBurstTM technology is designed for user energy savings, so designers can save energy when writing software. However, designers should consider how to further reduce the current when the system is idle.
When the crystal of the nRF2401 is 16MHz, the on-chip 8051 core operating current is 3mA. Since the keyboard works periodically, the keyboard has a long idle time relative to working hours. Therefore, when the keyboard is not working, it is necessary to set the on-chip 8051 to the idle state, and the operating current of the on-chip 8051 idle state is only 2 μA, which is used to reduce the battery consumption. The tasks of the system in the idle state and the working state are described as follows.
Idle state:
(1) Complete all keyboard scans (approximately 0.5ms).
(2) If a button is pressed, it enters the working state.
(3) The 8051 is set to the idle state, and the wake-up time of the RTC is set to 20 ms.
(4) Idle state loop.
Working status:
(1) Scan the keyboard 500 times per second.
(2) Send all the button information to the PC.
(3) If no button is pressed within 10 seconds, it enters the idle state.
(4) Working state cycle.
In general, considering the problem of battery energy saving according to the above method, the life of the battery can be increased by about 40 times. Therefore, in the design of system software, it is important to consider the energy saving of the battery.
4 Conclusions <br> Practice has proved that nRF24E1 is very suitable for communication between wireless keyboard and PC, its advantages:
(1) The nRF24E1 is embedded with the 8051, which makes it easier to reduce the volume.
(2) The ShockBurstTM technology is used to make programming more convenient.
(3) It is easier to implement secure keyboard information transmission.
(4) The 2.4 GHz transceiver band is the global open band.
(5) Battery regulation is more convenient and power consumption is low.
(6) The nRF24E1 has GPIO that makes it easier to extend other functions such as LED indications.

Metal Letter

Metal Letters,Personalized Metal Letters,Custom Metal Lettering,Customized Metal Typography

Wuxi Motian Signage Co., Ltd , https://www.makesignage.com