Design of electronic scale system based on single chip solution

Publisher:科技创造者Latest update time:2012-02-29 Source: 深圳市芯海科技有限公司 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.

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 of the sensor excitation end is provided by the internal LDO output of CSU1221, with a load capacity of up to 15mA, and four output voltages are available. 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
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 time-sharing using the spare analog input terminals. 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 for discarding 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.

Reference address:Design of electronic scale system based on single chip solution

Previous article:Software approach to anti-interference of single-chip computer system
Next article:Design of PCI Interface of Single Chip Microcomputer Based on CPLD

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号