Microcontrollers (MICroController) can be referred to as MCU or μC, and some people call it single chip microcontrollers (Single Chip Microcontroller). It combines ROM, RAM, CPU, and I/O in the same chip to perform different combination controls for different applications. Microcontrollers have been continuously researched and developed in recent years, from 4-bit, 8-bit, to the current 16-bit, 32-bit, and even 64-bit. The maturity of the product, the number of manufacturers involved, and the wide range of applications are unprecedented. At present, foreign manufacturers are leading in technology because of their early development and wide product lines, while local manufacturers win by taking multi-functional products as the orientation. But it cannot be denied that the price war of local manufacturers is the key factor that threatens foreign companies.
Due to the improvement of manufacturing process, the price difference between 8-bit MCU and 4-bit MCU is almost the same, and 8-bit has gradually become the mainstream in the market; for 4-bit MCU, most suppliers adopt order-based production. At present, 4-bit MCU is mostly used in calculators, car meters, car anti-theft devices, pagers, wireless phones, CD Players, LCD driver controllers, LCD Games, children's toys, scales, chargers, tire pressure gauges, thermometers and hygrometers, remote controls and point-and-shoot cameras, etc.; 8-bit MCU is mostly used in electric meters, motor controllers, electric toy machines, variable frequency air conditioners, pagers, fax machines, caller ID, telephone recorders, CRT Display, keyboard and USB, etc.; 16-bit MCUs are mostly used in mobile phones, digital cameras and camcorders, etc.; 32-bit MCUs are mostly used in Modem, GPS, PDA, HPC, STB, Hub, Bridge, Router, workstation, ISDN phone, laser printer and color fax machine; 64-bit MCUs are mostly used in high-end workstations, multimedia interactive systems, advanced video game consoles (such as SEGA's Dreamcast and Nintendo's GameBoy) and advanced terminals, etc.
In terms of MCU development, there are two main streams in terms of architecture: RISC (such as HOLTEK HT48XXX series) and CISC (such as Winbond W78 series). RISC (Reduced Instruction Set Computer) means that all instructions of MCU are composed of some simple instructions. Simple instructions mean that the circuit of MCU can be optimized as much as possible, thereby increasing the execution speed and reducing the time required for one instruction to the shortest. HOLTEK's HT46XX (A/D MCU series), HT47XX (R to F MCU series), HT48XX (general I/O MCU series) and HT49XX (LCD MCU series) are designed with RISC structure. Whether it is RISC or CISC (Complex Instruction Set Computer), the purpose of designing MCU is to serve mankind. For RISC, due to the simplicity of the instruction set, many tasks must be combined with simple instructions, and more complex combinations of tasks need to be performed by a "compiler". CISC MCU has more instruction sets provided by the hardware, so many tasks can be replaced by one or several instructions, and the compiler's work is therefore reduced a lot.
Figure 1: MCU architecture block diagram.
Program Memory
Program ROM is a read-only and non-writable memory unit in a microcontroller. This memory is mainly used to store programs developed by users, and its nature is data that is not often changed or never changed. The operation of the microcontroller is based on the program instructions stored in this area. The common program memory capacities in 8-bit single chips are 0.5K, 1K, 2K, 4K and 8K, and the program memory commonly used in microcontrollers has the following types, see (Table 1):
Table 1: Program memory in a microcontroller is usually organized in several ways.
In addition, regarding the program confidentiality, whether it is encryption or fuse protection, it is to prevent the program from being peeped or stolen by unauthorized users (such as decompiling the program, modifying the content, stealing the program, etc.). The program confidentiality function option is only used on OTP, window packaging, EEPROM and FLASH ROM , because these ICs can read the program code back and forth through the burner, and the Mask version does not require the program confidentiality step. Random Access Memory Random Access Memory ( RAM), also known as Read/Write Memory, is often used to temporarily store data or store data during program execution. It has a wide range of uses. Taking the HOLTEK 8-bit microcontroller as an example, its capacity has 64, 96, 160 and 224 Byte options.
Accumulator
The accumulator is the core of the MCU. 80% of the instructions are related to the accumulator. Data can be stored in the accumulator until the bus or other units are ready to accept it, or until the program needs it.
Cache
Registers are places inside the MCU that temporarily store data. The functions of each register are different, but they all have a common feature, which is that they can be directly read/written. Because they are located inside the MCU, some unnecessary waiting and addressing time are reduced. In addition, some MCU I/O ports are also directly accessed and controlled in the form of registers.
Stack and stack pointer
Stack and Stack Pointer. Stack is like a plate, stacked from bottom to top one by one, and when taking out, take it out from the top one by one, and cannot be taken out from the middle, so it is also called "Last-In-First-Out Queues". The functions are as follows;
1. Temporarily store the value of PC (Program Count), which is suitable for "subroutine call" or temporarily storing the value of PC when an interrupt occurs;
2. It can be used as a buffer and completed by Push and Pop;
3. Some MCUs have fixed number of stack levels (such as HOLTEK μC series), while others can be customized.
The function of the Arithmetic Logic Unit (ALU) is to execute arithmetic instructions and logical judgments. In addition to generating results, it also generates related flags (Zero, Carry, Borrow, Status). Each MCU is different, especially the Carry Flag, which must be checked in the instruction explanation table.
Input/Output (I/O Port)
In single-chip microcomputer application systems, I/O expansion is not the purpose, but to provide an input/output channel for external devices as a communication channel between the outside world and the MCU. For example, connecting a keyboard, display, drive switch control or measurement, etc. When expanding I/O, the hardware circuit characteristics of the peripheral devices connected to it must be considered, such as: potential matching, interference suppression, driving ability (such as Source, Sink ability), etc.
Microcontrollers have a variety of circuit forms for I/O ports, many of which can set the input/output direction in bit units through software. Each port is equipped with a high- current , high-voltage buffer to directly drive LEDs and high-power transistors , as well as for analog signal input.
Timer, timer
Timer (Time Counter), timer (Timer), by adding an external oscillator crystal, through the frequency division circuit to provide MCU with several different time bases (Time Base). Commonly used in:
1. Clock time base (such as 1sec, 500ms, 62.5ms, 15.625ms, etc.);
二. PWM(Pulse Width Modulation)之 Time Base;
3. Key SCAN;
4. LED Scan;
五. Frequency output;
六. Pulse Reading;
7. APO (Auto Power OFF), etc. Counter
Event Counter is used to accumulate the number of external events, which may be pulse or other data, and can also be used to generate correct time delay. Commonly used in:
1. Another time base with a fixed frequency; 2. Counter; 3. Can be programmed as another immediate interrupt input;
4. Speed Meter, Tachometer. Interrupts Interrupts are used to handle immediate events or events that are prioritized for processing. They are responsible for time counter timeout interrupts and interrupt requests generated by external events. Most microcontrollers have multi-layer interrupt processing systems with built-in interrupt priority circuits to determine the order of priority. Commonly used in:
1. The MCU is in passive Standby state (Halt-Stop) and wakes up by an external signal;
2. Need to be processed immediately ( sensors , switches, alarms, power failure alarms); 3. Need to be processed at a fixed interval (Display, Key Scan, Read-Time C LOC k); Peripheral resources on the microcontroller
After looking at the basic architecture of so many microcontrollers, let us continue to understand what peripheral resources can be added to the microcontroller to expand and extend its functions.
Serial I/O
Microcontrollers contain serial I/O to provide communication channels with external peripheral Dev ICs . There are different types for each manufacturer, and the common ones are as follows:
◆UART(Universal Asynchronous Receiver Transmitter):Intel,Atmel;
◆USART(Universal Synchronous/Asynchronous Receiver Transmitter ):Siemens;
◆SPI(Serial Peripheral Interface):Motorola;
◆SCI (Sertal Communications Interface): This is an enhanced version of UART;
◆I2C bus (internal Integrated Circuit bus): Philips;
◆Microwire/Plus:National SEMIconductor;
LCD Driver
LCD (Liquid Crystal Display) is a commonly used display device in display interfaces. For example, it can be found in some multi-function phones, digital thermometers, pagers, mobile phones, and handheld game consoles. Therefore, microcontrollers with built-in LCD driver circuits are widely used. There are two driving modes to choose from: Segment and Dot Matrix. For example, the popular pet eggs use Dot Matrix LCD displays. Japanese microcontroller manufacturers provide a variety of microcontrollers with built-in LCD driver devices for selection. In addition, the HO LTE K HT49XX series also provides microcontrollers with LCD driver devices.
Fluorescent Tube Driver (VFT Driver)
We cannot read the contents of LCD displays without light or backlight, but VFT displays can provide high brightness and multi-color visual effects, and are often used in advanced home appliances, such as DVD players and DSP equalizers. For products that require dazzling output effects, VFT (Vacuum Fluorescent Tube) Driver is one of the important resources in the selection of microcontrollers.
OSD is one of the indispensable functions for the humanized interface of TV and monitor. The display circuit of OSD (On Screen Display) receives the horizontal synchronization signal (H-Sync) and the vertical synchronization signal (V-Sync), and then sends the screen information through RGB and Blanking. The display color can reach up to eight. The execution rate of each microcontroller instruction will cause the number of lines and fields of OSD to be different. The number of lines displayed ranges from two to dozens of lines, and the field ranges from 15 to 26 characters or more. Usually, the faster the execution rate, the more lines and fields can be displayed, and the slower the rate, the more direct display will be limited.
Analog to digital converter (ADC)
Since many applications of microcontrollers require the detection of external environmental conditions as a reference for processing data, for example, in TV applications, the automatic frequency control (AFC) signal of the tuner is a voltage signal. Other detections such as temperature are also mostly converted into voltage signals. Therefore, the application of analog to digital converters is very extensive in industrial and consumer electronics.
Analog applications are so frequent that manufacturers provide analog/digital conversion as a general standard specification (such as HOLTEK HT46XX series). However, the resolution of analog/digital varies greatly from manufacturer to manufacturer, ranging from 3 to 10 bits, depending on different needs. Although there are many conversion channels, usually only one circuit is used for processing, which is switched by a selector. For applications where time consideration is not particularly emphasized, it will not have much impact.
There is another analog/digital conversion method, which is R to F (Resistance to Frequency), which is generally used in temperature/humidity detection. It uses the change characteristics of the resistance / capacitance sensor to convert it into a frequency value, and uses this frequency value to calculate the relativity of temperature/humidity. Such ICs include the HOLTEK HT47XX series.
Digital to Analog Converter ( DAC )
When controlling analog components, analog signals are required. For microcontrollers, digital to analog converters must be built in to cope with this. The internal structure is composed of digital to analog converter registers and a ladder resistor, and the digital/analog resolution is 8 bits each. In an 8-bit microcontroller with a reference voltage of 5V, assuming that a digital value of 60 is converted into an analog value, the calculation method is (60/256x5Volts) = 1.171875V. For example, in a phase-locked loop, the VCO (voltage-controlled oscillator ) can be controlled by DAC. In addition, Voice IC also uses the original voice recording into digital data, and then uses DAC to convert the digital data audio to restore the analog voice signal. The purpose of pulse width modulation ( PWM ) is also to achieve an analog effect by matching digital output with peripheral circuits. Its components include pre-divider, counter, data latch, and compare circuits. PWM (Pulse Width Modulation) resolution is controlled by the program. Of course, the time and duty cycle calculation techniques can also be used to achieve the PWM function in general I/O ports, but the response speed will be limited. In addition, major semiconductor manufacturers today all provide microcontrollers with PWM functions for convenience (such as the HOLTEK HT46XX series). There is really no need to focus on PWM programming to reduce the burden on software. The PWM function has a resolution of 6 to 14 bits, which is suitable for various needs.
DTMF generator and receiver The telephone has evolved from the original pulse to the current tone decoding method, which not only improves the decoding speed, but also increases reliability and noise resistance . DTMF (Dual Tone Multiple Frequency) is a mixed audio signal of two frequencies, so decoding is less likely to go wrong. When applied to microcontrollers for telephone products, the DTMF resource is often an important specification to select.
Watchdog Timer Microcontrollers are not allowed to crash in products, but due to noise interference or improper operation, preventive measures must be taken to ensure that the microcontroller can automatically reset in the event of a crash so that the microcontroller can continue to operate. We can say that the watchdog timer is a timer that automatically resets the microcontroller when it crashes.
Watchdog timer is used to monitor whether the microcontroller has abnormally crashed. Many microcontrollers have it as a standard feature.
The watchdog timer is actually like a self-running RC oscillator. It does not require any external parts. That is to say, no matter whether the clock oscillation of the chip's clock oscillation pin stops or not, it will continue to count without interruption, even if the chip enters the power-saving Halt state (in the Halt state, the chip's clock stops oscillating but the Watchdog timer will not stop timing. When the timing expires, the chip will automatically reset, and the I/O pin output remains unchanged, which saves power). Whether to enable the Watchdog timer must be decided when the program is burned in the OTP version in order to decide whether to blow its fuse. In the Mask version, the user can choose whether to use this function.
The higher the supply clock of a dual-clock microcontroller, the greater the power consumption. Therefore, when selecting products that use battery power, dual-clock is often a function that must be considered. Generally, the secondary clock operates at 32.768K Hz and is mainly used for timing (RealTime Clock).
Therefore, based on the above, the instruction set structure of the microcontroller is relatively simple, easy to develop and modify, and has strong I/O and interrupt processing capabilities. The main development work is concentrated on software design. As long as the development system (ICE: In-Circuit Emulator) and the universal board are used, online simulation work can be carried out to carry out design and modification work. Since the microcontroller has low unit price, simple system hardware architecture, easy development and modification of application programs, good chip stability, and high reliability, its application field is extremely wide and almost ubiquitous. Therefore, choosing different equipment in different occasions and fully understanding the internal resources of the microcontroller will help product development and reduce costs. It is believed that new peripheral resources will be added to the microcontroller in the future, and the scope of application will become wider and wider. It has also replaced the traditional circuit design concept and become the new design mainstream.
Previous article:A multifunctional charging system based on single chip microcomputer control that can charge various types of batteries
Next article:Design of signal generator based on AT89C52 single chip microcomputer and DAC0832 D/A converter chip
Recommended ReadingLatest update time:2024-11-16 16:21
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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!
- 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
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- 5G millimeter wave antenna
- Design of Switching Power Supply Using MSP430 Microcontroller
- Analog Electronics Course Selection Test
- About SPI mode setting
- [Sipeed LicheeRV 86 Panel Review] 14. lvgl displays images and local time
- LCD screen problem
- Using 18f2550 as PWM sine generator
- TI CCS MAP File Description
- Approximate power functions using the extremum method
- 【NXP i.MX8M】Mill MYD-JX8MX development board review