Single chip microcomputer C8051F020 and its application in instruments and meters

Publisher:genius6Latest update time:2011-08-27 Source: EEWORLD Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

At present, with the continuous improvement of science and technology and industrial and agricultural production levels, higher and higher requirements are placed on corresponding instruments and meters. Therefore, instruments and meters need to expand a large number of peripheral functional components to meet the requirements of complexity, high performance and intelligence of instruments and meters.

Although this method meets the complexity requirements of the instrument, the problem that comes with it is that the system reliability is reduced, the failure rate is increased, and it is difficult to find faults due to the excessive complexity of the system expansion, thus losing the advantages of intelligent instruments. If all or most of the numerous complex peripheral functional components can be integrated into the single-chip microcomputer used in the system, the reliability of the instrument system can be greatly improved, while the cost of the system can be reduced. The internal resources of the single-chip microcomputer can also be used to enhance the performance of the instrument without increasing the hardware cost. Therefore, this solution is an effective method to improve the reliability and performance of instruments. The C8051F020 single-chip microcomputer of Cygnal Corporation in the United States is a single-chip microcomputer that can meet the requirements of complex and high-performance instruments.

The C8051F020 MCU is a mixed signal system-level MCU integrated on a single chip. It is a microcontroller that is fully compatible with the MCS-51 core and instructions. In addition to the digital peripheral components of the standard 8051 machine, the chip also integrates analog components and other digital peripherals and functional components commonly used in data acquisition and control systems, mainly including analog multiplexers, programmable gain amplifiers, ADCs, DACs, voltage

Comparator, voltage reference, temperature sensor, SMBus/I2C, UART, SPI, programmable counter/timer array, timer, I/O port, power monitor, watchdog timer and clock oscillator, etc. The microcontroller has internal JTAG and debugging circuits. Through the JATG interface, the microcontroller installed in the final application system product can be used for non-intrusive, full-speed and in-system debugging.

2Functions and Features

(1) 25MIPS high-speed pipeline CIP-51 core that is fully compatible with 8051 machines.

(2) True 12-bit 100KBps, 8-channel ADC with programmable gain amplifier.

(3) True 8-bit 500KBps ADC with programmable gain amplifier.

(4) Five 16-bit general-purpose timers.

(5) Programmable counter/timer array with 5 capture/compare modules.

(6) Internal voltage reference.

(7) Built-in temperature sensor (±3℃).

(8) On-chip watchdog timer, clock source and VDD monitor.

(9) 64 general-purpose digital I/O ports.

(10) It has I2C/SMBUSSPI and two-way UART and serial interface.

(11) 64KB system programmable FLASH memory.

(12) 4352 (4096 + 256) bytes of on-chip RAM.

(13) External memory interface with 64KB address.

(14) The internal FLASH memory can be programmed in the system and can be used as both program memory and non-volatile data memory.

(15) The operating voltage is 2.7V~3.6V, the typical value is 3V, and the I/O, RST, and JTAG pins all allow 5V input voltage.

(16) Full range of industrial-grade circuits (-45°C - +85°C).

(17) On-chip JTAG emulation circuit provides full-speed in-circuit emulation without occupying on-chip user resources. It supports debugging commands such as breakpoints, single-step, watchpoints, run and stop, and supports memory and register verification and modification.

3 Internal functional components

3.1CPU

The main features of C8051F020CPU are as follows:

(1) Fully compatible with standard 8051 machines, supporting standard ASM51 and KeilC high-level languages;

(2) It has high-speed instruction processing capability. The machine cycle is reduced from the MCS51 standard 12 system clock cycles to 1 system clock cycle, and 70% of the instruction time is 1-2 machine cycles, which greatly improves the instruction processing capability;

(3) The number of interrupt sources has been increased from 7 to 22 in the MCS-51 standard.

(4) The reset source is increased. The standard MCS-51 only has external pin reset, while the C8051F020 adds 7 reset sources, which greatly improves the system reliability.

(5) An internal clock source that can work independently has been added.

3.2 Memory

3.2.1 Data Storage

C8051F020 has the program and data address configuration of the standard 8051 machine, including 256 bytes of RAM, of which the upper 128 bytes are 2 address spaces, the upper 128 bytes accessed by indirect addressing and the SFR address space accessed by direct addressing, and the lower 128 bytes can be accessed by users in direct or indirect addressing. In addition, C8051F020 also has 4KB of RAM and an external data memory interface (EMIF) located in the external data memory address space. This 4KB RAM can be mapped only to the chip or to the 64KB external data memory address space, and can also be mapped to the chip and the chip at the same time (4KB addresses are accessed in the chip memory space, and more than 4KB are accessed through the EMIF). The external data memory interface is used to access up to 64KB of external expansion RAM.

3.2.2 Program Memory

The program memory of C8051F020 contains 64KB of FLASH, which is divided into 512B sectors and can be programmed in the system without providing programming voltage outside the chip. The unused sectors of the program memory can be used by the user as non-volatile data memory on a sector by sector basis.

3.3I/O and Digital Crossbar Switch

In addition to the standard 8051 ports P0 to P3, the C8051F020 microcontroller also has an additional 4 8-bit I/O ports. In this way, the total number of I/O ports can reach 64, and each port I/O pin can be set to push-pull or open-drain output. The most unique function is the introduction of a digital cross switch, which can allocate internal digital system resources to the I/O pins of ports P0, P1, P2 and P3, and can configure the on-chip counter/timer, serial bus, interrupt source, A/D conversion input, comparator output and other digital signals of the microcontroller to be output on the above I/O pins, which allows users to choose a combination of general-purpose I/O and required digital resources according to their specific applications.

3.4 Programmable Counter Array

In addition to the internal 5 16-bit general-purpose timer/counters, C8051F020 also provides an on-chip programmed counter/timer array (PCA), PCA includes a dedicated 16-bit counter/timer, 5 programmable capture comparison modules, the time base can be one of the following 6 clock sources: system clock/12; system clock/4; timer 0 overflow; external clock input; system clock and external oscillation frequency/8. Each capture module has 6 working modes: edge-triggered capture, software timer, high-speed output, 8-bit pulse width modulator, frequency output, 16-bit pulse width modulator.

3.5 Multiple types of serial bus ports

C8051

F020 has two full-duplex UARTs, SMBUS/I2C bus and SPI bus. Each serial bus is completely implemented in hardware and can generate interrupts to CIP-51. These serial buses do not share timers, interrupts or I/O ports, so users are allowed to use them all at the same time.

3.6A/D Converter

There are 2 ADC subsystems inside C8051F020.

3.6.1 12-bit A/D converter ADC0

The converter consists of a successive approximation ADC, a multi-channel analog input selector and a programmable gain amplifier. The ADC can provide true 12-bit accuracy when operating at a maximum sampling rate of 100KBPS. The eight external input channels of ADC0 can be configured as two single-ended inputs or one differential input. The ninth input channel of ADC0 is an internal temperature sensor, and a 2.34V reference voltage is provided internally. The gain of the programmable gain amplifier can be set by software, increasing in integer powers of 2 from 0.5 to 16, allowing software events or hardware signals to trigger conversions or perform continuous conversions.

3.6.2 8-bit A/D converter ADC1

In addition to the 12-bit ADC subsystem ADC0, C8051F020 also has an 8-bit ADC subsystem, namely ADC1, which has an 8-channel input multiplexer and a programmable gain amplifier. The ADC can provide true 8-bit accuracy when operating at a maximum sampling rate of 500KBps. The ADC reference voltage can be selected between the power supply voltage pin (AV+) and the external VREF pin. The gain of the programmable gain amplifier of ADC1 can be programmed to 0.5, 1, 2 or 4. ADC1 also has a flexible conversion control mechanism that allows ADC1 conversion to be started by software commands, timer overflow or external signal input, and ADC1 can be synchronized with ADC0 for conversion by software.

3.7D/A Converter

There are two 12-bit voltage DACs inside C8051F020. The output swing of each DAC is 0V~VREF-1LSB. The CPU can control the digital-to-analog conversion and comparator through SFRS. The CPU can put any DAC into low-power shutdown mode. The DAC is in voltage output mode and shares the reference voltage with the ADC. The DAC output can be updated using software commands and the overflow signals of timer 2, timer 3 and timer 4.

3.8JTAG

The C8051F020 has an on-chip JTAG interface and logic to provide boundary scan capabilities for production and in-system testing of FLASH memory read and write operations, as well as non-intrusive in-circuit debugging. The on-chip interface fully complies with the IEEE1149.1 specification.

4 Application of C8051F020 MCU in Instruments

C8051F020 is a powerful single-chip microcomputer that integrates many functional components. It is suitable for application systems that require powerful hardware functions, fast computing speed, harsh working environment, high reliability, strong expansion functions and low power consumption. The following takes an actual instrumentation system, namely an electronic batching scale, as an example to give the specific application method of C8051F020 in instrumentation. The electronic batching scale is a batching weighing instrument widely used in food processing, feed, additives, pesticides, chemicals, metallurgy and other industries. The main requirements for electronic batching scales are high speed, high precision, high reliability and high stability, and dynamic continuous or intermittent dynamic continuous operation is required throughout the production process. The weighing and batching system is based on the single-chip microcomputer as the core, and its hardware circuit block diagram is shown in Figure 1.

Hardware circuit diagram of electronic batching scale

Figure 1 Hardware circuit diagram of electronic batching scale

Although the electronic batching scale shown in Figure 1 can basically meet the needs of production, the system has many peripheral functional devices, which makes the system circuit complex, the failure rate high, the debugging difficult, and the programming complex. After repeated analysis and demonstration, we redesigned the electronic batching scale with C8051F020 as the core, as shown in Figure 2.

Electronic batching hardware block diagram based on C8051F020

Figure 2 Block diagram of electronic batching hardware based on C8051F020

Using C8051F020 can greatly reduce the number of peripheral circuits and interface circuits for system expansion, improve the reliability and stability of the system, and provide convenience for system function expansion and software and hardware upgrades. The following resources of C8051F020 are used in the system to simplify the original circuit design.

(1) Programmable Gain Amplifier (PGA)

The electronic batching scale transfers the weight of the object to be measured to the weighing sensor by pulling or pressing. The weighing sensor usually adopts a resistive strain bridge type, and its output voltage swing is 0V to hundreds of mV. Therefore, this signal needs to be amplified before it can be provided to the A/D converter. The gain of the programmable gain amplifier can be set according to the full-scale value of the weighing sensor and the reference voltage value of the A/D converter.

(2) A/D converter

The C8051F020 microcontroller has a 12-bit resolution ADC and a 10-bit resolution ADC. The 12-bit resolution ADC is used here. The sampling rate of the 12-bit resolution ADC is as high as 100KBps. By using the ADC inside the C8051F020 chip, on the one hand, the original peripheral expansion ADC is simplified. On the other hand, its 12-bit accuracy and 100KBps sampling rate greatly improve the measurement accuracy and real-time performance of this system, meeting the dynamic accuracy and real-time requirements of this system, thereby making the forward channel of this system more stable.

(3) Program and data memory

The C8051F020 microcontroller has a 64KByte large-capacity FLASH program memory and a 4305Byte data memory. This can meet the requirements of electronic batching scales to store complex algorithm programs and large amounts of data, while leaving enough space for system software upgrades and simplifying the original external

Since C8051F020 supports in-system programming, the software upgrade of this system is very convenient.

(4) Rich programmable digital I/O resources

This system can meet the I/O requirements of the system without any external I/O expansion. At the same time, it can make the connection between the system's human-machine channel and input/output switch quantity and the CPU smoother, and the 12-BitDAC on the chip further improves the backward channel of the system.

(5) Rich software resources

A good environment has been created for the use of high-level languages ​​such as C51 for programming in this system. The high-level language programming environment can make the system software truly modular, and can also make various programming algorithms simpler and easier, as well as more complete, thus greatly improving the software upgrade capability of this system.

(6) Online debugging

Since the chip has JTAG and debugging circuits, the electronic batching scale can be debugged on-site through JTAG, thus facilitating the resolution of various practical problems encountered in production.

(7) Serial communication

C8051F020 provides multiple serial buses such as UART, I2C, SPI, etc., so it allows the expansion of external devices in multiple ways, and is more conducive to the construction of a multi-level distributed measurement and control system.

By utilizing the powerful and diverse analog and digital functional components provided by the C8051F020 chip, a high-speed, high-precision, easy-to-expand and upgrade continuous dynamic batching weighing electronic scale system can be constructed without the need for peripheral circuit expansion.

5 Conclusion

C8051F020 is one of the most powerful 8-bit microcontrollers currently available. Its powerful functions are ideal for upgrading existing instruments or designing complex and high-performance intelligent instruments. Therefore, this circuit is an ideal choice for the core "microcontroller system" of intelligent instruments.

Reference address:Single chip microcomputer C8051F020 and its application in instruments and meters

Previous article:Design of remote temperature control system based on STM32
Next article:A design of pan/tilt system based on single chip intelligent control

Latest Industrial Control 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号