Design of an electronic scale system based on a single-chip solution

Publisher:beup001Latest update time:2010-07-08 Source: 深圳市芯海科技有限公司Keywords:Measurement Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

There are two main implementation circuits for analog-to-digital conversion circuits in electronic scales: an integration circuit composed of discrete components and a single analog-to-digital conversion (ADC) chip. The system composed of an integration circuit has complex peripheral circuits, high requirements for individual components, and has the disadvantages of high power consumption, low reliability, and poor temperature performance; while the system composed of a single ADC chip has the characteristics of high precision, low power consumption, high stability, and a simple peripheral circuit that is easy to produce and maintain. Therefore, most electronic scale manufacturers now prefer to use a single ADC solution.

With the development of technology, production and application require simpler, more accurate, lower cost and lower power consumption solutions, and electronic scale circuits are constantly moving towards higher integration. CSU1221 is a CMOS single-chip MCU with integrated high-precision ADC independently developed by Xinhai Technology Company. It is the first SoC chip in China used in commercial electronic scales.

CSU1221 chip technical features

CSU1221 is an 8-bit CMOS single-chip MCU with built-in 4K×16-bit one-time programmable (OTP) ROM, 256B data memory (RAM), 17 bidirectional I/O ports, Σ-Δ ADC with 2-channel 24-bit fully differential input or 4-channel 24-bit single-ended input, operating voltage of 2.4V~3.6V, and operating current of less than 3mA.

As shown in Figure 1, CSU1221 has an internal integrated voltage regulator that can be configured to output four different voltage values ​​to power the sensor. The output of the voltage regulator can be turned on or off by operating the internal register. This voltage also serves as the reference voltage for the ADC inside CSU1221. CSU1221 has a built-in 1MHz clock oscillator and an 8-bit timer. The CPU cycle can reach up to 500KHz at the fastest. It also has a built-in buzzer driver. CSU1221 has four interrupt sources: 1 ADC interrupt, 2 external interrupts, and 1 timing interrupt.

CSU1221 chip functional structure diagram
Figure 1: CSU1221 chip functional structure diagram.

The output rate of the built-in ADC of CSU1221 can be configured to 3.8~488Hz, and the low-noise programmable gain amplifier (PGA) at the front end of the ADC can be configured to four different gain ratios: 1, 64, 128, and 256, to meet various signal conditions. When the PGA is 128, the effective accuracy of the ADC reaches 17.5 bits.

CSU1221 has built-in ADC and MCU, so the communication between MCU and ADC is completed inside the chip, avoiding the influence of the external environment on ADC. The reliability is higher than that of the application system based on a single ADC chip, and the high integration brings obvious cost-effective advantages; CSU1221 has an internal integrated voltage regulator, which is convenient for sensor power supply. The power consumption of electronic price scales designed with CSU1221 is lower than that of the current mainstream single ADC solution, which improves the battery life. [page]

Electronic scale system design

Figure 2 is a block diagram of the electronic price-calculating scale based on CSU1221. It can be seen from the figure that this system mainly includes power supply circuit, main control chip, analog signal input, storage circuit, voltage measurement circuit, and key scanning. The design of these circuits will be analyzed below.

Schematic diagram of CSU1221 applied to electronic price-computing scale

Figure 2: Schematic diagram of the CSU1221 used in electronic price computing scales.

In the power supply system of CSU1221, the digital circuit and the analog circuit are powered separately. In order to simplify the power supply circuit, the two power supplies are still provided by a voltage regulator circuit. The two power supplies are separated by a filter inductor to reduce the impact of the clutter interference generated by the digital circuit in the digital power supply on the analog circuit.

The analog differential signal output by the analog signal input sensor is filtered out by two LC filters to remove the high-frequency interference signal in the input analog signal, and then input to the AIN0 and AIN1 pins of CSU1221 respectively. The voltage at the sensor excitation end is provided by the internal LDO output of CSU1221, with a load capacity of up to 15mA. There are four output voltages to choose from. The LDO switch and output voltage value (2.2V, 2.5V, 2.8V, 3V) can be controlled by controlling the internal register of CSU1221, which is convenient for sensor power supply control.

Since CSU1221 does not have an internal E2PROM, an external E2PROM with a serial interface must be used, such as 24C02 with an I2C bus structure. If PT3[3] and PT3[4] are used as I2C communication interfaces, the PT3 pin has an optional pull-up resistor, so the communication line does not need an external pull-up resistor.

CSU1221 applied to electronic price-calculating scale circuit schematic diagram
Figure 3: Circuit diagram of CSU1221 applied to electronic price computing scale.

Voltage measurement In various battery-powered devices, it is desirable to monitor the battery voltage so that the battery can be charged or replaced in time. CSU1221 has five analog input terminals, which are connected to the ADC through a multiplexer. The battery voltage value can be measured by using the spare analog input terminals in a time-sharing manner. The specific connection method is: use a resistor network to divide the battery voltage, and connect AIN3 and AIN4 as voltage input terminals to the two ends of the sampling resistor. By measuring the voltage across the resistor, the battery voltage value is calculated based on the ratio of the sampling resistor value to the resistor network. There are two times to measure the voltage: one is to measure the voltage just after the power is turned on; the other is to measure the voltage after the power is turned on, and the weight is stabilized for a period of time. Each measurement must switch the ADC channel, PGA = 1, and the AD rate uses the 125Hz gear. In this way, when measuring the voltage, the AD value is relatively stable and takes a short time. After the test is completed, the previous ADC settings must be restored, and 3 AD values ​​must be discarded after restoration. [page]

Button array diagram
Figure 4: Button array diagram.

Assume that the key scan array is 4×6, PT1[5], PT1[6], PT1[7], PT2[0], PT2[1], PT2[2] are retrace lines, PT2[3], PT26], PT3[5], PT3[6] are drive lines. The key array is arranged as shown in Figure 4. In this example, in order to save components, no isolation components are connected in series in the drive line. If the keys are pressed simultaneously,

If two buttons are connected to the same scan line (input port), two output terminals will be short-circuited through two related drive lines. The following method can be used to avoid this: during initialization, all pull-up resistors are turned on, and all I/O ports connected to the buttons are set as input ports. When a button scan is required, only the I/O port that needs to be driven is set as an output port and outputs a low level. After the scan is returned, the I/O port is immediately restored to an input port. This is repeated, that is, only one line is an output port at the same time, and no fault will occur.

Design points and precautions

CSU1221 has an internal integrated 1MHz clock. The CPU clock cycle can be selected as: 62.5K, 125K, 250K, 500KHZ. Select 500KHz to shorten the running time of each large cycle.

The ADC integrated in CSU1221 has a rate selection range of 3.8 to 488Hz. 125Hz is used when measuring voltage; 15HZ is used when measuring sensors. The cycle of each AD value is about 67ms, ensuring that the program's large cycle has ended before the AD value is updated (it can be adjusted appropriately according to the different running time of the program's large cycle). In order to obtain a more stable weight, the AD value is first arithmetic averaged twice, and then a sliding average is performed 8 times. After the voltage measurement is completed, the time to discard 3 AD values ​​is 200ms. When the weight is stable, no jumping or slow response phenomenon can be detected.

In order to improve the linearity of the electronic scale, the bias current of the ADC internal op amp can be increased, and the best increase is 100%. When using CSU1221 to directly drive a passive buzzer, a 100-ohm resistor must be connected in series to avoid the AD value from fluctuating when the key is pressed quickly. After each large cycle, the HALT instruction can be used to suspend the CPU until a new interrupt (such as an AD interrupt) is generated, which can reduce the power consumption of CSU1221.

Since analog signals are extremely susceptible to external electromagnetic interference, the following details should be noted in the actual design: 1) When laying out the PCB, the distance from the interface sensor input to AIN0 and AIN1 should be as short as possible, and the ground terminal of the filter capacitor should be directly connected to the ground copper foil; 2) The two leads of the analog signal are wired in parallel with the ferrite, and the filter capacitors are arranged closely in parallel.

Since the clock frequency of I2C is relatively high, in order to avoid interfering with the built-in ADC, it needs to be kept away from the analog I/O pins. The analog ground AGND of CSU1221 should be separated from the digital DGND and returned to the ground of the voltage regulator chip (HT7130), while the ground of HT7130 is connected to the ground of the battery. In addition, the ground of other components, such as E2PROM (HT24C02) and LCD driver chip (HT1621), does not have to be connected to DGND. If the ground of these components is close to the ground of the battery, these grounds can be directly connected to the ground of the battery. The ground connection should follow the following principles: The ground of non-CSU1221 analog ground cannot be connected to the analog ground of CSU1221 to avoid interference signals generated by other components flowing through the analog ground of CSU1221 and affecting stability.

When initializing CSU1221 after power-on, it is recommended to adopt the following sequence to improve software reliability: a. After power-on, delay 30ms; b. Initialize the digital part of CSU1221; c. After delaying 30ms, initialize the analog part of CSU1221; d. After delaying 60ms, initialize all RAM.

Conclusion

CSU1221 is a high-precision, low-power, high-reliability single-chip MCU with built-in ADC. The peripheral circuit is very simple and easy to use. It is very suitable for high-precision, small signal measurement products, such as high-precision electronic scales, barometers, sphygmomanometers, etc. This product has been mass-applied in several weighing instruments and other industries.

Keywords:Measurement Reference address:Design of an electronic scale system based on a single-chip solution

Previous article:Interrupt Control Method of Touch Screen in ARM Embedded System
Next article:The Principle and Application of ADT75 Digital Temperature Sensor

Recommended ReadingLatest update time:2024-11-17 02:35

Hardware debugging skills for single chip microcomputer application system
In the process of single-chip microcomputer development, from hardware design to software design, almost all the work is done by the developer himself according to the characteristics of the system. Although this can reduce system costs and improve system adaptability, the debugging of each system takes up 2/3 of the t
[Microcontroller]
How to reduce the power consumption of PIC microcontroller?
I have been working on the power consumption of PIC microcontrollers. Since the project is powered by batteries, the power consumption issue is very important. According to the data sheet and information on the Internet, the power consumption of microcontrollers is mainly affected by the following factors:   1: All I/
[Microcontroller]
How to reduce the power consumption of PIC microcontroller?
MCU Assembly Experiment 5-1: Serial Communication Experiment between MCU and PC
Experimental requirements: The AT89S52 serial communication port works in mode 1, 8-bit UART mode, receiving is allowed, 9600bps. Run the serial port debugging software on the PC. Programming implementation: The microcontroller receives the data sent by the PC and sends it back to the PC for display, and can also send
[Microcontroller]
New improved LCD screen polarization drive circuit design based on MCU
introduction Due to design and process reasons, some panels have problems such as the characteristics of liquid crystal molecules being easily destroyed. Therefore, when designing the driving circuit of the liquid crystal panel, it is necessary to add a special functional circuit to control the deflection direction
[Microcontroller]
New improved LCD screen polarization drive circuit design based on MCU
Nordic's new Bluetooth 5.1 SoC can operate in 105 degree ambient temperature
Nordic’s popular nRF52 product family has been expanded with the nRF52833 SoC, a proven multiprotocol solution that quickly became an ideal choice for professional lighting and other industrial applications due to its high temperature performance, direction finding capabilities, and robustness.    Nordic Semiconductor
[Internet of Things]
Nordic's new Bluetooth 5.1 SoC can operate in 105 degree ambient temperature
Matrix keyboard developed by 51 single chip microcomputer
3.6 Matrix Keyboard 3.6.1 Schematic diagram of matrix keyboard To use the matrix keyboard, you need to connect JP4 to JP8 (P1) and disconnect the JP165 jumper cap (otherwise the rightmost row of the matrix keyboard will not work properly).  Figure 3-6-1 Figure 3-6-2   3.6.2 Introduction to Matrix Keyboard When the
[Microcontroller]
Matrix keyboard developed by 51 single chip microcomputer
Pressure data acquisition based on LM331 and single chip microcomputer
script src="/jf/jf-arcMain-1.js" type=text/javascript /script script type=text/javascript /script script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type=text/javascript /script script src="http://pagead2.googlesyndication.com/pagead/js/r20110810/r20110719/show_ads_impl.js" /script
[Microcontroller]
Pressure data acquisition based on LM331 and single chip microcomputer
Technical knowledge sharing: AVR microcontroller introduction and feature analysis
AVR microcontroller is a RISC microcontroller launched by Atmel in 1997. RISC (Reduced Instruction Set Computer) is relative to CISC (Complex Instruction Set Computer). RISC does not simply reduce instructions, but improves the computing speed by making the computer structure simpler and more reasonable. RISC gives p
[Power Management]
Latest Test Measurement Articles
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号