Professional Documents
Culture Documents
Module 1
Learning Outcome: An ability to program a microcontroller to perform various tasks
A. Microcontroller Architecture and Programming Model B. Microcontroller Instruction Set Overview C. Assembly Language Programming Techniques Control Structures
Module 1
D. Assembly Language Programming Techniques Control Structure Applications E. Assembly Language Programming Techniques Parameter Passing
Outline
Characteristics that distinguish microprocessors Taxonomy of microprocessors from an application viewpoint Basic architecture of the PIC16F877A Instruction formats and data types of the PIC16F877A
Introduction
Two basic world views regarding the role of microprocessors are applicable
general-purpose view :a microprocessor is an integral part of a machine that runs shrink-wrapped software (or on which user-programmed applications can be shrinkwrapped software (or on which user-programmed applications can be developed and run) user programmable embedded view : a microprocessor is a basic digital system building block that can be used to build intelligent products non-user-programmable
9
Introduction
Why this distinction is important:
different architectural/organizational characteristics of
microprocessors can make them more/less suited for a given application the goodness or badness of a particular microprocessor can only be evaluated in the context of the intended application
10
Next >
Hardwired Systems
Systems using logic gates are simple to design and are cheap and easy to assemble in circuits. Individual chips can be interconnected to provide complex control functions.
For example, D-type latches on their own are limited in their capabilities, but with other identical chips can be made to produce binary counters, shift registers and latches. Drawback is that once a system is designed and manufactured, it cannot be changed without redesigning the hardware used.
This type of circuit is known as Hardwired. Hardwired systems can be made either by using individual components (Integrated Circuits or ICs) on a Printed Circuit Board (PCB) or produced directly in a customised IC.
Next >
For example: A microprocessor system can be programmed to perform exactly the same functions as a number of D-type latches (binary counter, shift register or latch). Modifications can be made without altering the physical configuration or layout of the circuit. The system is therefore more versatile and can be modified to be used in a number of different applications.
Next >
The machine detects the cup and fills it with coffee, dispensing the exact amount to fill the cup. This ensures that the cup is not overfilled and that deliberate attempts to fill larger cups are prevented.
Next >
If a hardwired design had been used, replacement or modification of the hardware in each machine would be required. This would be expensive.
If the machines are software controlled, the software could simply be replaced or modified at minimal cost.
Next >
Simple to make, quickly and cheaply. Relatively easy to understand and gives a predicable output.
Next >
Versatile and can be used in a number of different applications. Function can be modified by changing its program code in situ. Can be more expensive to produce than hardwired systems
for simple projects.
Can contain errors (bugs) which cause unpredictable results. Require greater amounts of testing due to the added complexity
of the system.
Next >
Question
A) Speed is slower than software systems B) Expensive to make C) Difficult to change function D) Slow to assemble
Question
A) Versatile
B) Less expensive to produce than hardwired systems C) Does not require extensive testing D) Works reliably first time
As you can see, this is similar to the simple Input - Process - Output system diagram:
Next >
There are several different types of port. Some transmit data serially while others transmit data in parallel, for example, RS232 (serial), Centronics (parallel), USB (Serial).
Next >
This requires a more complex connection system. The processor needs to be able to select which sub-system it needs to talk to, decide whether it is sending or receiving, and then send or receive data.
Next >
Next >
Question
Which connection system carries the signal that determines whether data is to be written to or read from, memory?
Next >
Microcontrollers - PICs
In the 1980s Arizona Microchip Inc. produced a simple microcontroller that they called the Peripheral Interface Controller, or PIC.
Originally it was little used but in the early 1990s Arizona Microchip released the 16C5X series PIC. These new devices were astonishingly fast, efficient and easy for engineers to understand and program. They were also inexpensive, readily available and obtainable in a wide range of different designs.
PICs are now among the most widely used microcontrollers in the world, with billions having been sold.
Next >
Question
Question
C) 1995 - 1997
D) 1990 - 1995
Microprocessor Architectures
Two types of architectures used in modern processors. Von Neumann architecture used in the Z80 to the modern Pentium chips.
Von Neumann system stores data and program code together in one memory space. Disadvantage of only allowing the CPU to access either data or the program memory at any one time.
PIC devices use the Harvard architecture. Differs from the Von Neumann type by having separate memories for program code and data, so can be accessed independently and simultaneously. Advantage of the Harvard architecture is that it reduces the time taken to retrieve the instructions, and so is more efficient.
Next >
Question
A) Z80 B) Harvard
C) Von Neumann
D) Pentium
Question
Which architecture system stores program code and memory code in different locations?
D) Pentium
Question
D) Harvard
Instruction Sets
Language used by the microcontroller is divided into a number of instructions.
Next >
Question
Instruction Sets
CISC (Complex Instruction Set Computer) Microcontrollers and microprocessor systems which use CISC systems, have a large quantity of very detailed instructions.
RISC (Reduced Instruction Set Computer) A reduced instruction set is made up of a small number of key instructions. PICs use this type of instruction set and have about 35 instructions.
Next >
Question
10
Question
11
Approximately how many instructions can a PIC chip programmed using RISC understand?
Reduction in costs - smaller number of components required. Increased system reliability - fewer components mean a smaller
likelihood of the system failing.
Question
12
A microcontroller has one main advantage over a microcomputer, which gives rise to many benefits. What is it?
A) Increased reliability
B) Reduced costs C) Increased portability D) Reduced number of components