With the popularization of computers, electronic pens have developed rapidly as a new human-computer interaction tool. In China, Hanwang has always been in a leading position in handwriting recognition and has led the development of domestic electronic pens. Foreign countries have associated handwriting with office software and established the concept of digital ink. In June 2001, Ericsson announced the launch of the world's first digital pen - Chat2penCHA-30. This product makes full use of Bluetooth wireless technology and GPRS network to transmit handwritten text and interact with mobile phones, computers and the Internet. Although its appearance and writing method are the same as an ordinary pen, Chatpen can "read" its position with the help of an almost invisible dot pattern printed on ordinary paper. This information can be transmitted through Bluetooth and GPRS mobile phones, allowing consumers to write digitally on paper at the same time. Users will find that they are no longer limited to text-based short messages or emails. As long as they use Chatpen, they can send handwritten notes at any time through mobile phones, PCs or PDAs. Anything drawn or written can be transmitted immediately, information processing becomes more personalized, and the process of sending text messages is greatly simplified because there is no need to use letter input.
As the key technology behind electronic pens, handwriting recognition has always been the focus of research. In general, electronic pens can be divided into four categories according to different positioning methods: radio frequency positioning type, image recognition type, pressure sensing positioning type and acceleration positioning type. Radio frequency positioning type electronic pens need to place an acoustic wave generator near the writing plane or on the writing board, and use the ultrasonic waves emitted by the generator to complete the three-dimensional positioning of the pen strokes. It has high accuracy but complex structure and algorithm. Image recognition type electronic pens use image recognition algorithms to recognize the handwriting images scanned by the micro camera installed in the pen head part, and the handwriting is closest to the original. Pressure-sensitive electronic pens need a pressure-sensitive plate to feel the pressure of the pen tip and bend it into a note. Acceleration type electronic pens use kinematic algorithms to obtain the motion trajectory of the pen tip by calculating the acceleration, and the handwriting can be reproduced by combining the handwriting analysis algorithm, so the structure is simple and easy to implement. However, due to the limitation of sensor resolution, there has been no mature product of this type on the market.
This solution uses Freescale Semiconductor's MMA7260Q three-axis low-level acceleration sensor to achieve spatial positioning of pen strokes. Wireless USB devices provide plug-and-play connectivity for electronic pens. This electronic pen uses Cypress's 2.4GHz RF SoC CYRF6934 as a wireless USB network transceiver. As long as the Cypress Encore2 wireless USB bridge is connected to the PC's USB port on the PC side, the electronic pen can perform one-way data transmission to the PC.
1 Hardware Planning
In this design, MMA7260Q is used to measure the acceleration of the electronic pen in the three axes of X, Y, and Z, so that the software can calculate the position of the pen tip in real time and generate handwriting.
After the microcontroller ADuC7022 collects the signal output by the acceleration sensor, it uses the on-chip ADC to complete the conversion of the voltage signal to acceleration data and performs signal processing. Finally, it sends it to the wireless USB interface chip CYRF6934 through the SPI interface and transmits the data to the PC for post-processing.
The system is powered by a high-energy lithium battery. In order to obtain the longest possible battery life, all chips operate at 3.3V to reduce switching losses; after the microcontroller detects that the electronic pen is in a static state, the microcontroller software will put the wireless USB interface chip into sleep mode to further reduce power consumption.
2 Microcontroller Circuit
ADuC7022 is a new generation of precision analog microcontroller based on ARM7TDMI 32bit RISC core of ADI. It integrates 10-channel 12-bit ADC (1MSPS), voltage comparator, 62Kbytes FlashROM and 8Kbytes SRAM on chip, with the highest processing capacity of 40MIPS. Its analog peripherals include up to 10 channels with a sampling rate of 1MSPS and a resolution of 12bit, and a precision bandgap reference voltage source with a temperature drift better than 10ppm/℃. Other peripherals include on-chip programmable logic array (PLA), synchronous and asynchronous serial interfaces, etc. Its on-chip PLL circuit allows the use of external crystal oscillators with lower frequencies to reduce system EMI. Serial interfaces include UART, SPI and 2 I2C, JTAG port for download/debugging, 4 timers, and 14 general I/O pins. CPU clock is up to 45MHz, with on-chip crystal oscillator and on-chip PLL.
ADuC7022 operates at 2.7V to 3.6V and consumes only 40mA at the highest operating frequency of 41.78MHz. In addition, the ADuC7022 40-pin 6mm×6mm LFCSP package can significantly reduce the size of the circuit board, making it more suitable for systems with more stringent requirements on volume and power consumption than most microcontrollers.
In this design, the ADuC7022 ADC works in single-ended mode. The ADC0~ADC2 of the ADC module are connected to the MMA7260Q three-axis acceleration output pins. ADC2 is connected to the positive electrode of the battery to monitor the input battery voltage. When the battery voltage drops to close to the minimum input voltage of the LDO, the LED is lit to remind the user to replace the battery. The P0.0 and P0.1 pins of the microcontroller are connected to the SEL1 and SEL2 pins of the MMA7260Q as the control signals of the acceleration sensitivity.
The serial interface of ADuC7022 provides SPI, UART, and I2C interfaces. The I/O port of ADuC7022 is a multiplexed interface. Users can choose between GPIO, UART, UART/SPI/I2C, and programmable logic array by setting the control register of the SPM module. The hardware in this article uses an SPI module working in Master mode and connected to the wireless USB module. The schematic diagram of the microcontroller is shown in Figure 1.
3 Accelerometer
MMA7260Q is a single-chip three-axis low-level acceleration sensor launched by Freescale Semiconductor. It can accurately measure low-level descent, tilt, displacement, positioning, impact and vibration errors in the three directions of X, Y and Z. By selecting the sensitivity of MMA7260Q, it can be designed according to the gravity acceleration sensitivity of different levels (g) of 1.5g, 2g, 4g and 6g. MA7260Q is manufactured using MEMS technology. It integrates acceleration sensors and signal conditioning circuits such as low-pass filtering and temperature compensation in a volume of 6mm×6mm×1.45mm, and presets full-scale 0g bias. Its package size is very small and only requires a small board space. In addition, MMA7260Q can run at a low voltage of 2.2V~3.6V, consumes only 500?Zi A current when working, and is equipped with a 3μA sleep mode and a 1.0ms fast power response. It also provides fast startup and sleep modes. These features greatly extend the battery life of the electronic pen and reserve enough space for appearance design.
SEL1 and SEL2 are sensitivity selection input pins, and the corresponding sensitivity truth table is shown in Table 1. The output voltage VOUT of the acceleration sensor is: [page]
Where VOFFSET is the 0 acceleration offset, ΔV/ΔG is the acceleration sensitivity, 1G is the earth's gravity, and θ is the tilt angle.
Xout, Yout and Zout are the output pins of the acceleration signals in the three directions of X, Y and Z respectively. The relationship between the output voltage and acceleration is shown in equation (1). The 0g bias voltage of MMA7260Q is 1.65V. For a sensitivity of 1.5g, the output voltage of each axis is between 0.85V and 2.45V.
The acceleration sensor circuit is shown in Figure 2. An RC filter is set at the output of the MMA7260Q to filter out the interference of the internal switch filter capacitor clock and improve the measurement accuracy.
4 Wireless USB interface
CYRF6934 is a 2.4GHz RF SoC wireless USB network transceiver from Cypress Semiconductor. The wireless transceiver operates in the 2.4~2.483GHz ISM public frequency band, breaking through the various limitations common to many 27MHz, 400MHz and 900MHz systems, allowing users to promote and use their solutions worldwide without being constrained by regional frequency requirements, thus having global applicability, reasonable power specifications and higher communication bandwidth. With the help of DSSS technology, CYRF6934 can avoid signal interference from other systems such as 802.11b and Bluetooth in the 2.4GHz frequency band, as well as wireless radiation from cordless phones and microwave ovens; CYRF6934 has an operating voltage range of 1.8~3.6V and an effective range of 10 meters; it is equipped with a 62.5kbps data throughput and a SPI microcomputer interface with a transmission frequency of up to 2MHz to communicate with the microcontroller, which can achieve a 62.5kbps rate of bidirectional or unidirectional RF transmission, with an average delay of less than 10ms. When there is no data transmission, CYRF6934 can enter low power mode under the control of the microcontroller to reduce system energy consumption.
The wireless USB interface circuit is shown in Figure 3. The acceleration data collected by the microcontroller is sent to CYRF6934 through the SPI interface after preprocessing. CYRF6934 modulates the data and sends it to the wireless USB bridge on the PC through the printed antenna on the PCB. A 0.1uF capacitor is used for decoupling all VCCs of the chip and a 10uF capacitor is used as a charging and discharging capacitor.
5 Software Design
As the underlying hardware driver, the software needs to complete system initialization, data acquisition, processing and transmission. System initialization mainly includes the initialization of the microprocessor stack, queue and internal control registers, the selection of MMA7260Q acceleration sensitivity and the initialization of the CYRF6934 control registers. The assembly language completes the initialization of the microprocessor stack and queue and guides the system to execute the main() function in the C language. After the C language program completes the remaining initialization tasks, it starts the cycle of collecting data, processing data and sending data.
In addition to using the accelerometer solution of the MMA7269Q sensor, the software design can also use various components provided in the MMA7260Q reference design development tool to develop according to the needs, so as to improve the efficiency of software and hardware and minimize the factors of system instability caused by software conflicts.
At the same time, the hardware environment of KIT3109MMA7260Q is used to complete the development and testing of MMA7269Q and conduct a comprehensive evaluation to speed up product development. The software flow chart is shown in Figure 4.
After the driver design is completed, the application program needs to use some special API functions of the Windows operating system when accessing the driver. Since these function parameters are relatively large, a dynamic link library can be developed so that users can develop applications without involving the operation of the underlying driver device and can operate the hardware like ordinary API functions. The structure of the entire system is shown in Figure 5.
By using this layered structure, user programs can read and write devices through dll. The interface functions provided by dll to the application include initializing the device, closing the device, reading and writing ports, etc. In this way, after adding your own dynamic link library to the application, you can use inPortb and out-portb to operate the port.
Since the application and market prospects of electronic pens are very broad, some major related manufacturers in the world are now competing to develop and launch new products with their own characteristics. This design scheme organically combines the advantages of wireless communication with the traditional USB interface, which not only provides a higher data transmission rate, but also improves the data access method. At the same time, the MMA7260Q three-axis low-level acceleration sensor and SoC CYRF6934 wireless USB network transceiver can meet the needs of non-network terminals in the wireless field with their perfect performance and low cost, and make the transmission system more convenient and reliable.
Without changing the traditional way of pen-paper communication, this electronic pen can realize natural handwriting input on ordinary paper (or any medium) beyond keyboard, just like providing people with a golden key to open a new door to the information age. It combines the acceleration structure with the wireless network, and has many advantages such as simple structure, reliable operation, convenient data transmission and plug-and-play. The promotion and application of this electronic pen will surely become a super assistant for people to promote social informatization and a tool to promote office automation. In a certain sense, it can realize the writing of computers and mobile phones and occupy a place in the market.
References
[1] Analog Semiconductor. Precision analog microcontroller 12-bit analog I/O, ARM7TDMI MCU Rev A. 2006.
[2] Freescale Semiconductor. ±1.5g-6g Three axis low-g micromachined accelerometer. 2006, 2.
[3] Cypress Semiconductor. WirelessUSBTM LS 1-way hid networks. 2003, 8.
[4] Cypress Semiconductor. WirelessUSB LR 2.4GHz DSSS radio soc. 2005, 3.
[5] Cypress Semiconductor. WirelessUSBTM dual antenna design layout guidelines. 2005, 3.
Previous article:Design of digital network set-top box based on ARM and STi5x
Next article:Design of wireless endoscopy system based on ARM7
Recommended ReadingLatest update time:2024-11-16 18:03
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Huawei Hongmeng + Alibaba Pingtouge, Runhe Neptune Review (Part 1)
- NMOS controls the negative output
- Introduction to TWS Bluetooth headsets and TI low-power solutions
- A must-know for RF engineers: How to design directional coupler circuits
- DSP Q format operation
- MSP430 Development Considerations and Requirements
- Why Ultra Wideband?
- Microchip Live at 10:30 AM today | Securely configure the MPU in your factory
- Bendable PCB chain plate
- Mbed Studio