Detailed explanation of the classic experimental examples of single-chip microcomputers (with source code) (I)

Publisher:NexusDreamLatest update time:2013-05-26 Keywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  

  Self-study experience of single chip microcomputer

  Whether you are an amateur electronics enthusiast or a practitioner in the electronics industry, mastering microcontroller technology will undoubtedly give you an extra advantage and open the door to convenience for your electronic gadgets or the development and design of electronic products!

  Moreover, the craze for learning single-chip microcomputer technology is heating up. The Electronics Fan Network has set up a detailed single-chip microcomputer learning column and a very popular forum discussion group, which is very helpful for friends who want to learn single-chip microcomputers. It can be said that the current single-chip microcomputer learning environment is the best. After a period of hard work, the use of single-chip microcomputers to develop and design electronic products is no longer the "patent" of professional electronic engineers! As an ordinary electronics enthusiast, you can master it after some effort! It is very popular for foreign electronics enthusiasts to use single-chip microcomputers to design small productions. Some intelligent robots and intelligent automatic devices cannot be separated from single-chip microcomputers.

  Learning single-chip microcomputer technology is somewhat difficult, and it is hard to learn without some effort, but as long as you keep working hard, you will surely succeed. To quote an advertisement lyric: Hard work always pays off!

  It is best to start learning about microcontrollers from the 51 series. First, there are many books and materials, and many people who have mastered 51 technology, so there are more teachers to ask when you encounter problems. The 51 series experimental chip AT89C51 is inexpensive and easy to buy. The AT89C51 chip can be erased and written repeatedly for more than 1,000 times, which is really suitable for beginners. Even if you consider industrial applications in the future, you can first learn 51 thoroughly and then learn other types of microcontrollers. After all, the technology is interlinked.

  The first step to learn single-chip microcomputers is to read books. Single-chip microcomputers are knowledge-intensive things. You absolutely cannot do without reading books. Beijing University of Aeronautics and Astronautics Press has published a large number of good books on single-chip microcomputers. You can log in to their website directly for mail order. I think the first book should be the basic principle book of 8051 single-chip microcomputers. The first book I read was the "Principles and Interface Technology of Single-chip Microcomputers" published by Tsinghua University Press, which I borrowed from a college student colleague in the unit. This is a university textbook for 51, which introduces the basic knowledge of 51 chips in a relatively systematic way. I think this book is still very helpful to me. I can understand 51 single-chip microcomputers in a systematic way. Although it is not easy to understand at the beginning, it is really useful and very interesting. You can read it roughly first. If you can't digest it, you can study it repeatedly in experimental practice later.

  Here I recommend a multimedia CD for learning microcontrollers to beginners. This CD contains relatively detailed basic knowledge of microcontrollers. Because it is illustrated with pictures and text, it is easier to learn and it is easy to arouse interest in learning. Of course, you still have to read the book in the end, after all, the book is more systematic and comprehensive.

  "MCS-51 Single-Chip Microcomputer Practical Interface Technology" is a good book published by Beijing University of Aeronautics and Astronautics Press. It describes in detail the common interface technology of single-chip microcomputers. If you want to develop products in the future, then everyone should have a copy! "Single-Chip Microcomputer Practice and Application" describes in detail the experiments with single-chip microcomputers. There are very practical assembly source programs. You can learn and imitate the above programs to experiment and quickly master single-chip microcomputer technology.

  The second step in learning about microcontrollers is to purchase tools. Microcontroller chips must be programmed with the help of a programmer. The programmer used by the webmaster is a Genius NSP universal programmer with good performance. The universal programmer is a general-purpose model designed specifically for developing microcontrollers and burning various types of memories. It has high programming reliability and supports a wide variety of devices.

  Genius NSP Universal Programmer:

  4-pin universal locking socket. Suitable for most device programming. Use adapter to support programming of non-DIP packaged devices.

  RS232 serial communication. Communication baud rate: 57600bit/s

  9V/500mA power converter.

  Main functions: programming of six major types of devices: EPROM, EEPROM, FLASH, MPU/CPU, PLD, Serial EEPROM, testing of RAM devices and CMOS/TTL devices, etc.

  The optional device insertion automatic detection start function means that when you select this function and start it, you no longer need to click the mouse every time to start the operation. The operation will automatically start every time you replace the chip and lock the universal socket.

  Genius NSP can run on WINDOS95, 98, me, 2000, and XP.

  From a long-term perspective, it is necessary to purchase a universal programmer.

  The third step in learning microcontrollers is repeated programming practice, which requires an AT89C51 test board.

  Emulators are familiar to microcontroller beginners, but also somewhat unfamiliar. This is mainly because the price of traditional emulators on the market is more than 1,000 yuan, which is a considerable expense for people who are not very well-off. At the same time, emulators are used to improve the efficiency of debugging programs, and they are not essential. Therefore, the webmaster did not use emulators when he started to self-study microcontrollers. When he encountered program errors, he had to think hard, or insert some driver port instructions into the program, and then connect some light-emitting diodes for simple instructions. Generally, it is common to debug a program and repeatedly burn the chip dozens of times.

  Now we introduce a new type of cheap online emulator: it uses a STC89C516RD microcontroller from Macrocrystalline Company [SST Company]. The emulator is connected to the PC through the serial port. This type of microcontroller is one of the 51 series microcontrollers, with ISP (in-system programmable) function, the program can be downloaded serially, it can simulate 63K user program space, and has 450 external RAM bytes.

  After you have the necessary tools, you can start learning microcontrollers. You can use assembly language or C language to program microcontrollers. The characteristics of assembly language are compact code, low computer level requirements for beginners, and quick to get started, but the workload of program writing is large. The program examples on the webmaster's website are written in assembly language. The C language mentioned here is the C language dedicated to 51 microcontrollers. Its characteristics are high writing efficiency, but it requires high computer level for users. It is best to already know C language. There are also microcontroller C language tutorials on the Electronics Enthusiasts website. I think it is best for beginners of microcontrollers to understand some assembly language. Assembly language can directly control the resources of the microcontroller, such as specific microcontroller pins and memory addresses. It is also necessary to master these. Learning assembly language can lay a good foundation. Many reference books also say so. If you are a professional microcontroller developer, then C language is more efficient and more suitable for you.

  To learn assembly language by yourself, you must first learn to understand other people's assembly language programs. You can translate assembly language instructions into functional descriptive text that is easy for you to understand, and annotate them in detail at the end of the program, so that it is easy for you to refer to it later or for others to understand it. The webmaster has seen that some assembly programs written by others have very few comments, which is very unfavorable for beginners to learn and communicate with each other, so all programs written by the webmaster are annotated in great detail.

  You can refer to relevant books to learn assembly language. There are more than 100 instructions in assembly language, but there are only 20 to 30 commonly used instructions. You can first remember the commonly used assembly instructions. If you can’t remember them for the time being, you can print them on paper and slowly familiarize yourself with them. Then, you can test and verify other people’s assembly programs. Finally, you can modify the relevant parameters of the assembly program based on your own understanding and test it repeatedly. This is a shortcut to quickly master the microcontroller!

Keywords:MCU Reference address:Detailed explanation of the classic experimental examples of single-chip microcomputers (with source code) (I)

Previous article:Design of USB password keyboard based on Cortex-M0
Next article:Detailed explanation of the classic experimental examples of single-chip microcomputers (with source code) (Part 2)

Latest Analog Electronics Articles
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号