Application of S3C44B0X in water meter intelligent meter reading system

Publisher:SerendipitySoulLatest update time:2012-10-29 Source: 21IC Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1 Introduction to the Intelligent Water Meter Reading System
At present, water meters are all mechanical, and most of them are installed indoors, which brings great trouble to water meter readers. When reading the meter, the meter reader must read the water meter readings from door to door with the naked eye, and then record them in a small notebook he carries with him. After returning home, a special computer input operator must input the water meter readings into the database in the computer, calculate the water consumption for this month, and then print out the water fee that each user should pay for this month. This process is not only labor-intensive, but also prone to errors. Now Deli Shanghai Electronics Co., Ltd. has developed an intelligent water meter that counts the number of turns of the pointer in the mechanical water meter and sends the water meter readings through the serial port RS422. This lays the foundation for the intelligent water meter reading system.

The block diagram of the intelligent water meter reading system is shown in Figure 1.

After the user's mechanical water meter is converted into an intelligent water meter, it is connected to the collector installed at the bottom of the building. The collector collects data from the intelligent water meter at a certain time (the specific time can be set) and saves it in the memory. If the number of users of the staircase is greater than 16 or the connection exceeds 500m, a repeater needs to be added between the intelligent water meter and the collector to increase the driving capacity. The core part of the intelligent meter reading system is the portable meter reading mobile phone. Its main task is to interpret and run the Foxpro program compiled by the host computer with its own instructions; collect data from the collector or intelligent water meter and update the content in the database; and compare it with the data of the previous month, calculate the water consumption and print the bill on the spot, and the meter reader will put the bill of each user in the user mailbox at the staircase; the data can be transferred to the computer through the USB interface on the mobile phone, and the computer will process and archive it. Thus, the automatic data collection, transmission, processing, printing and other tasks from the water meter to the computer are realized, which eliminates a lot of manual labor and greatly improves labor efficiency.

The meter reading mobile phone is the core part connecting the host computer with the collector and the intelligent water meter. It has keyboard input, which can manually query and update the data in the database; large-screen LCD dot matrix display, good human-computer dialogue interface; 16MB FLASH RAM, used to store system configuration files, programs and database files; 2 RS232 interfaces and one USB interface. One of the RS232 interfaces is connected to the infrared repeater to achieve wired or infrared communication with the smart water meter and the collector, complete the data collection work of each water meter, and can be used to set and modify the collector or smart water meter. The other RS232 interface is used as a communication port with a micro serial printer. The USB interface completes the communication with the computer, which can transmit the data in the meter reading mobile phone to the computer, and can also receive DBF and PRG files and other system configuration files downloaded by the computer.

2 Application of 32-bit S3C44B0X in Intelligent Meter Reading System

S3C44B0X CPU is a 32-bit high-speed processor based on the RISC core of ARM7TDMI launched by SAMSUNG. Its operating voltage is 3.3V, and the operating voltage of the core ARM7TDMI is only 2.5V, which greatly reduces the power consumption of the chip. S3C44B0X has: ①8 MEMORY BANKS for managing external memory, with a maximum storage capacity of 256MB. It can be expanded with EPROM SDRAM FLASH RAM USB LCD. Each Bank supports 8/18/32-bit data format and can address 32MB (except BANK0, the following 4MB is reserved for internal registers). BANK0 is dedicated to system startup, so its memory must be linearly addressed and have memory function; BANK8 and 7 are dedicated to SRAM, FP/EDO/SDRAM, etc.; ② LCD controller supports monochrome, 4, 16 grayscale LCD modules; supports 4-bit single and double line scan, 8-bit single line scan display type; supports the main display dot matrix: 640×480 320×240 160×160, etc.; ③ Two UART ports, the highest baud rate is 115200baud, support IrDA 1.0, can be used for infrared communication; ④ 5-way PWM modulation output, can be used to control the buzzer to output different sounds, prompting various types of system information; ⑤ 71 I/O ports, including 8 external interrupt sources, can be used for keyboard, LCD backlight, lighting control, etc.; ⑥ 8-way 10-bit A/D converter, can be used for system battery detection; ⑦ System real-time clock with calendar function, can be used to record meter reading time; ⑧ Built-in PLL phase-locked loop can set the system operating frequency, up to 73MHz; ⑨ 4 system working modes: normal, slow, idle and stop mode. Setting different working modes according to needs can reduce system power consumption.
The hardware connection diagram of using S3C44B0X to realize the function of smart meter reading mobile phone is shown in Figure 2.

2.1 Connection between S3C44B0X and SDRAM HY57V161610D
A self-written small operating system is running in the meter reading mobile phone. It has its own file system and can interpret and run the Foxpro program written by the host computer. Since it involves the operation of the database, the system requires a large amount of memory. This system chose HYUNDAI's SDRAM-HY57V161610D. Its data width is 16 bits, and it consists of two banks with a total storage capacity of 2MB. Since BANK6 and 7 of S3C44B0X support SDRAM, its connection with HY57V161610D is quite simple, and no software driver is required. Just set two registers. Set the data width of BANK6 to 16 bits in the BWSCON register, and set MT=0X3, Trcd=0X0, and SCAN=0X0 in the BANKCON6 register. [page]

2.2 Connection between S3C44B0X and FLASH KM29U128T
The database obtained from meter reading is stored in the meter reading mobile phone. When there are many users, the database will occupy a large storage space. Especially when analyzing a monthly water consumption report, the collector stores data every hour (or shorter), and the meter reading mobile phone must read all the data for this month. At this time, the database is quite large. Therefore, SAMSUNG's FLASH-KM29U128T was selected. The FLASH storage capacity is 16MB, which is enough for database storage. Its shortcomings are: it is not linearly addressed, and the storage speed is slow; it is more troublesome to read and write, and must be read and written in pages (512 bytes). Before each write, the BLOCK where the page is located must be erased; and it does not guarantee that each BLOCK (32PAGE is a BLOCK) is good, and the bad rate is 1%, but it guarantees that the first two BLOCKs are definitely good.

Use the first two BLOCKs to create a FAT table, use the logical BLOCK number to correspond to the physical BLOCK, and operate the logical BLOCK every time you read or write. Perform a read operation every time you write, and compare it with the written content. If you find a difference, write it again; if it is wrong again, it is considered that the BLOCK is broken, mark it and find a good BLOCK to replace it, so that all logical BLOCKs are good.

2.3 Connection between 3C44B0X and LCD TCM-A0902
3C44B0X comes with an LCD control module, but it does not support all dot matrix LCDs. In order to make full use of the chip, you can choose the LCD it supports. But if you must use other LCDs, it doesn't matter, because the operation of the LCD is as simple as the operation of other memories.
This system uses EPSON's TCM-A0902, monochrome, 320×200. Directly use BANK4 of 3C44B0X to control. Since 3C44B0X is a high-speed processor, a soft delay is added when operating the LCD.
The program for LCD to display full screen is as follows:
#define LCDCMD volatile unsigned char 0x8000000
#define LCDDATA volatile unsigned char 0x8000001
void Lcd_Displayfull void //Display full screen
int j;
U8 I k;
LCDCMD=PASET; //Page setting, page0
LCDDATA=0x0;
LCDCMD=CASET; //Column setting, column0
LCDDATA=0x0;
LCDDATA=0x0;
For i=0i<25 I++ //From page 0 to page 24
for j=0j<320j++ //From column 0 to column 319
LCDCMD=MWRITE; //Write command
LCDDATA =1cd_disp I j; //Write data
For k=0k<3k++; //Soft delay
LCDCMD
=RETURN; //Page
change
2.4 Connection between 3C44B0X and USB9603
Since the data obtained by the meter reading mobile phone is transmitted to the host computer in the form of a database, it is impossible to transmit it through the serial port when the database is large. When communicating via USB, the maximum theoretical transmission rate can reach 12MB/s, so the database can be transmitted via USB. Since 3C44B0X does not have a USB interface, an external USB interface must be expanded.
This system uses USBN9603 from NATIONAL. It is an improved version of 9602, which corrects some defects of 9602 and reduces some registers, making the programming of USB communication relatively simple. Since it involves the operation of FLASH, the communication rate of USB is not as high as expected. When downloading the database, the USB transmission rate is only 200KB/s due to the need to write to FLASH. However, when uploading, only the FLASH is read, and the USB transmission rate is significantly faster, reaching 800KB/s. Therefore, the choice of FLASH and how to program FLASH have a great impact on the USB transmission rate.

2.5 Other parts of the meter reading mobile phone
The meter reading mobile phone also includes keyboard input, serial port communication, battery detection and other parts. These parts are relatively simple. For example, the keyboard input part: if you want to use keyboard interrupt, just use external interrupts EINT4, 5, 6, and 7, because the interrupt entry addresses of these four interrupt sources are the same, and add a few ordinary I/O ports to form an interrupt keyboard. If you want to change to a scanning keyboard, it is also very simple. Just set EINT4, 5, 6, and 7 to I/O port functions, and no hardware changes are required. Serial port communication is also very simple. Just connect a MAX232 level conversion chip to the UART port of S3C44B0X to achieve standard RS232 communication functions. The battery detection part only needs to connect the voltage from the battery part to a certain A/D port. If the battery voltage used is higher than the working voltage of S3C44B0X (3.3V), it is connected to the A/D port after voltage division through resistors.

Since FLASH KM29U128T is not linearly addressed, it cannot be used for system startup. Therefore, a linearly addressed EEPROM such as 29EE010 is required for system initialization. Its main task is to initialize the system and transfer the operating system stored in FLASH to SDRAM for operation. Therefore, the capacity of EEPROM does not need to be very large. When connecting the hardware, please note that the chip select signal of EEPROM should be connected to BANK0 (NGCS0) of S3C44B0X.
The intelligent meter reading system of tap water meter is a relatively large system. This article only involves its core part, which is the hardware part. The workload of the software part is also large. It is necessary to be able to interpret and run the FOXPRO program with the instructions of S3C44B0X. S3C44B0X with ARM7TDMI as the core can be programmed and debugged and software simulated in standard C language on the debugging platform of SDT2.5, which greatly shortens the software development cycle.

References
1 SUMSUNG Co., Ltd. S3C44B0X USER MANUAL
2 SUMSUNG Co., Ltd. SPECIFICATION KM29U128T
3 EPSON Co., Ltd. SPECIFICATION TCM-A0902-10
4 NATIONAL Co., Ltd. SPECIFICATION USBN9603.2000
5 HYUNDAL Co., Ltd. SPECIFICATION HY57V161610D 1999
6. S3C44B0X datasheet http://www.dzsc.com/datasheet/S3C44B0X_589522.html.
7. RS232 datasheet http://www.dzsc.com/datasheet/RS232_585128.html.
8. USBN9603 datasheet http://www.dzsc.com/datasheet/USBN9603_675540 .html.
9. MAX232 datasheet http://www.dzsc.com/datasheet/MAX232_1074207.html.
10. 29EE010 datasheet http://www.dzsc.com/datasheet/29EE010_1134769.html
Reference address:Application of S3C44B0X in water meter intelligent meter reading system

Previous article:Design of a new network digital camera system
Next article:Design of smart home controller based on multimedia processor VG2

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号