Sie sind auf Seite 1von 46

MicrocontrollersIntroduction

The term microprocessor first came into use at Intel in 1971 and, generally refers to the implementation of the central processor unit (CPU) functions of a computer in a single, large scale integrated circuit. The Intel 4004 was a four bit microprocessor and led the way to the development of the 8008 the first eight-bit microprocessor introduced in 1972. And from here the history of microprocessors starts..8080 in 74 and so on.

What Is a Microcontroller?
A microcontroller is a computer on a single chip; It contains a CPU (usually called the core) and a variety of peripherals which assist the application. By contrast a typical CPU, like the x86 in your PC, contains only the core - all peripherals, like timers and DMA controllers, are in external chips. Many microcontrollers can operate with no external components except an oscillator (a crystal or ceramic resonator) - some do not even require this, having an oscillator built in!

Almost all modern appliances include microcontrollers to support the friendliness and programmability consumers expect these days. Microcontrollers can have a very long life span - chips first offered in the late 70s are still chosen for many new designs today!

The Micro World


Microcontrollers are classified by the number of bits in a data (not instruction) word. The most popular segment by far is the 8-bit microcontrollers. 4-bit micros were used in many high-volume appliances with minimum computing needs. 16 and 32-bit micros are much more powerful and correspondingly larger - many 32-bit devices are designed to offer Pentium-class power at a fraction of the power and price for batteryoperated computers, video game consoles etc. 8-bit microcontrollers range in size from very small (only 8 pins!) to very large (over 200 pins), with some large chips providing power and expandability comparable to that of modern CPUs.

External Buses
Microcontrollers can be divided also into two major groups those with and without an external bus (EB). An external bus (offering address and data lines) enables a wide variety of peripheral chips to be connected in almost any quantity; this flexibility comes at the cost of board space, chip size, chip count, power consumption and RFI emissions.. A major advantage of EB microcontrollers for the beginner or hard-up developer is that EPROMs (in which code for EB micros is usually stored) are cheap and large in capacity; EPROM programmers and emulators are cheap and easy to use. Non-EB microcontroller, whose code is stored on-chip, require custom programming equipment, which may be cheap, or may be very expensive.

Program Storage
The next major distinctions between microcontrollers is the manner in which the program (usually called code) you create is stored. ROMless micros are those with an external bus, as discussed above, which require an EPROM , non-volatile SRAM or a Flash for code storage. An OTP (One-Time Programmable) microcontroller can be programmed exactly once. If the program isn't correct, you throw it away. OTPs are the most popular micro type for low-volume production, where the setup cost of masking (see next) can't be justified. In fact, an OTP is usually just an EPROM without that expensive windowed ceramic package.

Program Storage
A masked microcontroller contains ROM that is programmed by the factory from code you supply. Unless you work for a large company with deep pockets you'll probably never hear about masking again Flash micros are newer on the block. They operate similarly to OTPs, but can be re-programmed many times, usually at least 1000. This makes it feasible to use one chip to test code changes over and over again, and avoid wastage of chips. ROMless and Flash micros share the advantage that the micro does not need to be removed from its board for the code to be changed. This is very useful when developing with high-pin-count SMD microcontrollers, which generally cannot be socketed on the board.

Software Tools

Coding for micros is generally done in either the assembly language or C, although other high-level languages, notably BASIC, are available for some families. Assemblers are almost always supplied free by the micro's manufacturer or a third party, and vary widely in power, while C compilers vary from free to very expensive.

Software Tools
Although assemblers do a relatively simple job they are not bound by any ANSI standard, so they vary widely in syntax and power. A good assembler offers nested macros with local labels, nested conditional assembly and helpful error messages. An interesting variant of the assembler is the structured assembler, which allows you to use flow control construct typical of a high-level language, like if-then-else and switch statements, in assembly. Ultimately your software tools must produce a file for downloading to the micro or EPROM. This must be in a format recognized by the hardware tools (see next), usually binary(bin), hex. Hex file is probably the most common of these, and is a simple text file containing addresses and data.

Programming Tools
OK, you've written a program and have a hex file hot to trot how do you get it into the micro? The easiest category to deal with is ROM-less micros: you either program (burn) your code into an EPROM using an EPROM programmer, or download it to an EPROM emulator, which plugs into your board's EPROM socket and pretends to be an EPROM. For OTP and flash microcontroller a programmer specific to the micro family you're using is required.

Other Development Tools


There's one other major development tool; that's the emulator. Its job is to let you explore the internals of the microcontroller while your program's running or being stepped. An emulator is usually an external box which communicates with custom software running on your PC via a serial port, and attaches to a pod which plugs into the micro's socket on your board, appearing to be the microcontroller from your circuit's point of view. A true emulator can run your program in real time (as fast as the micro itself would) and supports all of the micro's features. Because they are specific to a micro family (and the pod often to one particular micro) emulators can be very expensive .

Other Development Tools


The simulator is an increasing popular tool these days, since it offers some of the power of a real-time emulator for little or no cost. It emulates the micro's core in software running on your PC, allowing you to run and step through your program, examining and modifying register and memory contents etc. Good simulators also let you create stimulus files, which perform I/O changes on the micro under simulation. Although simulators are an excellent tool for verifying and debugging sections of data-processing code, they cannot solve problems caused by unexpected real-time behavior of your circuit. Lastly there's the monitor, which is a module you include in your code which communicates with PC software; typically it uses a serial port to talk to a simple terminal program. Their capabilities vary widely, but it can typically send text messages and ASCII-converted numbers to the user, allow you to freeze the program (except perhaps for interrupt handlers) and examine and change memory locations and peripherals. Of course, a monitor will use a micro peripheral, usually a UART if available, for communications; it won't be available to your code.

Micro Features
Supply Voltage Range Most micros run optimally at the standard 5.0V, but some are designed specifically for lower voltages e.g. 3.3V. Operating micros at very low voltages (from batteries or backup capacitors) is fraught with danger - a well-tested external watchdog is the best safeguard against lockups due to unpredictable voltages. The Clock Like any computing device, a micro has a master oscillator. This can be a crystal or the cheaper but less precise ceramic resonator. Some small micros offer an internal clock, usually driven by an RC (resistor-capacitor) network, whose frequency can vary greatly with voltage, temperature. Typical clock frequencies are 4-16MHz. The frequency doesn't give any absolute measure of a microcontroller's computing power (throughput), which is measured in MIPS (millions of operations per second), since the number of clock cycles required to execute even the simplest instructions varies widely between cores, and some instructions take longer than others. A useful figure is MIPS/MHz, which indicates roughly how many MIPS of throughput are produced by each MHz of clock speed. Higher clock speeds increase power consumption and RFI emissions.

Micro Features
The Reset Input Most microcontrollers have a reset. Most small and newer microcontroller will start up when power is applied with RESET unconnected or tied to the inactive power rail, but some older families require that an RC delay or a clean pulse be applied after power-up. The Brown-Out Detector The brown-out detector resets the micro if the supply voltage falls seriously below the nominal value, and holds it in the reset state until it rises again. This prevents unpredictable operation at low voltages, including EEPROM corruption. EEPROM corruption is usually the most pressing reason to use brown-out protection; The Watchdog A watchdog is something very good micro-based circuit should have. Many microcontrollers include one on the chip, which must be regularly fed by your code or it will reset the micro. If your microcontroller doesn't have one, use an external watchdog chip such as the Dallas 1232 or equivalent. Most microcontrollers with watchdogs enable your code to tell if the last reset was caused by the watchdog.

Micro Features
I/O Ports All microcontrollers offer digital I/O ports, which you can use as digital input or output. An I/O port is generally a group of up to 8 I/O lines which are addressed together as a byte. Usually any line can be configured as an input or output, with optional weak pull-up (effectively a large resistors connected to VCC) often available for inputs It is common for I/O lines to have an alternate (special) function related to a peripheral; it's a choice whether that line is used by that peripheral or as standard digital I/O. Some I/O lines may have higher current capacity than others, for driving LEDs and other heavy loads; sinking 20mA (low output) is a typical figure for a high-current output.

Micro Features
Interrupts Interrupt is a fundamental concept in micros, and computers in general. Although your program generally follows a predictable linear path through your code, various conditions (both internal and external to the chip) can cause the micro to execute an interrupt handler, then return to your main program where it left off. Interrupts allow your code to respond to events that require urgent attention without the need to waste time checking for that event regularly. Interrupt handlers should be as short as possible to avoid introducing serious delays into your code, and preventing other interrupt handlers from executing. It's common for an interrupt handler to record whatever caused the interrupt (such as a byte received from a UART) and set a flag to indicate this to the main program. Interrupt handlers must save any registers or memory locations that they use whose corruption may affect the main program; the stack is usually used for this. Most microcontrollers allow interrupt handlers to be nested (ie an interrupt handler interrupted by another interrupt handler), although this may require special action on your part and may increase the stack usage of your program. All interrupts are disabled when your program starts, and must be enabled by your code.

Micro Features
Timers Timers are perhaps the most important standard microcontroller peripheral. A timer is a counter driven by some division of the clock. Timers are either 8 or 16 bits in length, and virtually all micros offer at least one 8-bit timer; both up and down-counting timers exist. You can usually start and stop a timer, read and set its value and generate a interrupt when it reaches zero (overflows), which allows you to generate accurate time intervals. More powerful 16-bit timers offer capture and/or compare, usually both. Also common are auto-reload timers, which automatically reload themselves with a specified value and start again when they reach zero, optionally generating an interrupt., which produce a pulse stream with a precisely defined duty cycle (relative low and high times).

Micro Features
Analog Input and Output Some micros, especially larger ones, have 8 or 10-bit A/D converters. Since a micro is a very noisy environment for A/D conversion many micros allow you literally switch off other peripherals while conversions are taking place. Most can generate interrupts when conversions are complete. A/D converters raise the cost of micros dramatically and limit your choice greatly, so consider using an off-chip A/D instead. If conversion speed is not important serial A/Ds like the TLC549 can do the job without consuming many I/O lines. A few micros also offer D/A converters for analog output.

Micro Features
Serial Interfaces A UART (Universal Asynchronous Receiver/Transmitter) is a peripheral that implements an asynchronous serial interface, as used in standard RS-232 connections, so they're very handy for talking to a PC, a terminal or another micro. They all offer the same facilities - the thing to sweat over is the baud rate. Some UARTs require a timer for this while others use a separate baud rate generator driven by the clock. 11.059MHz crystals are available simply because they allow an 8051 to offer the standard baud rates! Some micros offer an SPI (Serial Peripheral Interface) or I2C (Inter Integrated Connect) interface, both of which use a clock line rather than as assumed baud rate to regulate data movement, and are hence synchronous. Both standards allow connection to multiple peripheral chips.

Micro Features
EEPROM EEPROM (Electrically Erasable Programmable Read Only Memory) is non-volatile memory - it retains its contents when power is removed. Some micros include a small amount of EEPROM (often called E-squared) storage for use by your code. The use of EEPROM requires some care. Erasing and rewriting an EEPROM location takes some time, for which time your code must wait if writing multiple locations, and loss of power can corrupt an EEPROM write in progress if the micro doesn't have an internal or external brownout detector.

Micro Features
Analog Comparator The inclusion of analog comparators on micros is a fairly recent, but they can be very handy in circuits which have to interface with an analog world. Low-Power Modes Most micros can enter one or more low-power states, where your program does not run and very little power is drawn, for conservation of batteries, backup capacitors etc. The micro is "woken up" and execution resumed by a timer or external interrupt or an I/O line state change. These modes are typically called Wait, Idle, Sleep etc, and can reduce power supply current to several microamps, dependent on supply voltage and ambient temperature. Real-Time Clocks Some micros, especially those intended for consumer appliances, include a real-time clock, which helps you keep track of the time of day even when the micro is in a low-power mode, and runs from a separate crystal. Typically it generates an interrupt at 1/2 second intervals; the interrupt handler can increment time-of-day counters.

Micro Features
Specialized Display Drivers (ex HD44780 Hitachi) Micros targeted at modern appliances using LCD and gas plasma displays often include drivers to support them. External Peripherals These are the more common chips which can be easily connected to micros to support features they don't provide. Bus interface peripherals are best suited to micros with external buses, usually ROMless, due to the large number of connections they require. Bus peripherals are divided according to the bus design with which they are compatible, either Intel or Motorola. Both companies introduced bus peripherals suitable for their 8-bit CPUs in the 70s, and their later micros used compatible buses. Intel, Tundra and OKI offer Intel-bus peripherals; Motorola and SGS-Thompson offer Motorola-bus peripherals. Beware of NMOS versions of these parts, which can have very high power consumption. The original IBM PC was full of Intel-bus peripherals, which are still available and work with the 8051. Serial interface peripherals can be used with any micro, although some provide an easy-to-use hardware interface; code to emulate this is available for all popular micros

Micro Features
Timer (bus interface): Contains three separate16-bit timers which can be used in various ways. UART (bus interface): Contains one or more separate UARTs. May offer handshaking lines and FIFOs which allow bytes to be handled in groups, features not usually found in micro UARTS. May also be called an ACIA (Asynchronous Communications Interface Adapter). Quad and octal UARTs are UARTs capable of 3Mb/s are available for special communications needs. Peripherals supporting proprietary communications protocols (eg IBM networking) also exist. I/O extender (bus or serial interface): Provides more general digital I/O - typically 24 lines for a 40-pin package. A/D converter (bus or serial interface): Provides analog inputs. Many offer features not often found on micros, such as a settable voltage range or 12-bit conversion. They tend to work better than on-micro A/D converters because they're isolated from the noisy internals of the micro. Real-Time Clock (serial interface): A chip with its own crystal and backup battery support which keeps track the time of day and date. More capable than the peripheral of the same name found in some larger micros. Non-Volatile RAM (bus or serial interface): Flash or EEPROM memory which retains its contents when power is removed. The bus interface offers much faster access, but serial interfaces are cheaper and suit smaller micros. Many standard 74-series logic chips (most commonly 74HC CMOS) can work with micro buses or be used to reduce I/O requirements. For example, the 74HC574 octal latch can provide 8 digital outputs and the 74HC595 shift register can be used to drive any number of digital outputs from just three micro outputs, albeit

Micro Architecture
Basic Types There are two basic types of architecture to be found in micros: The Harvard architecture locates the code and data storage areas (memory spaces) on separate buses, which allows instructions and data to be fetched simultaneously by the core, improving efficiency. The Von Neumann architecture puts all memory spaces on the same bus, so every location in every space must have a unique address. This enables every space to be treated identically as instructions or data, which has some interesting possibilities, but is less efficient. PC architectures, where memory locations can't be pre-wired as RAM or ROM, are Von Neumann.

Micro Architecture
CISC and RISC In parallel with the interest in CISC (complex instruction set computer) for large CPUs came RISC (reduced instruction set computer) architectures for micros. The hallmark of a RISC micro is that instruction words are more than 8 bits long (eg 12, 14 or 16 bits) and most instructions only require one word, whereas conventional CISC micros have 8-bit instruction words and many instructions that require more than one of them. Generally RISC micros are designed for speed, and sacrifice some ease of use to that end, but the difference in ease of use isn't so great that it should influence your choice of micro. You're more likely to pick a PIC or AVR RISC micro for its speed than reject it because its instruction set is small or appears strange.

Micro Architecture
To Accumulate Or Not To Accumulate The major difference to be found when comparing the instruction sets of micros is that some require that most arithmetic and logical operations be performed on a single register, usually called the accumulator, while others allow any of a number of registers to be used. The advantage of the accumulator approach is that instructions using it can be short, mostly 8 bits, whereas non-accumulator cores require a longer instruction word or multiple instruction bytes to specify the operation. However, accumulator cores are poor at multibyte (eg 16, 24 or 32-bit) data operations because every byte must pass through the accumulator. Since non-accumulator designs suit the wider instruction words of RISC cores they'll probably become more common. They chew code space more quickly and don't make a major difference to performance unless a lot of multi-byte processing is required. The Atmel AVR and Zilog Z8 are examples of non-accumulator cores.

Micro Architecture
Spaces Some subset of the following spaces is found in all micros: Code: Where your program is stored. Data: RAM locations available to your program. The I/O space may be mapped into this space rather than separate. Registers: May be mapped into the Data space or made entirely separate in RISC-type architectures. Access to registers is faster and more capable than access to Data. I/O: Special locations which form the program's interface with Port I/O and peripherals. ROMless micros also possess an external space for access to the external bus, which may be separate or mapped into the single Data space. Understanding the spaces understood by a micro and their functions is the basic step in coming to grips with its architecture.The 8051 is an example of a core with a variety of spaces, all of which must be understood to make effective use of it.

Micro Architecture
The Stack All micros have a stack - a dynamic RAM area onto which return addresses are pushed when you call a routine or an interrupt handler is invoked, and off which they are popped when these routines finish. Some very small micros with very a small Data space implement a special small space for the stack (termed a hardware stack) which may be as small as 3 locations, severely limiting the nesting of routine calls and interrupt handlers allowed! Most micros require you to set a stack pointer at startup, which is then used as a base for the stack, which grows upward or downward (make sure you know which). If RAM space is tight, work out what the maximum possible stack size is, and reserve space for it accordingly. Corruption of the stack by other data (or vice versa) can be tough to track down, so it's better to be cautious here. Most micros allow you to push and pop data onto and off the stack yourself. Apart from saving registers in interrupt handlers, the stack can often be useful when you're short of registers and need to temporarily save their values.

Choosing a Micro
Picking the right micro for the job is something that thousands of engineers with many years of experience mull over every day - it can be a tough don't have time to learn something new. These are things to consider: Availability and cost: The micro must be readily available - most are from a single manufacturer, but multiple distributors depending on your location. And it must be sensibly priced - prices can vary insanely within a family depending on demand, supply and popularity. Support: Is the micro from a popular family? Ask people if they'd recommend it . Is the local distributor helpful and (ideally) willing to lend you tools to get you hooked on it? What's the manufacturer's website like? Be very cautious with Asian manufacturers - they have some wonderful micros, but they simply don't care about your problems unless you're using millions. NEC and Hitachi are exceptions to this.

Choosing a Micro
Tools Decide whether you want an emulator, which is usually far more expensive than a simple programmer. If tools cost is the driving factor serial programmers for flash micros (eg H8, AVR) are unbeatable. Variety: If you invest time and money in a new family, it's a bonus if they are useful down the track. Get an overview of all the micros that use that core and tools, and see if you like the view. The 8051 is untouchable for variety, with the HC05 doing well at the smaller end of town. Reliability: New families (and even new parts in established families) can have problems, usually in hardware rather than software. Don't use a new part if you can't accept some risk. Flexibility: If you want to leave room to add more memory or peripherals later, consider ROMless micros. You can hang anything off them you can think of. Package: It must be easy to handle given your manufacturing expertise and programming tools. Don't pick a QFP (quad flat pack) chip unless you have the equipment and knowhow to handle it. DIP and PLCC are both socketable and easy to handle (DIP more so). If you need a lot of I/O but want to avoid surface mount, ROMless micros with 24-line I/O expanders or HC574 latches are your guys. Unfortunately the level of micro power at which packages become surface mount is decreasing as industry demands miniaturisation, so your choice of newer parts may be limited. Noise Immunity: In the mains appliance industry, where I've spent some time, this is right up there with cost. Micros very greatly in their resistance to the electrical crud that enters at power supplies and cabling, sneaks through any attempts at filtering . The ST6 family is superb at this, the Z8 very poor, with most somewhere in between.

Developing For Micros


Developing code for a micro is nothing like programming a PC, except on rare large projects using very high-end chips. While PC tools now offer ease of use and high levels of abstraction, at the cost of memory consumption and speed, fast execution and compact code remain the primary requirements of most micro projects, hence the continuing dominance of assembly code. Unlike PCs, which have no practical memory limitations or (in user mode) real-time requirements, you usually need to keep the code, RAM size and speed of micros in mind when coding for them. It's very desirable that the person writing the micro's code also designs the circuit in which the micro is to live, since if it's designed with the limitations and interfacing needs of the micro in mind it will make the programmer's job much easier, not to mention possible! Many micro applications must respond to external stimuli in real time - that is, with a guarantee maximum response time or latency. If this applies to your application consider each such requirement carefully in the context of the speed of your micro and the other tasks it must manage. Real-time response should be based on interrupts if possible, since the response latency is guaranteed by the micro's architecture.

Developing For Micros


Micro code has no "exit point" - what would it exit to? There must be an outer loop, usually called the main loop, which is repeatedly executed forever. Most applications require multiple tasks to be performed simultaneously. Although multi-tasking kernels for micros do exist, their overhead and expense is usually only justifiable on large projects and high-end parts. It's common practice for the main loop of a micro application to call routines to service a number of tasks in rapid succession; if interrupt handlers are invoked they effectively eat into the processing power available. If you are using a C compiler, beware of 16-bit default integer and constant sizes the overhead of 16-bit arithmetic is very high in most 8-bit micros. Look at the generated assembly code often to gain a feel for how you can help the compiler optimize your code without sacrificing too much of the high-level abstraction you desire. Write interrupt handlers and other time-critical code sections in assembler. In assembler, adopt and try to stick to some coding conventions to make your code more reliable. Give every routine a header describing what it does, any side-effects on peripherals or RAM, what's passed and returned and what registers are used for.. Divide your code into small logical blocks separated by blank lines, and put labels on their own lines. Only use non-descriptive label names where the jump is very short.

Debugging
It would be great if micro development was simply a matter of downloading the code, verifying that it works correctly and moving on to the next project. Unfortunately, bugs are inevitable. Some are due to simple coding mistakes (more common in assembly), some are due to interactions between tasks you didn't expect or too-large response latencies, and some are due to the hardware that the data book forgot to mention. Firstly, don't try to write all the code in one session. Work incrementally, getting things happening in small stages. That way you'll always have working code to fall back on when things go wrong. Step through newly written code in a simulator if possible to check that it works and doesn't have unwanted side effects. It's much better to write and verify a piece code slowly and carefully, before ever running it for real, than to try to fix it later when it's obscured by other functionality.

Core and Family Details


8051 First offered by Intel in the late 70s, this core is at the heart of the biggest variety of micros, from several manufacturers. Philips was the biggest player in the 8051 market. The 8051 has a Harvard architecture (code and internal data both start from 0). General pros: Powerful bit manipulation instructions - part of RAM and many special registers are bit-addressable. Multiply and divide instructions. At least two 16-bit timers. UART Plentiful internal RAM. Straightforward code addressing - always starts at zero. I/O design makes bi-directional I/O easy. Excellent free assembler from Metalink for ex. General cons: Very quirky instruction set Confusing variety of internal and external memory spaces. I/O design prevents true floating inputs, and pins are always high after reset. Not very fast due to clock division. Access to external data very weak - single pointer register only. The 8051 is very comfortable to use once you've learnt it. It works well for modest assembly projects which don't use external RAM heavily.

Core and Family Details


Varieties The generic ROMless 80C31 and 80C32 (avoid the old roomheating NMOS versions without the 'C') are a bargain, even with the cost of an EPROM considered, and very flexible due to the wide variety of peripherals that it can easily address. Philips(NXP) has a very wide range, from very fast 24-pin parts to large chips with a variety of specialised peripherals. Prices and availability vary widely, though. Dallas (Maxim) have a range using a core faster than standard for the same clock - it divides the clock by 4 or less rather than 12. Atmel used the 8051 core for their first small flash micros. The 89C2051 (80C32 core) is remarkable - a 20-pin micro with a UART, three 16-bit timers and 256 bytes of RAM was unheard of when it was introduced.

Core and Family Details


Z8 The Zilog Z8 core is not new, but a family of small OTP parts oriented at the low-cost consumer market is more recent. General Pros: Cheap true emulator available, handles 18-40 pin parts. Non-accumulator instruction set. Moveable register "window" into RAM. Powerful instruction set. Two timers in all but smallest part. Watchdog standard. Two analog comparators standard. Wide range of 18-pin parts. General Cons: Poor noise immunity. No A/D in small parts No RESET pin Slow Timers 8-bit only. Very pleasant to use, although poor noise immunity is a serious problem in some applications. The very cheap true emulator makes it an ideal beginner's micro for someone prepared to spend a little money. Zilog's patchy support and pricing may be of concern to corporate users.

Core and Family Details


AVR The AVR core promises speed at one instruction per clock cycle. Like their 8051-based family (from Atmel) all AVR micros are flash-based, and free programmers are already around. Atmel claim that the AVR was designed in consultation with C compiler vendors. General Pros: Flash based, programming specs published. Inputs have optional pullup and 20mA sink capability. Very high speed (almost 1MIPS/MHz) Large register space. All data processing register-to-register: no accumulator. Instruction set as powerful as possible given opcode space. Three RAM address pointers with auto increment/decrement. Watchdog and EEPROM standard. 1Mb/s UART on all but smallest member. No reset circuit required. Separate I/O output latch and input pin registers. Excellent C compiler support. Able to address >64K code and data.

Core and Family Details


General Cons: Some odd restrictions on instruction usage. Apparent redundancy in instruction set. Instruction set not "clean" - hard to learn. Limited bit manipulation. No brown-out detector. Free assembler from Atmel is quite weak, Like the 8051, very capable when all the instruction set and memory space quirks are understood.

Core and Family Details


PIC Microchip's RISC family has been around a few years now. It has become very popular through aggressive OTP pricing, a simple instruction set, robust hardware (e.g. brown-out detectors) and excellent support. Pros compared to AVR: Standard brown-out detector. Wide range of sizes and peripheral choices. More language and tool choices. Running at published clock speeds. Cons compared to AVR: 4 times slower at same clock speed. Much weaker instruction set. Limited code and data addressing. No C compiler support. Single I/O in/out register. Accumulator-based data processing.

Core and Family Details


68HC05 The old faithful of the low-end 8-bit market, Motorola's (Freescale) HC05 looks rather dated these days, but some of the variants, most of which began life as customer-specific designs, offer excellent value for particular applications. General Pro: Von Neumann architecture is easy to understand. Straightforward instruction set with some bit handling. Excellent support from Motorola. General Con: Weak timers. No consistency within family - many variants specialised. No push/pop access to stack. Evaluation board (EVB) is expensive but unreliable. Not price-competitive. Slow

Core and Family Details


68HC11 A very popular family from Motorola (Freescale), more powerful than the HC05, and competitive with the 8051. General Pros: Von Neumann architecture is easy to understand. Powerful, easy-to-use instruction set. Popular parts are good value. Good support for C compilers. Good support from Motorola. General Cons: Much smaller range than 8051 derivatives. Slow UART. Overall: Probably easier to learn than the 8051, and a little more powerful, but less variety of derivatives.

Core and Family Details


78K0 NEC's 78K0 is one of the more notable Japanese families to gain popularity outside Asia. Although emulator is expensive and the docs are poor, you get a decent free C compiler . General Pros: Very powerful instruction set with excellent C support. Some 16-bit data instructions. Fairly fast. Abundant timers on most parts. Free C compiler and structured assembler from NEC. Good value General Cons: Most parts surface mount. Emulator very expensive Poor documentation.

Core and Family Details


H8 The H8 family (really a group of 8-bit and 16-bit families) is Hitachi's (Renesas-Hitachi and Mitsubishi) mass-market offering. Similar in architecture to the HC05 at the low end, they are notable for their early adoption of flash code and the (by all accounts) excellent free port of the C compiler. General pros: Many devices with flash. Powerful instruction set with good C support. Wide range of 8 and 16-bit devices. Good free C compiler Nice evaluation/programming boards available. Abundant timers. General cons: Most packages surface-mount. Emulator expensive.

Core and Family Details


ST6 The SGS-Thompson ST6 is a low-end OTP/mask family aimed squarely at consumer devices. Its major features are excellent noise immunity and A/D conversion on some very small parts. General Pros: Excellent noise immunity. EPROMs available throughout range for development. A/D converters available on low-end parts. Very good pricing at high volumes. General Cons: Weak instruction set makes them unpleasant to use. Starter kit is weak, and emulation is expensive. Poor quality European docs. In the appliance industry noise immunity and low cost make any other fault forgivable. The instruction set is weak and the architecture is confusing, especially on larger parts, but that doesn't put off serious users. It is not recommended to beginners.

Core and Family Details


Others There a several general-purpose micro families from U.S. mfrs that are not in widespread use, but tools and support are available should they have features you really need. Otherwise it's best to steer clear of them. TMS370: Texas Instruments' general-purpose family. A good range with very capable timers, but the very non-standard assembler is hard to use. Largely confined to the auto industry. COP8: National Semiconductor's generalpurpose family.

Das könnte Ihnen auch gefallen