Summary of MCU learning methods

Publisher:chwwdchLatest update time:2012-06-19 Source: 21ic Keywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Why should we acquire this knowledge?

In fact, electronic engineers put a bunch of devices together, inject ideas (programs), complete the functions that these devices could not complete when separated, and make a finished product. The higher the skills required, the more complex the functions, the lower the cost, and the greater the demand for the corresponding things in the market, the more successful they are. This is the value of electronic engineers themselves. The difference between the cost and the product sold is the pursuit of the company. As the boss of the company, you look for such applications in the market; for electronic engineers, it is to complete the needs or applications proposed by the boss in the shortest time according to certain conceptual principles (lowest cost, highest reliability, smallest circuit board, most powerful function, etc.). The shortest time is directly related to the proficiency, work efficiency and working hours of electronic engineers. This is the value of electronic engineers.

Abstracting electronic products into a hardware model consists of the following components:

1) Input

2) Processing core

3) Output

The input possibilities are basically:

1) Keyboard

2) Serial interface (RS232/485/can bus/Ethernet/USB)

3) Switching quantity (TTL, current loop, dry contact)

4) Analog (4~20ma, 0~10ma, 0~5V (balanced and unbalanced signals))

The output basically consists of:

1) Serial interface (RS232/485/can bus/Ethernet/USB)

2) Switching quantity (TTL, current loop, dry contact, power drive)

3) Analog (4~20ma, 0~10ma, 0~5V (balanced and unbalanced signals))

4) LED display: LED, eight-character

5) LCD display

6) Buzzer

The main processing cores are:

1) 8-bit microcontrollers, mainly 51 series

2) 32-bit ARM microcontrollers, mainly atmel and Samsung series

It seems that the 51 series of MCUs can only do some simple applications. To put it bluntly, this chip can only do a single thing. If it does too many things, it is better to use ARM to do it. You can also add an operating system to the ARM, and the program will be both reliable and easy to write.

Recently, Samsung's ARM has been popular. It is cheap, has Ethernet and USB interfaces, and Zhou Ligong's development system is also cheap. As a product for learning ARM, it should be the best; as an industrial-grade control, whether it is suitable or not, there are different opinions and disputes among netizens. Our company uses the atmel ARM91 series to develop an outdoor product. It is used outdoors in Beijing without any ventilation and heating measures. From May last year to now, it has been running well. There is already a successful application case.

But for beginners, they should start with 51. On the one hand, 51 is still an entry-level chip, so it is a good start for beginners to practice and go through the above concepts. Many special microcontrollers also add some I/O and A/D, D/A based on the core of 51, which also lays the foundation for learning higher-level microcontrollers and ARM in the future. Besides, which boss would put ARM-level development in the hands of a novice who has not even learned 51?

It is not necessary to do complex parallel expansion on 51. For example, to expand I/O ports and A/D, D/A, etc., you can directly buy a microcontroller with A/D, D/A; or directly use ARM, which has many I/O ports. You can use chips with I2C interface to expand I/O ports and A/D, D/A, and SPI interface to expand LED display, such as: MAX7219 and other chips.

Some older books on the market have some examples of parallel expansion, such as RAM, EPROM, A/D, D/A, etc. I don't think it's necessary to read them. Just know that these things existed in history.

This knowledge is an element that all products have. So you have to learn it and then apply it in specific situations. [page]

In fact, the core peripheral circuit of 51 single-chip microcomputer is very simple, a single-chip microcomputer + a watchdog + a crystal oscillator + 2 magnetic capacitors;

1. MCU: Atmel's 89C51 series, Winbond's 78E52 series, and Philips' series are all similar; some now have ISP (online download), which is more convenient;

2. Watchdog: There are many types. I often use max691/ca1161 and DS1832, etc. It depends on personal habits, chip operating voltage, packaging, etc. Max series and DS series, as well as IMP company, have many types, and generally only the most basic functions are needed; I used max691 originally, but max691 is more expensive because it has a battery switching function. Later, when I designed a new circuit board, I used ca1161.

A long time ago, in circuit design, some people may still use the power-on reset circuit which uses a resistor and a capacitor. However, such reset circuit is unreliable. Why is it unreliable? You can find articles on the Internet that specifically discuss reset circuits. More importantly, the 51 series of microcontrollers are more susceptible to interference. Without a watchdog circuit, it will not work. When the program runs away, it cannot come back and will die there.

The common practice is to buy a dedicated watchdog circuit to complete the functions of the reset circuit and the watchdog circuit.

The anti-interference ability of single-chip microcomputers is different. If your product works in an environment with relatively large interference, you can try to choose a single-chip microcomputer of a different brand; I used to work in an optoelectronics institute, working on the control part of a YAG laser therapy machine. When the power supply of the pulse laser machine discharges, the energy is very large. After taking all the conceivable measures such as optoelectronic isolation, it still didn't work; later, I chose Intel's 8031, and it worked. In a low voice: the anti-interference performance of Philips' single-chip microcomputer at that time was the worst, which may be related to the fact that Philips is mainly used in the civilian field.

The input and output lines of the microcontroller are the most likely to introduce interference; in the case of severe interference, all lines need to be optically isolated.

3. Crystal oscillator: Generally, 11.0592M is used, because it can accurately obtain 9600 baud rate and 19200 baud rate; 36.864M can also be used, this frequency is 20 times of 1.8432M, I have seen it used on other people's circuit boards, but I have not used it. These two crystal oscillators are easy to buy, and the price is the same as 12M. The book says that the 12M crystal oscillator can also obtain a baud rate of 9600, but when it is actually used, it will make mistakes every once in a while, as if the error is accumulated, which is quite strange.

Even if your microcontroller system does not use the RS232 interface, you can still make one and keep it for testing or for future use, there is no harm, unless your microcontroller system does not have enough lines.

4. Magnetic sheet capacitor: 22pf~30pf. You can find out what capacity of magnetic sheet capacitor corresponds to what crystal frequency in some books. However, I just use it casually. Anyway, there is no problem under 11.0592M. If you use a higher frequency, it is better to look for some information.

If your MCU system does not work, check the following steps:

1. Check the reset output of the watchdog. If possible, add an LED to the circuit board and pull it down, so it looks more convenient; if the watchdog reset signal is there, pull it down;

2. Check the MCU to see if there is any problem with the pins. Generally, if the programmer can write the program, it means the MCU is good. It is best to have a verified MCU on hand with a simple program inside. For example, a square wave with a duty cycle of 1 second is output on a certain line, which can be measured with a multimeter.

One more sentence: When designing a product, you should add different colored LED indicators to key places such as power supply, serial port, watchdog output and input, I/O port, etc. to facilitate debugging; for products with large batches, some LEDs can be removed, on the one hand to reduce costs, on the other hand to keep the process confidential;

3. Check the magnetic chip capacitors again. Some ceramic chip capacitors are of poor quality, so just replace them. By the way, it is best to use a tin-absorbing tape to absorb the tin in the pads before removing the components. This will not damage the vias in the pads. When soldering the new ceramic chip capacitors, use a multimeter to measure whether they are good before soldering.

4. Finally, you have no choice but to replace the crystal oscillator; remember to buy a good crystal oscillator, some brands have better quality.

5. When testing according to the above steps, remove irrelevant peripheral chips; because some peripheral device failures may cause the MCU minimum system to not work.

Keywords:MCU Reference address:Summary of MCU learning methods

Previous article:Some Experiences in Making Single Chip Microcomputer
Next article:A Brief Discussion on the Application of Single Chip Microcomputer

Recommended ReadingLatest update time:2024-11-16 20:29

Design of ceramic detection system based on AVR microcontroller and Kingview
Abstract: Aiming at the low automation level, low detection accuracy, narrow detection range and poor visualization of domestic ceramic performance detectors, a ceramic detection real-time control system based on AVR ATmega128 single-chip microcomputer and configuration software of Beijing Yakong Company was designed
[Microcontroller]
Design of ceramic detection system based on AVR microcontroller and Kingview
C51 MCU serial communication points
Today, when I was using the C51 microcontroller to send data to the PC, I encountered a small problem: if I use a button to trigger the microcontroller to send 5 data to the PC, when the microcontroller is reset, the first data sent is always only one data, not 5, and it is normal again after the second time. The reaso
[Microcontroller]
Design of high-precision inclination angle measurement system based on single chip microcomputer
High-precision inclination measurement is required in engineering applications such as geological and petroleum exploration, equipment installation, road and bridge construction, as well as in the automatic horizontal adjustment of systems such as robot control, tank and ship artillery platform control, and aircraft at
[Microcontroller]
Design of high-precision inclination angle measurement system based on single chip microcomputer
Issues that must be noted when using PIC microcontroller port level change interrupts
To clear the PORTB status change interrupt flag, you must: 1) read the PORTB port once to eliminate the hardware conditions that generate the interrupt flag; 2) clear the RBIF bit Reference assembly instruction movf PORTB,w bcf INTCON,RBIF // Let PIC prepare for XOR.  The B port level change interrupt m
[Microcontroller]
Design of intelligent car based on 51 single chip microcomputer
O Introduction On the basis of the existing toy electric car, a photoelectric detector is added to realize the real-time measurement of the speed, position and running status of the electric car, and the measured data is transmitted to the single-chip microcomputer for processing, and then the single-chip microc
[Microcontroller]
Design of intelligent car based on 51 single chip microcomputer
51 MCU special function register SFR
All special function registers: Special register 1, ACC (A): Accumulator When performing calculations, most of the data in the ALU (arithmetic logic unit, an important part of the arithmetic unit) comes from the accumulator A, and the results of the calculations are usually sent back to the accumulator A. Special
[Microcontroller]
51 MCU special function register SFR
Design of infrared pump based on SPCE061A single chip microcomputer
O Introduction Infrared pumps are usually used to complete the function of "extending your hand to get water out, retracting your hand to stop the water flow". Generally, they can provide manual and automatic pumping modes, and have low voltage detection alarm and voice prompts after use. When the infrared pump
[Microcontroller]
Design of infrared pump based on SPCE061A single chip microcomputer
Energy-saving lighting control system based on single chip microcomputer
introduction At present, my country's power industry is developing rapidly, but the situation of insufficient power supply and low power efficiency is still serious and will continue to exist for a considerable period of time in the future. Promoting lighting energy-saving technology and saving electricity is one of
[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号