Comparison of three kinds of microcontrollers 51 series, PIC and AVR

Sajjad Hussain
Oct 17 · 7 min read

51 MCU advantages and disadvantages

The 51 series is the most widely used single-chip microcomputer. Due to the reasonable hardware structure of the product, the standard instruction system, and the “long” production history, it has the advantage of preconceived. Many well-known chip companies in the world have purchased the core patented technology of 51 chips, and expanded the performance on the basis of it, so that the chip has been further improved, forming a huge system, and it is still constantly being renovated. The world of single-chip microcomputers is alive and well.

Advantage one

One of the advantages of the 51 series is that it has a complete set of bitwise operating systems from internal hardware to software, called bit processors, or Boolean processors

Image for post
Image for post

Its processing object is not words or bytes but bits. It can not only process a certain bit of some special function registers on the chip, such as transfer, set, clear, test, etc., but also perform bit logic operations. Its functions are very complete and it is easy to use. Although other types of single-chip microcomputers also have bit processing functions, it is rare that they can perform bit logic operations.

The 51 series has also opened up a dual-function address area in the on-chip RAM area. It has sixteen bytes and the unit address is 20H~2FH. It can be used for byte processing and bit processing (when bit processing, combined 128 bits, the corresponding bit address is OOH~7FH), the use is extremely flexible. This function undoubtedly provides users with great convenience. Because a more complicated program will encounter many branches during the running process, a lot of flag bits need to be established. During the running process, the relevant flag bits need to be set, cleared or tested to determine the running direction of the program. To implement this process (including all the bit functions above), only one bit manipulation instruction is required.

Advantage two

Another advantage of the 51 series is the multiplication and division instructions, which also brings convenience to programming. In the division instruction of dividing eight bits by eight bits, the quotient is eight bits, and the precision is not enough, so it is not used much. However, the multiplication instruction of eight bits by eight bits has a product of sixteen bits, and the accuracy can still meet the requirements, so it is used more. When doing multiplication, only one instruction is required. Many 8-bit single-chip microcomputers do not have the multiplication function, so it is very inconvenient to program a subroutine call when doing multiplication.

Advantage three

The I/O pins of the 51 series are very simple to set up and use, but there is no output capability at high level, which can be described as pros and cons. Therefore, other series of single-chip microcomputers (such as PIC series, AVR series, etc.) have improved the I/O port, adding a direction register to determine the input or output, but the use has also become complicated.


The original 51 series also has many points worthy of improvement, such as slow running speed. When the crystal frequency is 12MHz, the machine cycle reaches 1μs, which obviously cannot meet the needs of modern high-speed operation.

PIC microcontroller advantages and disadvantages

PIC MCU CPU adopts RISC structure, with 33, 35, 58 instructions respectively, depending on the level of the MCU, which is a simplified instruction set. The 51 series has 111 instructions, and the AVR microcontroller has 118 instructions, both of which are more complex than the former.

Advantage one

Adopting Haryard dual bus structure, running speed is fast, instruction cycle is about 160–200ns, it can make program memory access and data memory access parallel processing. This kind of instruction pipeline structure completes two parts of work in one cycle, one is to execute the instruction, and the other is to fetch the next instruction from the program memory. In general, each instruction only needs one cycle (except for individual ones), which is also one of the reasons for efficient operation. In addition, it also has the characteristics of low operating voltage, low power consumption, and strong driving capability.

Image for post
Image for post

Advantage two

The I/O port of the PIC series single-chip microcomputer 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 problem that the 51 series I/O pin is both input and output when it is high.

When set to 1, it is in the input state, and no matter the pin is high or low, it is in a high-impedance state; when it is set to 0, it is in the output state, no matter what level the pin is, it is in a low-impedance state , It has considerable driving capability, the low-level suction current can reach 25mA, and the high-level output current can reach 20mA.

Compared with the 51 series, this is a great advantage, 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 functions.


The special registers of this series of single-chip microcomputers are not concentrated in a fixed address range (80~FFH) like the 51 series, but are scattered in four address ranges, namely bank 0 (Bank0:00–7FH), storage Bank 1 (Bank1: 80-FFH), Bank 2 (Bank2: 100–17FH), and Bank 3 (Bank3: 180–1FFH). Only 5 special registers PCL, STATUS, FSR, PCLATH, INTCON appear in 4 banks at the same time.

In the programming process, it is indispensable to deal with special registers, and you must repeatedly select the corresponding memory bank, that is, set or clear the 6th (RP1) and 5th (RPO) bits of the status register STATUS. This somewhat brings some trouble to programming.

For the above-mentioned single-chip microcomputer, its bit instruction operations are usually limited to the bank 0 interval (00~7FH). Basically, data transmission and logical operations must be carried out through the working register w (equivalent to the accumulator A of the 5l series), and the 51 series can also be directly transferred between the registers (such as: MOV30H, 20H; the register 20H The content is directly transferred to the register 30H), so the bottleneck of the PIC microcontroller is even more serious than that of the 51 series, which is very experienced in programming.

Advantages and disadvantages of AVR microcontroller

AVR MCU is characterized by high performance, high speed, and low power consumption. It cancels the machine cycle, takes the clock cycle as the instruction cycle, and implements pipeline operations. AVR microcontroller instructions are in units of words, and most instructions are single-cycle instructions. A single cycle can execute the function of this instruction and complete the reading of the next instruction at the same time.

There are a total of 32 general registers (RO-R31), and the first 16 registers (R0~R15) cannot directly deal with immediate data, so the generality has declined. In the 5l series, all its general registers (address 00–7FH) can directly deal with immediate data, which is obviously better than the former.

Advantage one

The AVR series does not have a structure similar to the accumulator A, it mainly realizes the function of A through the R16-R31 registers. In AVR, there is no data pointer DPTR like the 5l series, but it is completed by three 16-bit registers X (composed of R26, R27), Y (composed of R28\R29), and z (composed of R30, R31) The function of the data pointer (equivalent to three sets of DPTR), and it can also perform post-increment or first-decrement operations.

In the 51 series, all logic operations must be carried out in A; while AVR can be carried out between any two registers, eliminating the need to toss back and forth in A, which are stronger than the 51 series.

Advantage two

The special registers of AVR are concentrated in the address range of $00~$3F, and there is no need to select the memory bank first like PIC. It is more convenient to use than PIC. The address range of AVR’s on-chip RAM is $0060~$00DF (AT90S23131) and $0060~$025F (AT90S85l5, AT90S8535), they occupy the address of the data space, these on-chip RAM are only used to store data, usually not It has the function of general register. When the program is complicated, the general registers R0-R31 are not enough; and the 51 series of general registers have as many as 128 (4 times that of AVR), and there is no such feeling when programming.


The I/O pin of AVR is similar to PIC. It also has a direction register used to control input or output. In the output state, the high-level output current is about 10mA, and the low-level sink current is 20mA. Although not as good as PIC, but better than 51 series.

God Hardware

For hardware discussion

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store