Cainiao takes you to kill single-chip microcomputer 51 in seconds-I/O port

Source: Internet
Author: User

I am about to go out and look for a job. I don't know if I can use single chip microcomputer in the future. I will summarize my self-taught opinions. This gives beginners and fans a deeper understanding! The sequence of introduction is probably AVR, MSP430, and lpc210x.

51 Single-Chip Microcomputer I/O is bidirectional, and the drive capability is relatively weak. We generally use 51 single-chip microcomputer with 32 General I/O Ports. P0 has a maximum internal pulling resistance. When I/O ports are used, the upper and lower pulling resistance is usually used. The P3 port has a second function. These features are all available in the future and are being strengthened. Beginners do not need to know a lot about things. They do not need to study details. You only need to know how to use things before you can have your own ideas. Next we will learn 51 SCM resources. 51 SCM resources are less than other SCM resources, probably Io, external interruptions, and poor interruptions, timer, and serial communication. (Other built-in single-chip microcomputer modules basically have these modules, so you must learn well)

The above figure shows that P0 has no upper-pull resistance.

Io principle settings are based on Master Feng nuoman's principle and adopt uniform addressing. 51 single-chip microcomputer is divided into data memory and program memory. In fact, there is no clear explanation of this. To find out what is necessary, please refer to "Computer composition principle". Ram is an interrupted media, and Rom is the resource storage area. We need to get it there. The principle of this implementation is probably like this, the CPU executes the data in the memory (the data here may be the command may be the data, this data is a generalized data), and then the information to start executing a piece of data in the memory, the command points to an address. (This is the implementation principle of pointers in the C language) and then to the Rom, the single chip microcomputer Io operation, P0 = 0x01; the MCU writes 0x01 to the 0xing address 0x80. this address is the uniform addressing address, and the 8-Bit Single-Chip Microcomputer addressing capability is limited. Interrupt implementation is similar, so I will not talk about it later.

 

With this simple program, you can study a lot of things. It is good for you to learn C language by looking at the disassembly code. Not most people think that the execution of the program starts from the 0 address of the RoM. Understanding these is good for learning advanced SCM. There are many people who are going to be the flow lights, Dongzi digital tubes, and lcd1602 12864. These things are peripheral modules. You have learned a single-chip microcomputer, and these things are full of clouds, when learning other things, you can use them flexibly. There is no situation where other single-chip computers cannot run. Think about how the program is executed. Think slowly, when you want to understand, it makes more sense to write a few verification programs than to write 100 flow lights.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.