Hardware
MCU: microcontroller, refers to the single-chip microcomputer, control is the most fundamental difference between MPU
MPU: microprocessor, which is a type of CPU, used to process data and calculate; of course, the MCU also has processing and calculation capabilities, but it is much weaker in terms of capabilities. The bigger difference is that it is not as complete as the MCU system. It is more like a core of the MCU and lacks corresponding ROM RAM, etc. These need to be expanded externally.
SOC: Similar to MPU, but it integrates some peripherals based on the core. For example, S3C2440 integrates USB interface, TFT controller, etc. ARM9 and other embedded chips belong to this category.
Register: This is the most common word heard when you first get to know a microcontroller. In fact, it can maintain data and input new status data at the same time. Many registers of 51 are units divided from RAM. Setting the value of them can get different responses; the required functions are obtained by setting the registers in the microcontroller.
RAM, ROM: ROM program memory, RAM temporary data memory. The program is downloaded to ROM, and then the CPU reads it to RAM. The intermediate data during the calculation process is also stored in RAM. The size of RAM will have a great impact on the calculation speed, similar to computer memory. If the memory stick is too small, the CPU must read new data into it when the memory is full, which greatly reduces the speed.
API function: provides some interfaces for accessing hardware or operating system, which are actually functions and variables for operating objects or feedback the current working status of objects.
Crystal oscillator: Similar to the human heart, it provides a regular cycle for the microcontroller, just like the intermittent beating of the heart to promote the flow of blood. Its frequency determines the clock cycle and mechanical cycle.
Clock cycle: The time required for a clock pulse. In computer composition principles, it is also called T cycle or beat pulse. It is the basic time unit of CPU and other single-chip microcomputers.
Machine cycle: The CPU cycle (machine cycle) is usually specified by the shortest time to read an instruction word from the memory, that is, the time required for the CPU to complete a basic operation.
Instruction cycle: The instruction cycle is the time required to execute an instruction, which is generally composed of several machine cycles. It is the total time required from fetching instructions, analyzing instructions to completing execution.
Push-pull, open-drain, strong pull-up, weak pull-up, strong pull-down, weak pull-down output: these are the working modes of the MCU IO port. Different peripherals correspond to different working modes. For example, if the driver chip is not used to drive the dot matrix, the IO port must be set to push-pull mode. For the wireless chip, if no pull-up resistor is added, pull-up or push-pull must be selected. In general mode, the wireless chip cannot work properly. The open-drain seems to be used with the IO port as the input port. Because the resistance value will be large, the current passing through it will be small, and the power loss can also be well controlled.
Serial port: Serial interface refers to the sequential transmission of data bit by bit. Its characteristic is that the communication line is simple and two-way communication can be achieved with only one pair of transmission lines.
Parallel port: In the parallel interface, each bit of data is transmitted in parallel, and it usually transmits data in units of bytes (8 bits) or (16 bits).
Controller and driver: As the name implies, the driver is the circuit that drives the hardware to work, and the controller controls how it works. For example, the S3C2440 has an integrated TFT controller, but the controller alone cannot make the TFT work. There is a circuit on the TFT that drives it to work. Those who have disassembled a servo know that it is just an ordinary DC motor and a circuit board. The circuit board is the driver, and the microcontroller outputs PWM (equivalent to the controller) to make the servo work.
Byte: A byte is a small group of adjacent binary digits. Usually 8 bits make up a byte. A byte is the unit for transmitting information over a network (or storing information on a hard disk or in memory). All information on the network is transmitted in "bits", where one bit represents a 0 or 1, and every 8 bits make up a byte.
Algorithm: As I understand it, an algorithm is a method used to complete a task or a calculation. For example, if you want to move something, you can do it by hand or with a cart. There are many different algorithms for the same problem, and their efficiency varies.
Driver: Driver is a software program that builds a bridge between the operating system and the hardware to make the hardware work normally. If it is widely believed that it is a program that makes the hardware work normally, then the microcontroller water light and the like are also drivers.
Sequential circuit: A device that implements a series of logic operations, where the output value at any given instant depends on its input value and internal state at that instant, and its internal state depends on the immediately previous input value and previous internal state.
Combinational circuit: Combinational logic circuit is composed of the most basic logic gate circuits, and the output value is only related to the input value at that time, that is, the output is solely determined by the input value at that time.
software
For those who started learning MCU at 51, the first thing they wrote should be #include
#include is the file inclusion command. 51 uses very few header files, and many of them are system defined. When you study ARM, you will find that there are many header files, and many of them are self-defined. At this time, we must know the path of the file and add it to the c file that calls it. If the file cannot be found, an error will be reported. There are two ways to add it. One is to set it in the compiler (not all compilers are valid), and the other is to add the path to the include command (please see the use of #include for details). The file reg51.h defines each register and each bit of the register that can be bit-operated. Therefore, the registers must be defined to operate the microcontroller chip. S3c2440 also has its own register definition file 2440addr.h, but the difference between S3c2440 and 51 microcontroller is that it must include startup code to initialize s3c2440. Otherwise, 2440 will not work.
The difference between ++a and a++ is that the former participates in the calculation after adding 1, while the other participates in the calculation and then adds 1. That is to say, for a++, the value of a remains unchanged in that line of code and changes in the next line. For ++a, the value of a has already changed in that line.
It is very uncomfortable to switch from 8-bit microcontroller to 32-bit microcontroller because the operation method has changed. For the previous 51-bit microcontroller, you only needed to change the register to perform direct bit operations or register operation assignments. However, the 32-bit processor is different because there are 32 bits and it is impossible to know the value that each bit should operate on. Direct assignment will inevitably cause erroneous operations.
X bit is set to 1: (register identifier) = (register identifier) || (1< X bit is set to 0: (register identifier) = (register identifier) && ~ (1< Pointers are a very important part in C. In fact, don't think it's too difficult. It's actually a quantity for accessing address data. You can read and write the content in its address through the * sign, and you can also give it a new address through &. Don't operate the content in the address without taking the address of the pointer, because the address pointed to by the pointer is random without taking the address. In the case of careless operation, it may destroy the previous data and cause errors. The most common use of pointers is to operate on arrays. When the pointer points to a one-dimensional array, the pointer variable points to the next number after each increment (it should be noted that if the pointer points to the last digit of the array and then adds 1, it will not go to the first digit again, but unknown data. At this time, what needs to be done is to re-acquire the address). In addition to the method of constantly adding 1, the array operation method also includes * (p + 5), * p represents the digit of the array pointed to, and * (p + 5) means moving 5 numbers based on * P. The two-dimensional operation is similar. It can be operated by self-addition and *(*(p+x)+y). In addition to being used on arrays, pointers can also be used as function parameters and point to functions. For details, please refer to Tan Haoqiang's C classic tutorial
Previous article:External PID program template
Next article:STC single chip running water lamp new pattern program
Recommended ReadingLatest update time:2024-11-16 16:23
- 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
- Based on PSOC6 development board simulation I2C solution X-NUCLEO-IKS01A3 LSM6DSO
- Ripple test
- Top 5 most popular blog posts in 2019 - Helping 5G development
- DDS signal source based on FPGA
- Integer square root algorithm
- Combining the new 6-axis IMU with DSP to achieve high-performance motion tracking accuracy
- Six design issues for I2C isolators
- Common problems and solutions in CCS compilation
- Can TVS be used to extinguish arcs?
- #SpaceX sends 4 civilians into space#When can I travel in space too???