Step 1: Use of Digital I/O
By using buttons to input signals and LEDs to display output levels, you can learn the digital I/O functions of pins. After pressing a button, a LED lights up. This is the function of combinational logic in digital circuits. Although it is very simple, you can learn general microcontroller programming ideas. For example, many registers must be set to initialize the pins so that the pins have digital input and output functions. Every time a function of the microcontroller is used, the register that controls the function must be set. This is the characteristic of microcontroller programming. Don't be afraid of trouble. All microcontrollers are like this.
Step 2: Use the timer
Once you learn how to use a timer, you can use a single-chip microcomputer to implement a sequential circuit. The function of a sequential circuit is powerful and has many applications in the control of industrial and household electrical equipment. For example, a single-chip microcomputer can be used to implement a corridor light switch with a button. After the button is pressed once, the light will automatically turn off after 3 minutes. When the button is pressed twice in a row, the light will always be on. When the button is pressed for more than 2 seconds, the light will turn off. Digital integrated circuits can implement sequential circuits, programmable logic devices (PLDs) can implement sequential circuits, and programmable controllers (PLCs) can also implement sequential circuits, but only single-chip microcomputers are the simplest to implement and have the lowest cost. The use of timers is very important, and logic plus time control is the basis for the use of single-chip microcomputers.
Step 3: Interrupt
The characteristic of a single-chip microcomputer is that a program is repeatedly executed. The execution of each instruction in the program requires a certain execution time. If the program does not execute a certain instruction, the action of the instruction will not occur, which will delay many fast-moving things, such as the falling edge when a button is pressed. In order to make the single-chip microcomputer respond to fast actions during the normal operation of the program, the interrupt function of the single-chip microcomputer must be used. This function is that after the fast action occurs, the single-chip microcomputer interrupts the normal operation of the program, processes the fast action, and returns to execute the normal program after the processing is completed. The difficulty in using the interrupt function is that it is necessary to accurately know when to allow the interrupt to occur (shield the interrupt) and when to allow the interrupt to occur (open the interrupt). Of course, multiple things can also be monitored. Figuratively speaking, the interrupt function enables the single-chip microcomputer to have the function of eating from the bowl and watching the pot. Learning the above three steps is equivalent to the martial arts of the Eighteen Dragon Subduing Palms. If you have learned three palms, you can barely protect yourself.
Step 4: RS232 communication with PC
The microcontroller has a USART interface, especially many models in the MSP430 series, which have two USART interfaces. The USART interface cannot be directly connected to the RS232 interface of the PC. The logic levels between them are different, and a MAX3232 chip is required for level conversion. The use of the USART interface is very important. Through this interface, information can be exchanged between the microcontroller and the PC. Although RS232 communication is not advanced, it is very important to learn the interface. To use the USART interface correctly, you need to learn the communication protocol, the RS232 interface programming of the PC, and so on. Just imagine that the data on the microcontroller experiment board is displayed on the PC monitor, and the keyboard signal of the PC can be displayed on the microcontroller experiment board. How interesting it will be!
Step 5: Learn A/D conversion
The MAP430 microcontroller has a multi-channel 12-bit A/D converter, which can be used to operate analog quantities, display and detect voltage, current and other signals. When learning, pay attention to concepts such as analog ground and digital ground, reference voltage, sampling time, conversion rate, conversion error, etc. A simple example of using the A/D conversion function is to design a voltmeter.
Step 6: Learn PCI, I2C interface and LCD interface
The use of these interfaces can make it easier for the microcontroller to connect to external devices, which is very important in expanding the functions of the microcontroller.
Step 7: Learn to compare, capture, and PWM functions
These functions enable the microcontroller to control the motor, detect the speed signal, and realize the control functions such as the motor speed regulator.
If you have learned all the above seven steps, you can design a general application system, which is equivalent to learning the ten moves of the Eighteen Dragon Subduing Palms and being able to attack.
Step 8: Learn the hardware and software design of USB interface, TCP/IP interface, and various industrial buses
It is very important to learn the hardware and software design of USB interface, TCP/IP interface, and various industrial buses, because this is the current development direction of product development.
So far, it is equivalent to learning 15 moves of the Eighteen Dragon Subduing Palms, but it is not yet the realm of being invincible. Even so, it is still considered a master of single-chip computers.
Previous article:How to get a higher baud rate with a 6M crystal
Next article:TV backlight 3D infrared signal transmission solution based on MSP430G2303
Recommended ReadingLatest update time:2024-11-16 20:30
- 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
- What do the numbers in the brackets mean? [3:0] and [11:4] What is 11~4?
- When I mentioned that inviting 8 people to search one by one was too much trouble, the administrator reduced the number of people that can be invited from 8 to 4. High, high, high
- Evaluation summary: Allwinner heterogeneous multi-core AI intelligent vision V853 development board
- Common basic settings of timer T0, T1
- [nRF52840 DK Review] Improve custom services - send data
- Problem of stm32cube_fw_f7_v1.4.1 not being able to download
- My eSports Sharing
- Application of high-precision current source in gyroscope testing
- Young people have no moral principles and do not consider production capacity in via impedance design
- Bike modification series: button