You are on page 1of 71

Dr TSAFACK P.

/TCHAPGA TCHITO

first calculators where purely mechanical, such as the


abacus have existed since antiquity
Wilhelm Schickard designed the first mechanical calculator
in 1623, but did not complete its construction.
Blaise Pascal designed and constructed the first working
mechanical calculator, the Pascaline, in 1642.
In 1694 Gottfried Wilhelm Leibnitz completed the Step
Reckoner,
the first calculator that could perform all four arithmetic
operations.
Charles Babbage designed a difference engine and then a
general-purpose Analytical Engine
Ada Lovelace wrote a manual. Because of this work she is
regarded today as the world's first programmer.
Around 1900, punched card machines were introduced.

A microprocessor incorporates the functions of a


computer's central processing unit (CPU) on a
single integrated circuit (IC), or at most a few
integrated circuits.
It is a multipurpose,
Programmable device
Accepting digital data as input,
processes it according to instructions stored in
its memory,
Provides results as output.
It is an example of sequential digital logic, as it
has internal memory.
Microprocessors operate on numbers and
symbols represented in the binary numeral
system.

It is a small device, with lots of circuitry inside


them, having few connections for external
communication.
However all these integrated circuits differ from
each other, in terms of function.
The circuit inside an integrated circuit, may it be
digital or analog, is purpose designed. Like 555,
a very popular timing IC, It has all the necessary
circuitry inside to make various types of
oscillators. Similarly a 7447 is a binary to 7segment decoder, and has input pins to accept
binary coded decimal (BCD) number,

So on an so forth,
In order to get an application work, you must
know specifically the function, input and
output requirements of the particular
integrated circuit.

You should send a program inside the


ship first

Essentially these two devices are similar, but with


a little bit of difference. A CPU which is the heart
of these devices needs a host of external devices
to make it communicate with real-world.
A typical system would need a system to read the
inputs from keyboard, and write outputs to a
terminal, store intermediate processing data into
some memory, and to keep permanent
information into some safe place.
These devices which are independent circuits,
work in harmony with the CPU, to make one
system.

In a typical Personal Computer these devices


are attached to the CPU, using hard-wired
connections.
This makes the system more flexible, that
means you can add more memory, change
capacity of hard drives, add or remove CDROMs, sound cards etc.

In a typical Personal Computer these devices


are attached to the CPU, using hard-wired
connections.
This makes the system more flexible, that
means you can add more memory, change
capacity of hard drives, add or remove CDROMs, sound cards etc.

A microcontroller on the other hand is made up of most of these devices


built exactly within the same package.
Your microcontroller will therefore contain, the CPU, RAM, ROM, Timers,
I/O etc. all packed within one integrated circuit.
This facilitates the development process, as well as reduce the
requirements of external components, however this also means you can
not change, the number and type of integrated devices.
The applications where a microcontroller will be used, vary.
They are usually quite simple, and do not require as much processing
power as a PC does,
so the microcontrollers with varying amounts of RAM, ROM, I/O lines
and timers etc have been made available.
Essentially all are almost same, and they only vary in the number of
resources available on them.
So for a particular application you chose a microcontroller, not the one
which has maximum resources, but the one which has just enough to do
the job.
More it has recourses more it is expensive.

Thus a microcontroller is a complete, small


scale computer with all the necessary
devices on-board.
All you need is the external hardware, which
you want to drive, like sensors and motors
etc

The Intel 8085 is an 8-bit microprocessor


introduced by Intel in 1977. It was binary
compatible with the more-famous Intel 8080
but required less supporting hardware, thus
allowing
simpler
and
less
expensive
microcomputer systems to be built.
The "5" in the model number came from the
fact that the 8085 requires only a +5-volt (V)
power supply rather than the +5V, 5V and
+12V supplies the 8080 needed.

Structure
CPU : Central Processing Unit

Oscillator
/Clock

CONTROL
UNIT

Order/command
data

register

ALU :

Transfer

Output /
Input

Arithmetic
and Logic
Unit

UNIT

UNIT

CENTRAL
MEMORY

Peripherals,
sensors,
Mass
memory,

An MPU is a MicroProcessor Unit or


microprocessor.
A CPU is a Central Processing Unit. This is the
central brain of a computer and can be
(usually is) made from one or more
microprocessors. The IBM design a
supercomputer includes a million processors!
Remember:
MPU is the thing
CPU is the job.

To control the flow of information it needs to


send chip select and read/write information
along the control bus.
Read/write signals tell the RAM and the I/O
chip whether they have to read,
i.e. accept information from the data bus or
to write information onto the data bus.
Chip select is the on/off switch for each of
the chips and we have to be very careful to
ensure that only one set of information is
being connected to the data bus at one time.

Memory

BUS

INPUT /
OUTPUT

peripheral

MICROPROCESSOR

How simple can a microprocessor-based system actually be? It must


obviously contain a microprocessor otherwise it is simply another
electronic circuit.
A microprocessor must be programmed. This means that it must be
provided with a series of instructions to be followed.
However we program the microprocessor, the result is a series of binary
numbers that represent the simple step by step instructions to be
followed.
These instructions must be stored in some memory. But do the
instructions have to be stored in RAM or ROM?
It must be in ROM.
The last thing that we would want is for it to start following random
instructions at the rate of a million a second!
What determines how fast the microprocessor carries out the
instructions?
For the moment we will say that regular pulses of voltage applied to the
microprocessor determine its speed. This voltage pulse is called a clock
pulse.

The clock rate is the speed at which a microprocessor


executes instructions. Every computer contains an
internal clock that regulates the rate at which
instructions are executed and synchronizes all the
various computer components. The CPU requires a
fixed number of clock ticks (or clock cycles) to
execute each instruction. The faster the clock, the
more instructions the CPU can execute per second.
A clock circuit controls the operation of the
microprocessor. This produces a series of voltage
pulses like a ticking clock. The whole system runs
sequentially, doing the required jobs one after the
other. One step completed for each tick of the clock
system

Microprocessors have internal registers and


storage areas called capacitors that are like
dynamic RAM and need refreshing at intervals.
As the clock speed is reduced, the interval
between refreshing gets
longer until the register or capacitor can no
longer hang on to the
information and the whole operation collapses.
Typically, the minimum clock speed is about a quarter of the
maximum speed. The Intel
80386 will run down to 800 kHz.

A bus is a collection of conductors providing a similar


function.
In a microprocessor-based system we have three main
buses: the data
bus, the address bus and a control bus.
The data bus is a two-way bus carrying data around the
system. Information going into the microprocessor and
results coming out.
The address bus carries addresses and is a one-way bus
from the microprocessor to the memory or other devices.
The control bus is rather different from the other two. It is
a somewhat looser collection of conductors. If we look at a
microprocessor-based system we can easily see the data
and address buses since they consist of many parallel
connections. However, the control bus is just an
association of all the other necessary connections such as
those to the chip select and read/write pins.

Apart from in the most minimal of circuits, some RAM is needed. Even
if the microprocessor-based system is controlling an oven, we still need
the facility to vary the instructions to change the temperature, the time
cycle, the fan speed etc., so some RAM must be added.
Some microprocessors have a small amount of RAM included internally,
enough for this sort of system to work but still quite limited.
If we add some external RAM, the microprocessor is controlling the
operation of three chips: ROM, RAM and I/O.
To control the flow of information it needs to send chip select and
read/write information along the control bus.
Read/write signals tell the RAM and the I/O chip whether they have to
read, i.e. accept information from the data bus or to write information
onto the data bus.

The 8085 is a conventional von Neumann design based on the Intel


8080. Unlike the 8080 it does not multiplex state signals onto the data
bus, but the 8-bit data bus was instead multiplexed with the lower part
of the 16-bit address bus to limit the number of pins to 40. Pin No. 40 is
used for the power supply (+5v) and pin No. 20 for ground. Pin No. 39 is
used as the hold pin. Pins No. 15 to No. 8 are generally used for address
buses. The processor was designed using nMOS circuitry and the later
"H" versions were implemented in Intel's enhanced nMOS process called
HMOS, originally developed for fast static RAM products. Only a 5 Volt
supply is needed, like competing processors and unlike the 8080. The
8085 uses approximately 6,500 transistors.[1]
The 8085 incorporates the functions of the 8224 (clock generator) and
the 8228 (system controller), increasing the level of integration. A
downside compared to similar contemporary designs (such as the Z80)
was the fact that the buses required demultiplexing; however, address
latches in the Intel 8155, 8355, and 8755 memory chips allowed a direct
interface, so an 8085 along with these chips was almost a complete
system.

The 8085 has extensions to support new interrupts, with three maskable
interrupts (RST 7.5, RST 6.5 and RST 5.5), one non-maskable interrupt
(TRAP), and one externally serviced interrupt (INTR). The RST n.5
interrupts refer to actual pins on the processor, a feature which
permitted simple systems to avoid the cost of a separate interrupt
controller.
Like the 8080, the 8085 can accommodate slower memories through
externally generated wait states (pin 35, READY), and has provisions for
Direct Memory Access (DMA) using HOLD and HLDA signals (pins 39 and
38). An improvement over the 8080 was that the 8085 can itself drive a
piezoelectric crystal directly connected to it, and a built in clock
generator generates the internal high amplitude two-phase clock signals
at half the crystal frequency (a 6.14 MHz crystal would yield a 3.07 MHz
clock, for instance).
The 8085 is a binary compatible follow up on the 8080, using the same
basic instruction set as the 8080. Only a few minor instructions were
new to the 8085 above the 8080 set.

All instructions that can be understood by the microcontroller are


known as instruction set. When you write a program in assembly
language, you actually tell a story by specifying instructions in
order they should be executed. The main restriction in this process
is a number of available instructions. The manufacturers stick to one
of the two following strategies:

RISC (Reduced Instruction Set Computer)


CISC (Complex Instruction Set Computer)

MVI B, 06
//Load Register B with the Hex value 06
MOV A, B
//Move the value in B to the Accumulator or register A
MVI C, 07
//Load the Register C with the second number 07
ADD C
//Add the content of the Accumulator to the Register C
STA 8200
//Store the output at a memory location e.g. 8200
HLT
//Stop the program execution

LDA 8500
//Load the accumulator with the address of memory viz
8500
MOV B, A
Move the accumulator value to the register B
LDA 8501
//Load the accumulator with the address of memory viz
8501
ADD B
//Add the content of the Accumulator to the Register B
STA 8502
//Store the output at a memory location e.g. 8502
HLT
//Stop the program execution

LDA 8500
//Load the accumulator with the address of memory viz 8500
MOV B, A
Move the accumulator value to the register B
LDA 8501
//Load the accumulator with the address of memory viz 8501
ADD B
//Add the content of the Accumulator to the Register B
STA 8502
//Store the output at a memory location e.g. 8502
MVI A, 00
//clear the accumulator with 00
ADC A
//Add with carry the content of the accumulator
STA 8503
//Store the output at a memory location e.g. 8503
HLT
//Stop the program execution

Write an 8085 assembly language program to


multiply two 8-bit numbers stored at
locations X and Y. Store the 16-bit result in
locations Z and Z+1. Also display the result in
the address field.

Flowchart for the program

Flowchart for solving the problem

m-processor

Address

8080

16

8085

16

8086

19

16

1 Mo

4,77 MHz

80286

23

16

16 Mo

6 MHz

80386

30

32

4 Go

16 MHz

80486

30

32

4 Go

33 MHz

Pentium

30

32

4 Go

60 MHz

Pentium Pro

30

64

4 Go

200 MHz

Pentium II

30

64

4 Go

300 MHz

Pentium III

30

64

4 Go

400 MHz

Pentium IV

30

64 (x2)

4 Go

3+ GHz

Data

Memory

Frequency
3.5 and 6
MHz

Microcontroller PIC16F877A is one of the


PICMicro Family microcontroller which is
popular at this moment, start from beginner
until all professionals. Because very easy
using PIC16F877A and use FLASH memory
technology so that can be write-erase until
thousand times. The superiority this Risc
Microcontroller compared to with other
microcontroller 8-bit especially at a speed of
and his code compression. PIC16F877A have
40 pin by 33 path of I/O

PIC16F877A perfectly fits many uses, from automotive industries


and controlling home appliances to industrial instruments,
remote sensors, electrical doorlocks and safety devices. It is also
ideal for smart cards as well as for battery supplied devices
because of its low consumption.EEPROM memory makes it easier
to apply microcontrollers to devices where permanent storage of
various parameters is needed (codes for transmitters, motor
speed, receiver frequencies, etc.). Low cost, low consumption,
easy handling and flexibility make PIC16F877A applicable even
in areas where microcontrollers had not previously been
considered (example: timer functions, interface replacement in
larger systems, coprocessor applications, etc.).In System
Programmability of this chip (along with using only two pins in
data transfer) makes possible the flexibility of a product, after
assembling and testing have been completed. This capability can
be used to create assembly-line production, to store calibration
data available only after final testing, or it can be used to
improve programs on finished products.

Only 35 single-word instructions to learn


All single-cycle instructions except for
program branches, which are two-cycle
Operating speed: DC 20 MHz clock input
DC 200 ns instruction cycle
Up to 8K x 14 words of Flash Program
Memory, Up to 368 x 8 bytes of Data Memory
(RAM), Up to 256 x 8 bytes of EEPROM Data
Memory
Pinout compatible to other 28-pin or 40/44pin PIC16CXXX and PIC16FXXX
microcontrollers

Timer0: 8-bit timer/counter with 8-bit prescaler


Timer1: 16-bit timer/counter with prescaler, can be
incremented during Sleep via external crystal/clock
Timer2: 8-bit timer/counter with 8-bit period register,
prescaler and postscaler
Two Capture, Compare, PWM modules
Synchronous Serial Port (SSP) with SPI (Master mode) and
I2C (Master/Slave)
Universal Synchronous Asynchronous Receiver
Transmitter (USART/SCI) with 9-bit address detection
Parallel Slave Port (PSP) 8 bits wide with external RD, WR
and CS controls (40/44-pin only)
Brown-out detection circuitry for Brown-out Reset (BOR)

10-bit, up to 8-channel Analog-to-Digital


Converter (A/D)
Brown-out Reset (BOR)
Analog Comparator module (Two analog
comparators , Programmable on-chip voltage
reference (VREF) module , Programmable
input multiplexing from device inputs and
internal voltage reference , Comparator
outputs are externally accessible)

100,000 erase/write cycle Enhanced Flash program


memory typical
1,000,000 erase/write cycle Data EEPROM memory typical
Data EEPROM Retention > 40 years
Self-reprogrammable under software control
In-Circuit Serial Programming (ICSP) via two pins
Single-supply 5V In-Circuit Serial Programming
Watchdog Timer (WDT) with its own on-chip RC oscillator
for reliable operation
Programmable code protection
Power saving Sleep mode
Selectable oscillator options
In-Circuit Debug (ICD) via two pins

Low-power, high-speed Flash/EEPROM


technology
Fully static design
Wide operating voltage range (2.0V to 5.5V)
Commercial and Industrial temperature
ranges
Low-power consumption