What is an AVR microcontroller? What are the advantages of AVR microcontroller? Why choose AVR microcontroller?
AVR MCU is a new type of MCU developed by ATMEL. It has a series of advantages compared with 51 MCU and PIC MCU:
1: AVR runs fastest under the same system clock;
2: The Flsah, EEPROM, and SRAM inside the chip have a large capacity;
3: All models of Flash, EEPROM can be repeatedly programmed, all support online programming programming (ISP);
4: Multiple frequency internal RC oscillator, power-on automatic reset, watchdog, start delay, etc., zero peripheral circuits can also work;
5: Each IO port can output high and low levels in a push-driven manner, and the driving capability is strong;
6: Rich internal resources, generally integrated AD, DA analog and digital; PWM; SPI, USART, TWI, I2C communication port; rich interrupt source.
At present, the languages ​​supporting AVR microcontroller compilers mainly include assembly language, C language, BASIC language and so on. Among them, C compiler mainly includes CodeVisionAVR, AVRGCC, IAR, ICCAVR, etc. Because of its congenital advantages such as powerful function, flexible application, small code and fast running speed, C compiler has irreplaceable professional programming. Status.
The AVR MCU is an enhanced RISC (Reduced InstrucTIon Set CPU) RISC high-speed 8-bit MCU developed by ATMEL in 1997. AVR's single-chip microcomputer can be widely used in computer external equipment, industrial real-time control, instrumentation, communication equipment, household appliances and other fields.
The main features of AVR
High reliability, strong function, high speed, low power consumption and low price have always been an important indicator to measure the performance of single-chip microcomputers. It is also a necessary condition for the single-chip computer to occupy the market and survive.
The early MCUs were mainly due to low process and design level, high power consumption and poor anti-interference performance. Therefore, a conservative solution was adopted: the higher frequency division factor was used to divide the clock, which made the instruction cycle long and the execution speed slow. Future CMOS microcontrollers have adopted measures such as increasing the clock frequency and reducing the division factor, but this state has not been completely changed (51 and 51 compatible). Although some RISCs have been introduced here, they still follow the practice of clock division.
The introduction of AVR microcontroller completely breaks the old design pattern, abolishes the machine cycle, abandons the complicated instruction computer (CISC) and pursues the instruction completeness; adopts the reduced instruction set, uses the word as the instruction length unit, and the content-rich operands The opcode is arranged in one word (this is the case for most single-cycle instructions in the instruction set). The instruction fetch cycle is short, and the instruction can be prefetched to realize the pipeline operation, so the instruction can be executed at high speed. Of course, this speed increase is backed by high reliability.
The hardware structure of AVR microcontroller adopts the compromise strategy of 8-bit machine and 16-bit machine, that is, the local register storage (32 register files) and the single high-speed input/output scheme (ie, input capture register, output compare match register and corresponding Control logic). The instruction execution speed (1Mips/MHz) is improved, the bottleneck phenomenon is overcome, the function is enhanced, and the overhead of peripheral management is reduced, the hardware structure is relatively simplified, and the cost is reduced. Therefore, AVR MCU has achieved an optimal balance in terms of software/hardware overhead, speed, performance and cost, and is a cost-effective single-chip microcomputer.
AVR microcontroller embedded high-quality Flash program memory, easy to erase, support ISP and IAP, easy to debug, develop, produce and update products. Built-in long-life EEProm saves critical data for long periods of time and avoids loss of power. The large-capacity RAM on the chip not only satisfies the general use, but also supports the use of high-level language development system programs and expands the external RAM like the MCS-51 microcontroller.
The I/O lines of the AVR MCU all have configurable pull-up resistors, which can be individually set to input/output, settable (initial) high-impedance input, and strong drive capability (can eliminate power-driven devices). The I/O port resources are flexible, powerful, and fully utilized.
AVR microcontrollers have a variety of independent clock dividers for URAT, I2C, and SPI. Among them, the prescaler with up to 10 bits combined with the 8/16-bit timer can be used to set the timing of various grades by software setting the division factor. The AVR microcontroller uniquely uses a timer/counter (single) bidirectional count to form a triangular wave, and then cooperates with the output compare match register to generate a design method with variable duty cycle, variable frequency, and phase-variable square wave (ie, pulse width). Modulation output PWM)" is even more refreshing.
Enhanced high-speed synchronous/asynchronous serial port with hardware generated check code, hardware detection and check debugging, two-stage receive buffer, automatic adjustment of baud rate (received), masked data frames, etc. Reliability, convenient programming, more convenient to form a distributed network and realize complex applications of multi-machine communication system, serial port function greatly exceeds the serial port of MCS-51/96 single-chip microcomputer, plus AVR single-chip high-speed, short service time is short, so it can achieve high Baud rate communication.
500 Portable Power Station,Lifepo4 Portable Power Station,Economical Portable Solar Power Station,Portable Power Station For Camping 500W
Jiangsu Zhitai New Energy Technology Co.,Ltd , https://www.zhitainewenergy.com