Current location - Education and Training Encyclopedia - Graduation thesis - How to learn msp430 single chip microcomputer?
How to learn msp430 single chip microcomputer?
How to learn MSP430 single chip microcomputer

Learning is the process of meeting challenges and solving difficulties. Without challenges, there is no fun in life.

Taking MSP430 series single chip microcomputer as an example, the process of learning single chip microcomputer is explained.

(1) Get information

Buy related books and get information from the websites of Hangzhou Lierda Company and TI. For example, we can find the specifications of FET, MSP430 F 1xx series, F4xx series and the information of specific single chip microcomputer, and we can find a large number of practical reference circuits such as the circuit diagram of emulator FET, the circuit diagram of experimental board and chip packaging knowledge. Of course, some materials are in English, so it is a challenge to understand English materials. It is necessary to study CET-4 and CET-6. English is difficult to learn, but reading materials is easy. As long as you make up your mind and read a material, you can understand all the relevant materials.

(2) Buy an emulator FET and an experimental circuit board.

If the economic conditions are good, you can buy it directly.

(3) Self-made simulation FET and experimental circuit board.

Self-made emulator FET, first look for FET circuit diagram on the Internet, and then draw circuit diagram and circuit board diagram with circuit board drawing software, which is another challenge. FET circuit is very simple, but it still needs some efforts to do. Find a book about it, and then practice drawing the schematic diagram. After drawing the schematic diagram, learn to understand the packaging of components, and then buy components. At this time, you can draw the circuit board diagram. Once finished, submit the PCB file to the circuit board manufacturing company. 10 days later, you can get the circuit board, solder components and cables, and the experimental circuit board can be used after it is completed.

Self-made experimental circuit board needs to understand the internal working principle and packaging of single chip microcomputer chip, and know the function of each pin. You also need the knowledge of digital tubes, buttons, row resistors, three-terminal regulators, diodes, radiators, electrolytic capacitors, ordinary capacitors, resistors, toggle switches and other components. For beginners, only three digital tubes, eight buttons and eight light-emitting diodes are needed to make a simple experimental board. The self-made experimental circuit board is the same as the self-made field effect transistor. Draw the circuit diagram first, then buy components, and then draw the circuit board. Because MSP430 series chips are flat package, it is difficult to solder, which seems to be a challenge, but it is actually very simple. The method is as follows: first, apply rosin water on the pad. When the rosin water is still wet, put the chip on the pad, pay attention to the position of the first pin of the chip, and align the pin with the pad. Contact a clean soldering iron (without any solder) with the pin. As long as the pin is hot, the solder on the pad will automatically. When the circuit board is soldered, the parameters of each component should be checked, and all components that can be measured by multimeter should be measured.

(4) Obtain IAR software from the Internet.

Download IAR software from LIDAR or TI's website and install it on the computer.

(5) Debugging the FET and the experimental board.

Connect one end of FET to the parallel port of PC and the other end to the JTAG interface of the experimental board. After power-on, check whether the FET chip and MCU chip on the experimental board are hot (manually). After the PC works normally, run IAR software, find an example of C language or assembly language, and download it to the single chip microcomputer after successful compilation. If you can download it, it means everything goes well. Otherwise, we need to study it carefully. Generally speaking, as long as the circuit on the circuit board is correct and the component parameters are accurate, there is no fault.

(6) Step by step learning single chip microcomputer.

Learning to use single-chip microcomputer is to understand the hardware structure of single-chip microcomputer, learn the initialization settings of various functions in assembly or C language, and realize the programming of various functions.

Step 1: Use digital I/O.

You can learn the digital I/O function of the pin by using the button input signal and the LED display output level. When a button is pressed, an LED lights up, which is the function of combinational logic in digital circuits. Although it is very simple, you can learn the general single-chip programming ideas. For example, many registers must be set to initialize the pins so that the pins can have digital input, output and output functions. Every time you use a function of a single chip microcomputer, you must set a register to control the function. This is the characteristic of MCU programming. Don't be afraid of trouble. All single-chip computers are like this.

Step 2: Use of Timer

Learn to use the timer, you can use the single chip microcomputer to realize the sequential circuit. Sequential circuits are powerful and have many applications in the control of industrial and household appliances. For example, you can use a single chip microcomputer to realize a button corridor light switch. After pressing the button once, the light will go out automatically after 3 minutes. When the button is pressed twice continuously, the light will always be on and off. When the button is pressed for more than 2 seconds, the light will go out. Digital integrated circuit can realize sequential circuit, programmable logic device (PLD) can realize sequential circuit, and programmable controller (PLC) can also realize sequential circuit, but only single chip microcomputer can realize the simplest and lowest cost.

The use of timer is very important, and logic plus time control is the basis of the use of single chip microcomputer.

Step 3: Interrupt

The characteristic of single chip microcomputer is to repeatedly execute a program, and the execution of each instruction in the program takes a certain execution time. If the program does not execute the instruction, the action of the instruction will not happen, which will delay many quick things, such as the falling edge when the button is pressed. In order to make the single chip microcomputer respond to the quick action when the program is running normally, it is necessary to use the interrupt function of the single chip microcomputer, that is, after the quick action occurs, the single chip microcomputer interrupts the normal operation of the program, handles the quick action, and returns to execute the normal program after processing. The difficulty in using the interrupt function lies in knowing exactly when interrupts are not allowed (shielding interrupts), when interrupts are allowed (opening interrupts), which registers need to be set to make some interrupts work, what the program should do when interrupts start, what the program should do after interrupts are completed, and so on.

After learning to interrupt, you can make a more complicated program. Such a program can do one thing and also monitor one thing. Once the monitored thing happens, you can interrupt what you are doing and deal with the monitored thing. Of course, you can also monitor many things. For example, the interrupt function gives the single chip microcomputer the function of eating a bowl and watching a pot.

Learn the above three steps, it is equivalent to eighteen palms to subdue the dragon, know three palms, and barely protect yourself.

Step 4: RS232 communicates with PC.

Single chip microcomputer has USART interface, especially many models of MSP430 series have two USART interfaces. USART interface can't be directly connected with RS232 interface of PC, and their logic levels are different, so a MAX3232 chip is needed for level conversion.

The use of USART interface is very important. Through this interface, information can be exchanged between single chip microcomputer and PC. Although RS232 communication is not advanced, it is very important for learning interface. To use USART interface correctly, we need to learn communication protocol, RS232 interface programming of PC and so on. Imagine that the data on the experimental board of single chip microcomputer is displayed on the monitor of PC, and the keyboard signal of PC can be displayed on the experimental board of single chip microcomputer. What an interesting thing it will be!

Step 5: Learn A/D conversion.

MAP430 single chip microcomputer has multiple 12-bit A/D converters, through which the single chip microcomputer can operate analog signals, display and detect signals such as voltage and current. Pay attention to the concepts of analog ground and digital ground, reference voltage, sampling time, conversion rate, conversion error and so on.

A simple example of using the analog-to-digital conversion function is to design a voltmeter.

Step 6: Learn PCI, I2C interface and LCD interface.

Using these interfaces can make it easier for the single chip microcomputer to connect with external devices, which is very important to expand the functions of the single chip microcomputer.

Step 7: Learn the functions of comparison, capture and PWM.

These functions can make the single chip microcomputer control the motor, detect the speed signal and realize the control function of the motor governor.

Learn the above seven steps, you can design a general application system, which is equivalent to learning ten strokes and eighteen palms, and you can 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 development direction of current product development.

So far, it's equivalent to learning 15 and recruiting eighteen dragons, but it's better to beat all the invincible hands in the world. Even so, it is a single piece of prawn. By the way, the technical support of MSP430 single chip microcomputer is very good, and the responsible engineer prawn will come forward at a critical time to get you out of danger.

Reach the ideal state

It is difficult to reach the ideal state. In the era of knowledge explosion, it is difficult to keep up with the development of science and technology even if you study every day. What's more, you have to work hard every day to find a job, improve your professional title, write a thesis, engage in scientific research funds, political study, buy a house and a car, and eat rice, oil, salt, vinegar and tea. So, do you still need to study? The answer is yes, people live for interest, and only by loving SCM can they learn SCM, not for any purpose, but for the fun of learning. Of course, if interest can also make money, it will kill two birds with one stone.

Learning to use single chip microcomputer is actually learning to use tools. At best, he is a craftsman who pours pots and shovels bowls. If we want to go further, we need to work hard on signal recognition, control theory, digital signal processing theory and communication theory. Only in this way can we develop high-level and high-value-added products with intellectual property rights, and reach the highest level of using the Eighteen Dragons skillfully and playing invincible hands all over the world.

Single-chip microcomputer is the basis for the development of advanced hardware products such as DSP and embedded operating system. If you want to further develop, you must learn the development of single chip microcomputer.

If we study the development of CPLD, FPGA and hardware description language on the basis of single chip microcomputer, we can get a share in the development of high-speed products.