Windows CE battery-powered sampling algorithm design
Introduction
With the development of telephone and electronic information technology, mobile, PDA phones are widely used, and the mobile terminal equipment, which increases the CPU performance, wireless applications become more advanced graphics features. These features increase on mobile devices has led to increased energy consumption, battery performance has become an important criterion of quality, but battery performance depends not only on the characteristics of its equipment, excellent bad drivers Autonomy is also a direct impact on his ability and stability. Dell Latitude E6500 battery Dell Inspiron 1318 battery
A platform of development established
Windows CE is a Microsoft operating system for embedded devices to build, but a wide range of embedded devices, which requires the operating system, must be customizable, so Microsoft will be designed to be modular Windows CE system operation. Windows CE is a compact, efficient, scalable 32-bit embedded operating system. The system has a multi-threaded, multi-tasking features completely preemptive, is designed for a variety of resources have limited hardware system for strict mouth.
S3C2443 is used in small handheld devices and high-cost, low power, high performance embedded applications system and provides 16/32-bit RISC microcontroller. use S3C2440 ARM920T core, using W 13μm technology standard, low power consumption, ideal for power applications needed to control costs and opportunity; S3C2443 provided with 10 channels, 10-bit ADC and touch screen interface. Dell Inspiron 1320 battery Dell Inspiron 1320n battery
2 batteries and equipment to design the software architecture
2.1 Hardware Architecture
The quality of the design of the hardware architecture of the battery, a direct impact on battery life and a range of other aspects of performance. Based on the real needs of the project, the equipment should meet the following characteristics: CPU test battery is inserted, AC test CPU is inserted, the CPU to complete the battery and switch between AC, through the CPU CPLD to control the power indicator of the state.
① CPU GPIO judging the state of the battery terminal to detect the existence of the battery. If you detect the battery inserted or withdrawn by CPLD to control the LEDs to indicate the battery has power.
② AC side CPU judging the state of GPIO to detect the presence of AC. If the CA detects inserted into the CPLD to accomplish the switching between battery and AC, AC power and control of the LED to indicate whether it is AC powered.
③ When the battery is full after CPU test changes to the battery terminal voltage to determine whether the full, and the State through the CPLD controls LED to indicate the battery is already saturated.
④ CPU detected AC disconnect, the CPLD to accomplish by switching between battery and battery power, and control the status LEDs to indicate the battery is power. Dell Inspiron 1410 battery Dell inspiron 1425 battery
2.2 Design of Battery-Driven Software Architecture
Windows CE device drivers included in the sample is divided into two types: the pilot of a single piece (monolithic device driver) and the driver layers (device driver Iayered). Battery-based development using the hierarchical model of Figure 2. Layered driver consists of two distinct layers: the upper part is a model device driver (MDD), lower the platform-dependent driver (PDD). Microsoft provides all source code modules associated with MDD, OEMs and is not recommended to change. OEM requires only low-level (DP) driver, then their DP and MDD module module links in a public library. MDD DP IOCTLS by the specific function call to implement the specific hardware functions. Power On Self Test system is successful, the upper entrance of the function is called battery, battery initialization:
① system initialization, search the registry and load the information related to the battery.
② called TED layer initialization function BatteryPDDInitialize, initialize the CPU of the GPIO, the appropriate records and battery status of global variables.
③ create and determine whether to create a successful event interrupt.
④ If the interruption of the event is a success, creating a battery wire, read the value of ADC register. The main topic of the thread function, set the priority of the battery lead and then in a loop waiting for interrupt events. Dell inspiron 1427 battery Dell Inspiron 1440 battery
⑤ read ADC value and make correction algorithm.
⑥ DP layer of cells called the state function BatteryPDDGetSta-tus, holding the battery and AC and other materials, GPIO to determine the current state of the material. If the battery is there, then call the thread to read the ADC values of batteries to determine the current state of the battery.
2.3 battery voltage sample algorithm and the algorithm of error correction
CPU detecting the voltage of the battery side of the current power of the battery. The battery voltage and charge a certain correspondence between these correspondences can be judged by the battery charge current. Found by actual measurement, the relation corresponding to Figure 3. Visible, the cell voltage of the battery and the power is not the correspondence between the linear.
To determine more precisely the current battery, as shown in Figure 3, the battery voltage and power diagram for a sub-amendment process can be divided into ①, ②, ③ three intervals.
3 Windows CE-based implementation Battery
3.1 Registry Settings
When the start time of the system, a device. exe will be fixed according to the registry to find the battery-based dynamic link library files, such as the following example will load the dynamic link library file battdrvr. dll. registry settings will identify the battery resulting compiled file name dynamic link library start time, the loading sequence, the prefix name in the register, iCLASS power management. These options are necessary, information can be added to the platform. reg file to reach the battery charge and management. Dell Vostro 1700 battery Dell Vostro 2510 battery
3.2 Based on S3C2443 CPU power algorithm for sampling
S3C2443 can provide a detection of 10 analog channels of voltage, respectively, XP, XM, YP, YM, 5:00 A []. XP, XM, YP, YM four channels is generally to use the touch screen details of sampling in the stack, depending on the choice of hardware design A [5:00] one of six channels for sampling battery voltage. S3C2443 offers four types of mode A / D conversion: the conversion mode normal XY mode conversion in turn, X / Y auto-conversion mode, wait for interrupt mode. The design of the battery, just select the conversion mode can be normal, and three kinds of A / D conversion mode is available to use the touch screen.
3.3 battery voltage sampling algorithm and the algorithm of error correction
According to battery voltage, the load between the ideas of error correction algorithm to design the following algorithm: first define a structure that contains the ADC value and its corresponding percentage of the value of the variable, this benefit is for the convenience of the samples to the value of the ADC, according to three sections of the slope function offline, converted to the corresponding percentage of capacity remaining. Dell Vostro 1500 battery Dell Vostro 1520 battery
Then, define the baseline ADC values fold line and the corresponding percentage value. These can be based on the test battery discharge and actual experience is specific requirements for the project must be modified.
Finally, the battery voltage, the load between the error correction algorithms designed to implement the algorithm.
Windows CE 3.4 DP layer to achieve an instance of the function of battery status
What follows is mainly for Windows CE functional layer LFP battery status has been achieved, but the specific details of implementation of the project requirements should be reviewed and improved. Dell Vostro 1310 battery Dell Vostro 1320 battery
4 Summary and outlook
I design the hardware and software architecture cells are independent of platform specific development can be easily ported to different platforms. The combination of Windows CE and features Samsung S3C2443 processor, this paper presents the architecture of an implementation of the battery-pilot. Innovation is proposing the use of sub-sampling technique to change the battery voltage and power nonlinearity is proposed and analyzed a software platform for independent battery and hardware architecture. The design was based on Windows CE platform operating system can be realized in the actual development of the project and the widespread adoption, and obtained good results. Dell Vostro 1015 battery Dell Vostro 1200 battery