With the development and popularization of technology, handheld devices are appearing in more and more occasions. Handheld devices have attracted various electronic devices to transform and develop in the direction of handheld with advantages such as small size, light weight and good portability, which inevitably raises the problem of battery charging and power metering. Mobile phones, digital cameras, MP3, notebooks, PDAs and other handheld devices must have a battery charging circuit and a metering circuit that can feedback the current battery power on the handheld device display interface. This article uses two high-performance chips, LM3658 and DS2786, and takes the PXA270 processor as an example to introduce a circuit module that can be applied to various handheld device occasions.
1 Hardware Design
1.1 Introduction to PXA270 Processor
PXA270 embedded processor is a new generation of high-performance processor based on XS-cale architecture launched by Intel, mainly used in high-end wireless handheld and mobile devices. The main frequency of PXA270 can be set between 312 and 624 MHz. It integrates WMMX technology internally, has high-performance and low-power multimedia acceleration capabilities, and can well support audio and video decoding. At the same time, it integrates Intel's advanced SpeedStep technology, which can dynamically adjust the performance of the CPU and achieve efficient power consumption control. In addition, PXA270 provides various commonly used interfaces such as UART, I2C, I2S, USB, etc., so that PXA270 can be used in various occasions.
1.2 Battery Charging and Power Metering Circuit
Due to the excellent mobile performance of PXA270, battery power supply has become a necessary circuit for PXA270 system. The charging chip in this system uses LM3658 launched by National Semiconductor Corporation. It can be charged by USB or AC adapter, and has power management function. The chip can safely charge single lithium batteries and lithium polymer batteries, with a termination error of no more than 1.5%, which helps to extend battery life. Therefore, it is suitable for handheld devices in various occasions, including PDAs, MP3s, digital cameras and mobile phones. Figure 1 shows the pinout and typical circuit of LM3658.
As shown in Figure 1, EN_b is the enable terminal for charging. A low level indicates that charging is allowed, and a high level indicates that charging is prohibited. The CHG_IN and USBpwr pins represent the AC adapter input and USB input, respectively. The input voltage is between 4.5 and 6 V. When the LM3658 chip uses USB or an AC adapter to charge a lithium battery or a lithium polymer battery, if both power sources are turned on, the charger chip will automatically select the preset AC mode. If charging with an AC adapter power supply, a resistor can be connected between the Iset pin and the address. The value of the resistor determines the current during charging. If charging the battery with USB, the USB_sel pin can be used to determine the charging current. When the pin is low, the charging current is 100 mA, and when the pin is high, the charging current is 500 mA. The LM3658 connects the positive electrode of the battery through the BATT pin to provide charging current for the battery. At the same time, the negative electrode of the battery is connected through the Ts pin to obtain the battery temperature information.
Different combinations of high and low levels of Statl and Stat2 can reflect the current 4 charging states of the battery, as listed in Table 1. The status of Stat1 and Star2 can be output to the GPIO of PXA270, and the current status can be read out through the software program and displayed on the user interface.
The power meter chip used in this system is the DS2786, an open circuit voltage (OCV)-based power meter chip launched by Dallas Semiconductor in the United States. This chip can estimate the available power of rechargeable lithium-ion and lithium-ion polymer batteries based on the open circuit voltage of the battery during idle time. Through the lookup table stored in the IC, the open circuit voltage can be used to determine the relative power of the battery, and accurate power information can be obtained immediately after the battery pack is inserted. When the battery is discharged at a high rate, OCV measurement cannot be used, so the DS2786 uses coulomb measurement as a second method to estimate the relative power. [page]
The DS2786 gives the remaining power in percentage form, as well as battery voltage, current, and temperature information. The battery characteristics and application parameters required for power calculation are stored in the on-chip EE-PROM. In order to support power monitoring in some cost-sensitive situations, the DS2786 also provides current, voltage, and temperature measurement data.
The DS2786 can be used in handheld devices or installed in battery packs. Its typical application is shown in Figure 2. VDD is the working power input pin of the chip DS2786, and VIN is the voltage input pin of the measured battery.
The VPROG pin can be used to modify the lookup table stored in the EEPROM inside the chip. SCL and SDA are serial clock input and serial data input/output, respectively, and can pass the power measurement data to the I2C interface on the PXA270 for reading operations. At the two auxiliary input terminals AN0 and AN1, the impedance measurement of the battery pack identification (PACK ID) resistor and thermistor can be provided by the proportional measurement method.
This system uses PXA270+LM3658+DS2786 to form a complete embedded system battery charging and power measurement module. LM3658 is responsible for the battery charging function and feedback of the current battery charging status, DS2786 is responsible for providing the current remaining battery power information, and PXA270 provides system control and data reception functions.
The system block diagram of the module is shown in Figure 3. Since the USB power supply is not used, the CHG-IN pin of the LM3658 chip is directly input with 5 V. The BATT terminal is connected to the positive electrode of the battery for charging. The N-channel MOSFET tube is connected to the positive electrode of the battery at the same time, which can realize the safety protection of the battery to prevent overcharging, excessive current, high temperature, etc. The battery charging status is output to the GPIO of PXA270 through the Statl and Stat2 pins for reading operations. The VDD pin of DS2786 is directly powered by a 5 V external voltage. The VIN pin can be input with either battery voltage or external 5 V voltage. When the battery voltage is input to VIN, the DS2786 can calculate the remaining battery power according to the OCV lookup table. When the battery is discharged at a high rate, the coulomb meter is measured through the current sensing resistor R. Finally, the power information is output to the I2C interface of PXA270 through SDA and SCL.
2 Software Design
The embedded operating system running on PXA270 in this system uses Microsoft's Windows CE. Windows CE is a real-time operating system that supports running on a variety of CPU hardware platforms and provides powerful development tools. In order for DS2786 to work properly in the system, a driver based on Windows CE 5.0 must be written for it.
[page]
The driver design of this module adopts the form of stream interface. The stream interface driver of Windows CE exists in the form of DLL (dynamic link library), which is uniformly loaded, managed and unloaded by the device manager (usually de-vice.exe or gwes.exe). Compared with native device drivers with separate purposes, all stream interface drivers use the same interface and call the same set of functions. Each stream interface driver must implement a set of standard functions to complete standard file I/O functions and power management functions, which are provided to the kernel of the Windows CE operating system. These functions are usually called the DLL interface of the stream interface driver. At the same time, this driver design adopts the form of layered driver. The layered driver divides the driver code into two layers: the upper layer is called the model device driver (MDD), and the lower layer is called the platform-dependent driver (PDD). The MDD code of the Windows CE operating system's built-in driver does not need to be changed, and only the code of the PDD layer needs to be modified. The main functions involved in this system are as follows:
The driver calls the PDD layer initialization function BatteryPDDlnitialize to initialize the CPU's GPIO, related registers, and battery status global variables. At the same time, a SYSTEM_POWER_STATUS_EX2 structure variable sps is defined. The current battery status information is obtained from the DS2786 chip through the BatteryPDDGetStatus function to update the battery information in the sps structure. The user interface can also update the current display status according to the content in the sps structure. In this way, the real-time update and display of power metering is completed.
Conclusion
This paper studies and designs a hardware circuit for battery charging and power metering, and gives the driver design under the Windows CE operating system, realizing a complete hardware and software module. The module is simple in design and has excellent performance. It can meet the needs of handheld consumer electronics in most cases and has a good application prospect.
Previous article:Design of LCD driver circuit for smart phone based on PXA27x
Next article:Research on Smart Home System Based on PXA270-Linux
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
- STM32 Network SMI Interface
- CC3200-LAUNCHXL Development Board
- Common indicators and important characteristics of operational amplifiers
- Qinheng CH579M-R1 development board free evaluation activity is coming soon, tell us what you think of this board~
- MPS Bonus Sharing | Which problem gives you the most headaches in inductor applications?
- Let's take a look at the 3D SmithChart made by experts
- RVB2601 development environment setup and the first program
- 15 "Wanli" Raspberry Pi car - photoelectric encoder learning (forward and reverse judgment)
- A TOF "image" sensor that is worth playing with, VL53L5CX
- ARM immediate number explanation--the difference between LDR and MOV