Other Microcontrollers
The PIC currently dominates the 8-bit microcontroller market, but a comparison with other controllers is still useful, particularly as the alternatives are generally based on historically significant conventional architectures using complex instruction sets, which provide a useful contrast with the PIC reduced instruction set computing (RISC) architecture.
Intel® 8051 Microcontroller
The Intel PC architecture has dominated the desktop/laptop computer market for many years, and the first widely used general purpose microcontroller was based on this architecture. First introduced in 1980, the Intel 8051 was derived from the then standard PC microprocessor, the 8086. As can be seen in the block diagram (Figure 14.1), the original design had multiple parallel ports, timers and interrupts, and a serial port. The 8051 can be used as a conventional processor, as well as a microcontroller. It can access external memory using port 0 and port 2, which act as multiplexed data and address lines. Some of port 1 and port 3 pins also have a dual purpose, providing connections to the timers, serial port and interrupts. The program memory was erasable programmable read-only memory (EPROM), which had to be erased under ultraviolet light and reprogrammed out of circuit.
The 8051 had a conventional architecture, where the same data bus was used to transfer the program code and the internal data. This makes it inherently slower than the PIC Harvard architecture, which has a separate program and data paths operating concurrently. The 8051 also had a complex instruction set (CISC), which provided more options when programming, but reduced execution speed.
Atmel® AVR Microcontrollers
European manufacturer Atmel offers a range of CISC microcontrollers derived from the 8051 architecture and instruction set. The AT89 family are updated 8051 type MCUs. The AVR
range includes 8-bit ATtiny and ATmega devices, and 32-bit AT32 devices. The AT91SAM group are also 32-bit MCUs, but are based on the high-performance ARM architecture.
The internal architecture of a representative chip, the ATtiny20 MCU, is shown in Figure 14.2. The program execution section is similar to the PIC, in that it has a separate instruction bus (Harvard architecture). It also uses a two-stage pipeline, overlapping the fetch and execution cycles. It can therefore execute instructions in one clock cycle, at a maximum clock rate of 12 MHz. It has a similar range of features to the equivalent PIC, that is, an 8-bit and 16-bit timer, serial ports and eight multiplexed 10-bit analogue-to-digital converter (ADC) inputs.
Unlike the PIC, the AVR chip has 16 general purpose registers that contain the current data, compared with the single working register of the PIC. In addition, it has a separate random access memory (RAM) block for data storage, whereas the PIC has a single integrated RAM block containing special function registers (SFRs) and general purpose registers (GPRs). The timers and other SFRs are addressed explicitly in the instruction set rather than as RAM addresses. The stack is implemented as a selected set of RAM locations, making it more
flexible in operation but less well protected from corruption by incorrect code. The AVR also incorporates multiple interrupt vectors.
The instruction set is more extensive, comprising 54 instructions with multiple addressing modes. For example, there are several conditional branching instructions, and data movement requires different instructions for load (LD, LDI, LDS), store (ST, STI), move (MOV), input (IN) and output (OUT). This provides some advantages to the experienced programmer who can make best use of the available options, but is more complex to learn initially.
Other Microcontrollers
At the time of writing ST Microelectronics produces a range of microcontrollers with similar features to the PIC16, but with a complex instruction set and conventional architecture.
Freescale Semiconductor Inc. offers a range of microcontrollers based on the architecture and instruction set of the standard Motorola 68000 microprocessor. The current offering concentrates on high-end microcontrollers with 16- and 32-bit cores. Similarly, Texas Instruments Inc. and NXP Semiconductors NV (formerly a division of Philips) offer a power MCU range, including the ARM/CortexM3 32-bit MCUs running at 50 MHz.