|
INTRODUCTION
Creating applications for the microcontrollers is different than any other development job in electronics and computing. Before selecting a particular device for an application, it is important to understand what the different options and features are and what they can mean with regard to developing the application.
The purpose of this chapter is to introduce the concept of a microcontroller, present features of microcontrollers and its applications. The reminder of the book will go through and present different types of micro controllers and also programming and interfacing techniques of micro controller, mainly 8051, in detail.
EMBEDDED CONTROLLER
Simply an embedded controller is a controller that is embedded in a greater system. A rigid definition is difficult to formulate, since the usual result is something like "most embedded controllers are..". The problem here is "most". We can't seem to shake that word from the definition. No matter how precise one feels his definition is, some people will come and find an exception, or two, or more.
One could say that an embedded controller is a controller (or computer) that is embedded into some device for some purpose other than to provide general purpose computing. Of course, this is not the precise definition.
One common misconception is that an embedded controller is the same as a microcontroller. How about all of those 68000s, 32032s, x86s, Z80s, and so on that are used as embedded controllers. They aren't microcontrollers.
We might be 'correct by stating that an embedded controller controls something (for example controlling a device such as a microwave oven, car braking system, or a cruise missile).
The main thing is not to get to hang up on precise definitions. It all depends on individual's point of view.
MICROCONTROLLER
A controller is used to control some process. At one time, controllers were built exclusively from logic components. and were usually large. heavy boxes. Later on, microprocessors were used and the entire controller could fit on a small circuit board. This is still common-one find many controllers powered by one of the many common microprocessors (including Zilog Z80, Intel 8088, Motorola 6809, and others).
As the process of miniaturization continued, all of the components needed for a controller were built right onto one chip. A one chip computer, or microcontroller was born. A CPU built inito a single VLSI chip is called microprocessor. A digital computer having microprocessor as the CPU along with I/O devices and memory is known as microcomputer.
A microcontroller is a highly integrated chip which includes, on one chip, all or most of the parts needed for a controller. The microcontroller could be called a "one-chip solution". It typically includes: CPU (central processing unit), RAM (Random Access Memory), EPROM/PROM/ROM (Erasable Programmable Read Only Memory), I/O (input/output}-serial and parallel timers interrupt controller.
By only including the features specific to the task (control), cost is relatively low. A typical microcontroller has bit manipulation instructions, easy and direct access to I/O (input; output), and quick and efficient interrupt processing. Microcontrollers are a "one-chip solution" which drastically reduces parts count and design costs.
MICROCONTROLLER FEATURES
Fabrication Techniques
CMOS (Complementary Metal Oxide Semiconductor)
This is the name of a common technique used to fabricate most (if not all) of the newer microcontrollers. CMOS requires much less power than older fabrication techniques, which permits battery operation. CMOS chips also can be fully or near fully static, which means that the clock can be slowed up (or even stopped) putting the chip in sleep mode-CMOS has a much higher immunity to noise (power fluctuations or spikes) than the older fabrication techniques.
PMP (Post Metal Programming)
PMP is a high-energy implantation process that allows micro controller ROM to be programmed after final metallization. Usually ROM is implemented in the second layer die, with nine or ten other layers then added on top. That means the ROM pattern must be specified early in the production process, and completed prototypes devices won't be
available typically for six to eight weeks. With PMP, however, dies can be fully manufactured through
metallization and electrical tests (only the passivation layers need to be added), and held in inventory. This means that ROM can be programmed late in production cycle, making prototypes available in only two weeks.
Architectural Features
Von-Neuman Architec Ture
Microcontrollers based on the Von-Neuman architecture have a single "data" bus that is used to fetch both instructions and data. Program instructions and data are stored in a common main memory. When such a controller addresses main memory, it first fetches an instruction, and then it fetches the data to support the instruction. The two separate fetches slows up the controller's operation.
HARVARD ARCHITECTURE
Microcontrollers based on the Harvard Architecture have separate data bus and an instruction bus. This allows execution to occur in parallel. As an instruction is being "pre-fetched", the current instruction is executing on the data bus. Once the current instruction is complete, the next instruction ready to go. This pre-fetch theoretically allows for much faster execution than Von-Neuman architecture, but there is some added fabrication complexity.
CISC
Almost all of to day's microcontrollers are based on the CISC (Complex Instruction Set Computer) concept. The typical CISC microcontroller has well over 80 instructions, many of them very powerful and very specialized for specific control tasks. It is quite common for the instructions to all behave quite differently. Some 'might only operate on certain address spaces or registers, and others might only recognize certain addressing modes.
The advantages of the CISC architecture is that many of the instructions are macro like, allowing the programmer to use one instruction in place of many simpler instructions.
RISC
The industry trend for microprocessor design is for Reduced Instruction Set Computers (RISC) designs. This is beginning to spill over into the micro controller market. By implementing fewer instructions, the chip is able to implement some performance enhancing features. The benefits of RISC design simplicity are a smaller chip, smaller pin count, and very low power
consumption.
Among some of the typical features of a RISC processor-Harvard architecture allows simultaneous access of program and data, and overlapping of some operations for increased processing performance, Instruction pipelining increases execution speed, Orthogonal (symmetrical) instruction set for programming simplicity: allows each instruction to operate on any register or use any addressing mode: instructions have no special combinations, exceptions, restrictions, or side effects.
SISC
Actually, a microcontroller is by definition a Reduced Instruction Set Computer. It could really be called a Specific Instruction Set Computer (SISC). The [original] idea behind the microcontroller was to limit the capabilities of the CPU itself, allowing a complete computer (memory, I/O, interrupts, etc) to fit on the available chip. At the expense of the more general purpose instructions that make the standard microprocessors (8088, 68000, 32032) so easy to use, the instruction set was designed for the specific purpose of control (powerful bit manipulation, easy and efficient I/O, and so on).
Advanced Memory Options
EEPROM (Electrically Erasable Programmable Read Only Memory)
Many microconrollers have limited amounts of EEPROM on the chip. EEPROM seems more suited (because of its economics) for small amounts of memory that hold a limited number of parameters that may have to be changed from time to time. This type of memory is relatively slow, and the number of erase/write cycles allowed in its lifetime is limited.
FLASH (EPROM)
Flash provides a better solution than regular EEPROM when there is a requirement for large amounts of non-volatile program memory. It is both faster and permits more erase/write cycles than
EEPROM.
BATTERY BACKED-UP STATIC RAM
Battery backed-up static RAM is useful when a large non-volatile program and DATA space is required. A major advantage of static RAM is that it is much faster than other types of nonvolatile memory so it is well suited for high performance application. Also there are no limits as to the number of times that it may be written to so it is perfect for applications that keep and manipulate large amounts of data locally.
|