SMALL 8051
Context
You are developing a microcontroller-based embedded application and have some flexibility in the choice of hardware platform to be used.
Problem
Should you base your application on a Small 8051-family microcontroller?
Background
The desktop microprocessor market is characterized by constant demands for increased power. As a result, processors become obsolete after two or three years in production. By contrast, the 8051 architecture is more than 20 years old, yet the family is growing in both size and popularity.
This only makes sense because, as we saw in Chapter 1, the driving forces behind the embedded market are rather different from those of the desktop. In the embedded market, the trend is to exploit the flexibility of low-cost microcontrollers in an ever wider range of applications: indeed, as prices fall, these devices are finding their way into applications that would have involved a small number of discrete components (transistors, diodes, resistors, capacitors) a few years ago, but which are now imple- mented with microcontrollers.
To emphasize the very different nature of the embedded market, some of the more recent 8051 devices – far from being more powerful and having more features than the original – generally have fewer features.
Most immediately obvious is the fact that these Small 8051 devices typically have 20 or 24 pins and only some 15 I/O pins. In addition to their small physical size, the other common feature linking the Small 8051s is that they do not support external memory. For example, in the case of the popular AT89C1051, AT89C2051 and AT89C4051, Port 0 and Port 21 from the original device are omitted entirely (along with the ALE and PSEN pins, and some pins on Port 3), allowing the number of exter- nal pins to be reduced, in these cases to 20 pins. Similar changes are made in the Philips 87LPC764 and Philips 80c751 devices (see Figure 3.4).
Performance issues
Most Small 8051s provide a CPU performance of 1–2 MIPS (see ST ANDARD 8051
[page 30]).
Memory issues
A key feature of the Small 8051s is that they do not support a standard external data and address bus. As a result, the memory map of a typical Small 8051 looks like that shown in Figure 3.5.
Availability of on-chip hardware components
The on-chip hardware components on Small 8051s vary greatly between devices. The popular Atmel range has few on-chip hardware components, while the Philips devices tend to have a very wide range of features, including ADCs and pulse width modulator (PWM)2 units. For example, the Philips 87LPC768 is a low-cost, 20-pin, 8051-based microcontroller with 4 kB OTP ROM memory, an 8-bit ADC and a PWM unit.
[Note: that the 89C2051 and 89C4051 are similar, but have more RAM and 2 kbytes or 4 kbytes, respectively, of flash memory.]
Where external components must be added, either consider using a Standard 8051 as a replacement microcontroller. Alternatively, consider using a serial bus (e.g. I2C: see Chapter 23) to connect the external devices.
Power consumption
A Standard 8051 (typically) has a narrow operating voltage range: around 4.5V to 5.5V. One important feature of the Small 8051 devices is that they have a very wide operating voltage range: typically around 3V to around 7V. This wide operating volt- age range makes it very easy to create low-cost, battery-powered applications.
In addition, like most Standard 8051s, the Small 8051s have three operating modes: normal, idle and power down. Typical current requirements for the various modes are shown in Table 3.2. Note also that the power supply is assumed to be 5V.
Hardware resource implications
The Small 8051 provides the following hardware resources:
● A CPU performance of between 1 MIPS and 3 MIPS (approximately).
● Available internal memory (typical) of up to 4 kbytes for code and 256 bytes for data. No support for external memory.
● Usually one, full duplex (‘RS-232’) serial port.
● Two or three hardware timers.
● Current consumption of around 10 mA in normal operating mode, 5 mA in idle mode, and 10 µA in power-down mode.
Additional features are also available on some devices.
Reliability and safety implications
There are no available figures to suggest that the Small 8051 is any more (or less) reliable than any other microcontroller family.
Portability
Please note that the Small 8051s have a core architecture based on the 8051 family. However, as is apparent from Figure 3.4, the various Small 8051s are in no sense pin compatible and vary greatly in features and functionality. As a result, code written for a particular Small 8051 is less portable than code written for a Standard 8051.
Overall strengths and weaknesses
To summarize, the Standard 8051 has the following strengths and weaknesses:
It is based on the core 8051 architecture and thus has many of the strengths of the Standard 8051.
It has a small physical size. It is a low-cost device.
It has limited on-chip RAM and ROM memory and no support for external memory. Designs based on Small 8051s are less easy to port than designs based on Standard
8051s, due to the diverse nature of this branch of the microcontroller family Related patterns and alternative solutions
The main alternative to a Small 8051 (considered in this text) is the ST ANDARD 8051
Alternatively, consider one of the microchip family of PIC devices, such as the (8-pin) PIC12CE673; these have similar capabilities to the Small 8051 devices, albeit with a completely different architecture.
Example: Using the Small 8051
We give many examples of the use of Small 8051 devices throughout this book.
Further reading
A collection of data books for a range of Small 8051 devices is included on the CD-ROM.