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.
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.
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.
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
- Popular Resources
- Popular amplifiers
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- CGD and Qorvo to jointly revolutionize motor control solutions
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Nidec Intelligent Motion is the first to launch an electric clutch ECU for two-wheeled vehicles
- Bosch and Tsinghua University renew cooperation agreement on artificial intelligence research to jointly promote the development of artificial intelligence in the industrial field
- GigaDevice unveils new MCU products, deeply unlocking industrial application scenarios with diversified products and solutions
- Advantech: Investing in Edge AI Innovation to Drive an Intelligent Future
- CGD and QORVO will revolutionize motor control solutions
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- EEWORLD University ---- ADPD188BI Integrated optical module for smoke detection
- Positive and negative power supplies, in-phase and inverting amplifier applications of op amps 1. Op amps powered by positive and negative power supplies have a large dynamic range...
- EEWORLD University Hall----Components and Electromagnetic Compatibility
- The role of pressure sensors in mobile phones
- The principle of I2C bus digital potentiometer and its interface design with single chip microcomputer
- VHDL design combinational circuit, modelsim timing simulation midway output is not dynamic
- 4 Working principle and advantages of switching BOB power supply
- MicroPython Newsletter Issue 11 (MicroPython 8th Anniversary)
- Please tell me why the 15V output of the circuit in the attached picture is connected with GND
- [N32L43X Review] 8. FreeRTOS Porting