Some small summary of single chip microcomputer

Publisher:HarmonyJoyLatest update time:2015-05-19 Source: 51heiKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
I sorted out the concepts that I didn't understand when I was learning MCU. I summarized them myself and Baidu, so there may be some inappropriateness. I hope everyone can forgive me.

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

Keywords:MCU Reference address:Some small summary of single chip microcomputer

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

[MCU] fota dfu upgrade
Simple fota upgrade method, only for parameters. /******************************************************************************************************************************************  * @file fota.c  * @author jianqiang.xue  * @version v1.0.0  * *****************************************************************
[Microcontroller]
AVR single chip microcomputer realizes intelligent refrigerator control system
Introduction: Nowadays, refrigerators have become popular in every household. People have higher and higher requirements for the performance and control functions of refrigerators, especially the intelligence level. The AVR single-chip intelligent refrigerator control system described in this paper has the advantages
[Microcontroller]
AVR single chip microcomputer realizes intelligent refrigerator control system
Temperature alarm design based on 51 microcontroller
Abstract: Single-chip microcomputer technology has been popularized in our lives, work, scientific research, and various fields, and has become a relatively mature technology. This article will introduce a digital thermometer based on single-chip microcomputer control. This thermometer is a multi-functional thermomete
[Microcontroller]
Temperature alarm design based on 51 microcontroller
Design of electronic perpetual calendar based on 51 single chip microcomputer
Hardware Solution As life and work become busier, people need not only the time but also the information closely related to their life and work, such as temperature, date, etc. The birth of multifunctional electronic clocks has solved this problem very well. It displays the time while displaying many functions such as
[Microcontroller]
Design of electronic perpetual calendar based on 51 single chip microcomputer
Output SPWM program based on avr microcontroller I/O port
Based on the ATmega16 microcontroller output SPWM program, the PWM frequency is 25KHZ, the output sine wave is 50HZ, the output voltage waveform is smooth, the distortion is small, only hardware and software need to be combined. The circuit is simple, and the function can be adjusted by modifying the program, with low
[Microcontroller]
Design of digital clock based on stc89c52rc microcontroller (digital tube display)
Things always look simple, but they are not so easy to do. I wrote this program according to the tutorial at the beginning. I skipped some parts that I didn't understand... It turned out that this was not advisable... After writing a hundred lines, I compiled it and got an error! I couldn't solve it. O
[Microcontroller]
Design of power-free electronic lock system based on STCl2C2052 single-chip microcomputer
O Introduction At present, there are many electronic locks based on IC card design on the market, which are widely used in hotels, apartments, warehouses, schools and other places. These occasions can provide good DC or AC power, and the control part of the electronic lock can easily obtain stable power for a long ti
[Microcontroller]
Design of power-free electronic lock system based on STCl2C2052 single-chip microcomputer
Learning experience of single chip microcomputer beginners
The single-chip microcomputer is a very practical subject. Without practice, everything is just a mirage. It is very necessary to spend some money to buy a development board. ("The development board is like the seeds that farmers plant. As long as they can be used reasonably, they will take root and sprout, and finally
[Microcontroller]
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号