Avr microcontroller and stm32 difference, avr microcontroller selection skills

The development of single-chip microcomputers is quite rapid. Nowadays, various manufacturers are also experiencing speed, memory and functions. The competition is fierce. At the same time, a large number of manufacturers with representative single-chip microcomputers emerged: Atmel, TI, ST, MicroChip, ARM... STC microcontrollers are also remarkable. The most beginners must first understand the difference between them, master the avr microcontroller selection skills, in order to better design products.

One: avr microcontroller and stm32 difference - stm32 microcontroller

The stm32 series of single-chip microcomputers introduced by ST manufacturers, the industry's friends know that this is a series of high-performance single-chip microcontrollers, there should be no one, the function and its powerful. It is based on an ARM Cortex-M core specifically designed for embedded applications requiring high performance, low cost, low power, and first-class peripherals: 1μs dual 12-bit ADC, 4 Mbit/s UART, 18 Megabits per second SPI, etc., also has a good performance in terms of power consumption and integration. Of course, it is slightly inferior to the power consumption of MSP430, but this does not affect the degree of enthusiasm of engineers. Because of its simple structure and easy-to-use tools, it is well-known in the industry for its powerful functions... Its powerful features are mainly reflected in:

characteristic:

1. Core: ARM32-bit Cortex-M3CPU, maximum operating frequency 72MHz, 1.25DMIPS/MHz, single-cycle multiplication and hardware division

2. Memory: 32-512KB of flash memory integrated on-chip. 6-64KB SRAM memory

3. Clock, Reset, and Power Management: 2.0-3.6V power supply and I/O interface drive voltage. POR, PDR and programmable voltage detector (PVD). 4-16MHz crystal oscillator. Built-in factory-adjusted 8MHz RC oscillator circuit. Internal 40 kHz RC oscillator circuit. PLL for the CPU clock. 32kHz crystal with calibration for RTC

4. Debug mode: Serial Debug (SWD) and JTAG interface. Up to 112 fast I/O ports, up to 11 timers, up to 13 communication interfaces

Most used devices: stm32F103 series, stm32 L1 series, stm32W series

Two: avr single-chip and stm32 difference - avr microcontroller

Avr MCU is a relatively novel MCU introduced by Atmel Corporation. Its remarkable features are high performance, high speed and low power consumption. It cancels the machine cycle and executes the pipeline operation with the clock cycle as the instruction cycle. The avr microcontroller instruction is in word units, and most of the instructions are single-cycle instructions. The single cycle can perform the function of this instruction and complete the reading of the next instruction. Usually the clock frequency is 4 to 8 MHz, so the shortest instruction execution time is 250 to 125 ns. Avr MCU can become a relatively hot MCU recently, the main features:

Features:

1. The avr series does not have a structure similar to the accumulator A. It mainly implements the function of A through the R16 to R31 registers. In avr, there is no data pointer DPTR like 51 series, but three 16-bit registers of X (composed of R26, R27), Y (composed of R28, R29), and Z (consisting of R30, R31). The function of the data pointer (equivalent to three groups of DPTR), but also can be used for post-increment or first-decrease operation. In the 51 series, all logic operations must be performed in A; while avr can be used in any two. Between the registers, eliminating the need to toss back and forth in A, these are better than the 51 series

2. The special registers of avr are concentrated in the 00~3F address range. It is not necessary to perform the process of selecting a bank first like pic. It is more convenient to use than pic. The address range of avr's on-chip RAM is 0~00DF (AT90S2313) and 0060~025F (AT90S8515, AT90S8535). They occupy the address of the data space. These on-chip RAMs are only used to store data, usually not universal. The function of the register. When the program is complicated, the general-purpose registers R0 to R31 are not enough. The general-purpose registers of the 51 series are up to 128 (four times that of avr), and this is not the case when programming.

3. The avr I/O pin is similar to pic. It also has a direction register for controlling the input or output. In the output state, the high level output current is about 10 mA, and the low level sink current is 20 mA. This is not as good as pic, but it is better than the 51 series...

Disadvantages:

1. There is no bit operation, it is to control and judge the relevant register bits in bytes.

2. C language and 51 C language are very different in writing, which makes friends who are learning 51 MCU very unaccustomed

3. There are a total of 32 general-purpose registers (R0 to R31), and the first 16 registers (R0 to R15) cannot directly interact with the immediate data, so the versatility is degraded. In the 51 series, all of its general-purpose registers (addresses 00 to 7FH) can directly deal with immediate data, which is obviously better than the former.

Most used devices: ATUC64L3U, ATxmega64A1U, AT90S8515

Each MCU has its own advantages and disadvantages. Compared with other 8-bit MCUs, the biggest features of avr 8-bit MCUs are:

● Harvard architecture with high-speed operation processing capability of 1MIPS / MHz;

● Super-function reduced instruction set (RISC) with 32 general-purpose working registers, which overcomes the bottleneck caused by the 8051 MCU processing with a single ACC;

● Fast access register group and single-cycle instruction system, which greatly optimizes the size and execution efficiency of the target code. Some models have very large FLASH, which is especially suitable for development using high-level languages;

● When output is the same as pic's HI/LOW, it can output 40mA (single output). It can be set as three-state high-impedance input or pull-up resistor input for input, with 10mA-20mA sinking current capability;

● On-chip integration of multiple frequency RC oscillator, power-on automatic reset, watchdog, start delay and other functions, the peripheral circuit is simpler, the system is more stable and reliable;

● Most avr chips are rich in resources: E2PROM, PWM, RTC, SPI, UART, TWI, ISP, AD, Analog Comparator, WDT, etc.

● Most avr have IAP function in addition to ISP function, which is convenient for upgrading or destroying applications.

● Cost-effective.

Three: avr microcontroller and stm32 difference - avr microcontroller typical application circuit diagram

Avr microcontroller and stm32 difference, avr microcontroller selection skills

The most commonly used avr microcontrollers are 5V and 3.3V. This line switches the two voltages with a switch and is indicated by a dichroic diode (green at 5V and red at 3.3V). The input voltage of JP3 is 7.5v-9v.

Avr microcontroller and stm32 difference, avr microcontroller selection skills

Serial circuit design

The serial port uses a max232 chip.

Use the jumper JMP2—1. When not using the serial port, please disconnect it to prevent the serial port circuit from interfering with the IO port.

A resistor R2 and a light-emitting diode LED1 are connected between VCC and R2out. In particular, only when the diode flashes, the serial port is working, and when the diode is directly connected, the LED may also be bright.

Avr microcontroller and stm32 difference, avr microcontroller selection skills

AD conversion filter circuit

To reduce power interference from AD conversion, the Mega16 chip has an independent AD power supply. The official documentation recommends a 10uH inductor (L1) on the VCC string, followed by a 0.1uF capacitor to ground (C3).

The Mega16 has a standard reference voltage of 2.56V. It is also possible to input a reference voltage from the outside, such as the TL431 ($0.0625) reference source. However, it is sufficient for a general application to use an internal reference voltage. It is customary to connect a 0.1uF capacitor to ground (C4) on the AREF pin.

Avr microcontroller and stm32 difference, avr microcontroller selection skills

Crystal oscillator circuit

The Mega16 has an internal RC oscillator circuit that can generate oscillation frequencies of 1M, 2M, 4M, and 8M. However, the built-in is RC oscillator after all. In some high-demand situations, such as to communicate with RS232 ($780.5000), a more accurate baud rate is required. It is recommended to use an external crystal oscillator circuit.

In the early 90S series, a capacitor of about 22pF was required at both ends of the crystal. When the Mega series is actually used, these two small capacitors can work normally without being connected. However, in order to standardize the line, we still recommend to pick it up.

Four: avr microcontroller and stm32 difference - pic microcontroller introduction

The pic microcontroller series is a product of Microship, which is divided into three levels, namely basic level, intermediate level and advanced level. It is one of the fastest growing single-chip microcomputers. The CPU adopts RISC structure, 33 and 35 respectively. The 58 instructions are a reduced instruction set and adopt Harvard dual bus structure. The running speed is fast. It can make program memory access and data memory access parallel processing. This instruction pipeline structure completes two parts in one cycle. One is to execute the instruction, the other is to take the next instruction from the program memory, so that it seems that each instruction only needs one cycle, which is one of the reasons for high-efficiency operation. In addition, the reason why pic microcontroller becomes a very hot single-chip microcomputer Nothing more than the following characteristics:

Characteristics

1. It has the characteristics of low working voltage, low power consumption and strong driving ability. The I/O port of the pic series MCU is bidirectional, and its output circuit is a CMOS complementary push-pull output circuit. The I/O pin adds a direction register for setting the input or output state, which solves the state of the input and output when the 51 series I/O pin is high.

2. When set to 1, it is the input state, and regardless of whether the pin is high or low, it is in a high-impedance state; when it is set to 0, it is an output state, regardless of the level of the pin, it is low. The resistance state has a considerable driving capability, the low-level sink current reaches 25mA, and the high-level output current can reach 20mA. This is a big advantage over the 51 series.

3. It can directly drive the digital tube display and the external circuit is simple. Its A/D is 10 bits, which can meet the accuracy requirements. With online debugging and programming (ISP) capabilities.

Inadequacies

The dedicated registers (SFRs) are not concentrated in a fixed address range (80 to FFH) like the 51 series, but are scattered in four address ranges. Only five special registers PCL, STATUS, FSR, PCLATH, and INTCON appear simultaneously in four banks, but in the programming process, it is necessary to deal with the special register repeatedly, and the corresponding bank must be repeatedly selected, that is, the status register STATUS Bit 6 (RP1) and 5 (RP0) are set or cleared. The data transfer and logic operations are basically carried out through the working register W (equivalent to the 51 series accumulator A), and the 51 series can also be directly transferred between the registers, so the bottleneck phenomenon of the pic microcontroller is more than the 51 series. It is still serious, and this friend in programming should have a deep understanding.

Most used devices pic16F873, pic16F877

Five: avr single-chip and stm32 difference - stm32 and pic, avr single-chip comparison analysis

The following table compares the three series of single-chip microcomputers avr, pic and STM32. The objects are all selected in the 64-pin package of each series. Mega128 and pic18F6680 are the high-end chips in the series. Through the table, it can be seen that STM32 has a very big advantage in terms of processing speed, peripheral equipment and price. The only shortcoming is that stm32 has not integrated internal EEPROM yet, but can use Flash IAP function instead of reliability. It should be higher.

In terms of programming in C, the architecture of pic is the least suitable, and the compiled software cannot be compared with GCC, keilc.

In terms of anti-jamming, it is mainly related to the level of developers, and it must be said that which kind of single-chip microcomputer has strong anti-interference and which is weak. In fact, the standards are different and the results are different. It is widely believed that pic's anti-interference is very strong, but that is the C series, and now the F series integrated with internal Flash is much worse, especially the early batches. The avr series of MCUs are generally considered to be relatively poor in anti-interference performance. Someone has listed a table, using the Japanese test method, the result is that avr is at the end, in fact, there is no problem for the general application. STM32 is produced by the famous ST company. The company has been working on the development and production of motor control chips, and it has done a good job. I think there should be no problem with anti-interference, at least not worse than the first two.

Avr microcontroller and stm32 difference, avr microcontroller selection skills

Avr microcontroller and stm32 difference, avr microcontroller selection skills

Six: avr microcontroller and stm32 difference - avr microcontroller selection skills

All kinds of single-chip computers have their own advantages and disadvantages, and should be selected according to needs. The principle of selecting a microcontroller is as follows:

1. Basic parameters of the microcontroller such as speed, program memory capacity, number of I/O pins

2. Enhanced functions of the MCU, such as watchdog, dual pointer, dual serial port, RTC (real time clock), EEPROM, extended RAM, CAN interface, I2C interface, SPI interface, USB interface.

3. Flash and OTP (one-time programmable), preferably Flash.

4. Package IP (dual in-line), PLCC (PLCC has corresponding socket) or patch. The DIP package may be a bit more convenient when doing experiments.

5. Operating temperature range, industrial grade or commercial machine. If you design outdoor products, you must use industrial grade.

6. Power consumption, such as designing a parallel port dongle, the signal line can only provide a few mA for power, and pic is because of low power consumption. Later, the MSP430 is also good.

7. Operating voltage range. For example, designing a TV remote control, powered by 2 dry batteries, should work at least in the range of 1.8-3.6V.

8. The supply channels are smooth. Can apply for samples, small quantities are available in stock. It's best to go to the standard 51, and you can buy it at the counter.

9. The price is low.

10. There are service providers, such as Zhou Ligong's push for Philips and Ssangyong's push avr, which provide a lot of useful technical support. At least there is a place to buy the programmer.

11. The price of the burner is low. If it is ICP (programming the microcontroller on the programmer), can you use the existing burner? If it is a surface mount package, it is very expensive to buy a adapter. At least one Two hundreds. Can ISP (in system programming, that is, the chip is first soldered to the board and then programmed through the reserved ISP interface), the general ISP programmer is relatively cheap about one or two hundred yuan or even tens of dollars.

12. The emulator is cheap. For FLASH type microcontrollers, the emulator is not required. However, for OTP (One Time Programmable) type microcontrollers, the emulator must be purchased or rented.

13. The MCU assembly language is familiar to you and supports the C language. The programming environment is as easy to use as keil and is still free. 14. The website is fast and informative. Includes chip manuals, application guides, design options, and sample programs. It is best to have Chinese, like Atmel.

15. The security performance is good. Check the blacklist on the professional decryption website, and then send a mail to consult the decryption price.

16. Good anti-interference performance. I once changed the XXC52 to S52 and found that the anti-interference performance was degraded, so I had to change it back.

17. Comprehensive considerations with other peripheral chips.

KNL1-100 Residual Current Circuit Breaker

KNL1-100 Moulded Case Circuit Breaker is MCCB , How to select good Molded Case Circuit Breaker suppliers? Korlen electric is your first choice. All moulded Case Circuit Breakers pass the CE.CB.SEMKO.SIRIM etc. Certificates.

Moulded Case Circuit Breaker /MCCB can be used to distribute electric power and protect power equipment against overload and short-current, and can change the circuit and start motor infrequently. The application of Moulded Case Circuit Breaker /MCCB is industrial.
Korlen electric also provide Miniature Circuit Breaker /MCB. Residual Current Circuit Breaker /RCCB. RCBO. Led light and so on .

KNL1-100 Molded Case Circuit Breaker,KNL1-100 Small Size Molded Case Circuit Breaker,KNL1-100 Electrical Molded Case Circuit Breaker,KNL1-100 Automatic Molded Case Circuit Breaker

Wenzhou Korlen Electric Appliances Co., Ltd. , https://www.zjmotorstarter.com