Design of battery charging and power measurement module of PXA270

Publisher:码字奇思Latest update time:2012-09-10 Source: 单片机与嵌入式系统 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

a.JPG
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.

b.JPG
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.

c.JPG


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.

d.JPG


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:

e.JPG
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.

Reference address:Design of battery charging and power measurement module of PXA270

Previous article:Design of LCD driver circuit for smart phone based on PXA27x
Next article:Research on Smart Home System Based on PXA270-Linux

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号