Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Microcontroller Cookbook
Microcontroller Cookbook
Microcontroller Cookbook
Ebook323 pages

Microcontroller Cookbook

Rating: 4.5 out of 5 stars

4.5/5

()

Read preview

About this ebook

Microcontroller Cookbook guides you through programming, interfacing, development work and circuit design using two of the most popular microcontroller families. The cookbook approach makes this an ideal book for anyone who has to get up and running quickly, so it is ideal for hard-pressed professionals and advanced electronics hobbyists. Enough theory is included to make this a suitable text for introductory microelecronics courses up to first year degree level. New sections of reviews make this an ideal text for courses or independent study.

The new edition offers additional material on C programming and the use of compilers, an expanded section on macros, and a new section on the development of source code.

  • A practical way of getting up to speed with microcontrollers
  • Covers syllabus requirements of HNC / HND
  • Project-based cookbook approach
LanguageEnglish
Release dateNov 20, 2000
ISBN9780080511559
Microcontroller Cookbook
Author

Mike James

Mike James is an established author and experienced FE lecturer. He currently works for Westland. His latest Newnes titles are Microcontroller Cookbook and Higher Electronics.

Read more from Mike James

Related to Microcontroller Cookbook

Electrical Engineering & Electronics For You

View More

Reviews for Microcontroller Cookbook

Rating: 4.666666666666667 out of 5 stars
4.5/5

3 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Microcontroller Cookbook - Mike James

    way.

    Chapter 1

    Microcomputer Systems

    Introduction

    A cookbook is not usually meant to be read from end to end. The reader knows what effect he or she wishes to achieve, and just browses the recipes of direct interest. So it is intended with this book. I have tried to cover all the aspects of using two of the most common and popular microcontrollers. Both of these can now be considered to be mature and well-established products which have their individual adherents and devotees. There are a lot of variants within each family to satisfy most memory/input-output/data conversion/timing needs of the users. I have taken the embedded controller market as my target, and used as many examples of hardware and software design as I thought relevant and appropriate (not just my opinion, but from many and diverse industrial colleagues).

    Histories

    Microcontrollers were introduced when the skills of the semiconductor industry allowed several functions such as CPU, memory and I/O to be integrated onto one piece of silicon. This in turn reduced the size (and usually the power consumption) of any microprocessor-based solution within a problem. Because of the low cost and ease of integration within an application, they are used whenever possible to reduce the chip count of a piece of electronics. The word ‘intelligent’ tends to be applied to any device which contains some sort of processing/memory capability. The intelligence, of course, belongs to the hardware and software designers who program the device.

    Intel introduced the 8051 family in 1980, and from a simple microcontroller, it has grown into at least 30 different versions and been second-sourced by many manufacturers. One of the difficulties of writing a book such as this is the moving nature of the target at which I am aiming. Each week brings out new, better, faster, lower-power, larger-memory versions. I have included some of the more interesting variants – usually those which easily solve a specific problem. For example, it seems somewhat perverse to implement a serial communication channel via a digital I/O port when both products have perfectly good family members with features which can handle this task automatically. Having said that, there are occasions when it is necessary in the interests of cost or compactness to solve this problem. Thus, there are examples of code structures to do this (page 46).

    The newcomer PIC from Microchip Technology was developed in the late 1980s and was marketed with the two similar versions – a PROM-based version and an EPROM version. The earlier models were smaller (0.3 inch) width and had less I/O capability. However, the manufacturers came up with a cheap programmer which included assembler and simulator software. This immediately gave them a market advantage, since one of the difficulties when a designer considers a new microprocessor is the cost of the development system. It is one thing to have to learn a new structure and instruction set, without the bother of having to fight the budget holders for the cost of the hardware as well. So, for around £100, an engineer could obtain enough hardware and software to evaluate the product effectively. The product family developed, and the company now have a considerable market share.

    Brief Comparisons

    8051

    The 8051 was introduced to replace the older 8048 family which was originally used as a keyboard handler for IBM PCs. The original product lineup was as follows:

    ROM-based 8051 The program memory is on-chip and is specified by the user. The manufacturer mask-programs the silicon die so that the CPU can only execute the one program. There is a cost advantage if the IC is bought in sufficient quantities.

    EPROM-based 8751 This variant is used mostly for development or very small production runs. It is quite an expensive item in one-off costs, but has the advantage that the program can be erased and a new version ‘blown’ into the internal memory.

    ROMless 8031 This needs external memory (EPROM) to hold the program. To access the memory, the 8031 has to use some of its input/output (I/O) ports. This means that an 8031-based microcontroller has only 14 I/O lines left to directly interface to the world.

    When referring to the family, most engineers simply refer to the 8051. It was introduced at a time when a single +5 V supply was a pleasant relief to digital design engineers. The original 40-pin DIL package was easily configured and the availability of 4 × 8-bit ports was pure luxury.

    The basic device was blessed with:

    • 128 bytes of on-chip RAM (expandable to 64 kbytes externally)

    • 32 I/O lines

    • two 16-bit counter timers

    • 6 sources of program interrupt (each vectoring (jumping) to 6 different addresses and with priorities set by the programmer)

    • Full duplex serial port (full duplex = the ability to simultaneously receive and transmit serial data).

    PIC

    The original 8-bit PIC microcontroller was introduced with a small number of variants with a choice of I/O ranging from the 13-line 16C54 to the 21-line 16C57. These were originally conceived as One Time Programmable (OTP) or as EPROM-based versions. An attraction of the plastic OTP version was that it was very cheap. The EPROM version, as in all microcontrollers, is relatively expensive. This is because of the expense of the ceramic body needed to be formed around the quartz UV transparent window which is used to erase the memory. The smaller package sizes were an interesting development, coming as they did in the 0.3 inch ‘skinny DIP’ IC. The larger I/O configurations reverted to the same 0.6 inch wide package as the 8051 for the DIL IC. All devices are available in other packages such as flatpack, leadless chip carrier, plastic leaded chip carrier (PLCC), small outline IC (SOIC), plastic shrink small outline (SSOP) and other variations on these themes. In this book, I will concentrate on Dual In Line

    Enjoying the preview?
    Page 1 of 1