You are on page 1of 35

Automatics

AutomaticsTrainings
TrainingGroup
Group

Microchip 8 Bits

Introduction

Analog vs Digital

Number Systems

P vs. C

Microcontrollers

Microprocessors

Microcomputers

I/O Systems
Embedded Electronics
Microchip Microcontroller
Buses

Memories

Embedded Systems

www.automatics.pk
Automatics Trainings Group

Microchip 8 Bits

Introduction

Analog vs Digital

Number Systems

P vs. C Advanced PIC Micro-controller Programming


Microcontrollers

Microprocessors Lecture1
Microcomputers

I/O Systems

Buses

Memories

Embedded Systems
2
www.automatics.pk
Automatics Trainings Group

Digital vs. Analog


Microchip 8 Bits

Introduction Analog infinite resolution


Analog vs Digital Like(old fashioned) radio dial
Number Systems
Well do very little with analog
VGA, maybe sound
P vs. C

Microcontrollers Digital a finite set of values


Microprocessors Likemoney
Microcomputers Cant get smaller than cents
I/O Systems Typically also has maximum value
Buses

Memories

Embedded Systems
3
www.automatics.pk
Automatics Trainings Group

Binary Signaling
Microchip 8 Bits

Introduction

Analog vs Digital Zero volts

Number Systems
FALSE or 0
P vs. C
3.3 or 5 volts
Microcontrollers
TRUE or 1
Microprocessors Modern chips down to 1V

Microcomputers

I/O Systems

Buses

Memories

Embedded Systems
4
www.automatics.pk
Automatics Trainings Group

Binary Numbers
Microchip 8 Bits

Introduction Strings of binary digits (bits)


Analog vs Digital One bit can store a number i.e. 0 or 1
Number Systems
n bits can store numbers from 0 to 2n
P vs. C
Each digit represents a power of 2
Microcontrollers So 101 binary is
Microprocessors 1 22 + 0 21 + 1 20
Microcomputers or
I/O Systems 14 + 02 + 11=5
Buses

Memories

Embedded Systems
5
www.automatics.pk
Automatics Trainings Group

Converting Binary to Decimal


Microchip 8 Bits

Introduction Easy, just multiply digit by power of 2


Analog vs Digital
Just like a decimal number is represented
Number Systems

Example follows
P vs. C

Microcontrollers

Microprocessors

Microcomputers

I/O Systems

Buses

Memories

Embedded Systems
6
www.automatics.pk
Automatics Trainings Group

Binary Decimal Example


Microchip 8 Bits

Introduction

Analog vs Digital 7 6 5 4 3 2 1 0
Number Systems

P vs. C
27 26 25 24 23 22 21 20
Microcontrollers 128 64 32 16 8 4 2 1
Microprocessors

Microcomputers What is 10011100 in decimal?


I/O Systems
1 0 0 1 1 1 0 0
Buses

Memories
128 + 0 + 0 + 16 + 8 + 4 + 0 + 0 = 156
Embedded Systems
7
www.automatics.pk
Automatics Trainings Group

Decimal to Binary
Microchip 8 Bits

Introduction A little more work than binary to decimal


Analog vs Digital
Some examples
Number Systems
3 = 2 + 1 = 11 (thats 121 + 120)
P vs. C
5 = 4 + 1 = 101 (thats 122 + 021 + 120)
Microcontrollers

Microprocessors

Microcomputers

I/O Systems

Buses

Memories

Embedded Systems
8
www.automatics.pk
Automatics Trainings Group

Hexadecimal
Microchip 8 Bits

Introduction Strings of 0s and 1s too hard to write


Analog vs Digital Use base-16 or hexadecimal 4 bits
Number Systems

P vs. C Dec Bin Hex Dec Bin Hex


0 0000 0 8 1000 8
Microcontrollers
1 0001 1 9 1001 9
Microprocessors
2 0010 2 10 1010 ?
Microcomputers 3 0011 3 11 1011 ?
I/O Systems 4 0100 4 12 1100 ?
5 0101 5 13 1101 ?
Buses
6 0110 6 14 1110 ?
Memories
7 0111 7 15 1111 ?
Embedded Systems
9
www.automatics.pk
Automatics Trainings Group

Hex to Binary
Microchip 8 Bits Bin Hex

Introduction Convention write 0x before number 0000 0

Analog vs Digital
Hex to Binary just convert digits 0001 1
0010 2
Number Systems 0011 3

P vs. C 0100 4
0101 5
Microcontrollers

Microprocessors
0x2ac 0110
0111
6
7
Microcomputers 1000 8
1001 9
I/O Systems
0010 1010 1100 1010 a
Buses
1011 b
0x2ac = 001010101100 1100 c
Memories

1101 d
Embedded Systems Remember hex digit = 4 bits 1110 10 e
1111 f
www.automatics.pk
Automatics Trainings Group

Octal
Microchip 8 Bits

Introduction Octal is base 8


Analog vs Digital
Similar to hexadecimal
Number Systems
Conversions
P vs. C
Less convenient for use with 8-bit bytes
Microcontrollers

Microprocessors

Microcomputers

I/O Systems

Buses

Memories

Embedded Systems
11
www.automatics.pk
Automatics Trainings Group

Introduction
Microchip 8 Bits

Introduction Microprocessor (P)(MPU)


A P is a CPU on a single chip.
Analog vs Digital
Components of CPU
Number Systems
ALU, instruction decoder, registers, bus control
P vs. C
circuit, etc.
Microcontrollers
Micro-computer (-Computer)
Microprocessors small computer
Microcomputers P + peripheral I/O + memory specifically for

I/O Systems
data acquisition and control applications
Buses
Microcontroller (C)
Memories u-Computer on a single chip of silicon
Embedded Systems
12
www.automatics.pk
Automatics Trainings Group

P vs. C
Microchip 8 Bits

Introduction
A P
only is a single-chip CPU
Analog vs Digital bus is available
Number Systems
RAM capacity, num of port is selectable
RAM is larger than ROM (usually)
P vs. C

Microcontrollers A C
contains a CPU and RAM,ROM ,Peripherals,
Microprocessors
I/O port in a single IC
Microcomputers internal hardware is fixed
Communicate by port
I/O Systems
ROM is larger than RAM (usually)
Buses Small power consumption
Single chip, small board
Memories
Implementation is easy
Embedded Systems Low cost
13
www.automatics.pk
Automatics Trainings Group

P vs. C cont.
Microchip 8 Bits

Introduction

Analog vs Digital Applications


Number Systems Cs are suitable to
P vs. C control of I/O devices in
Microcontrollers designs requiring a
Microprocessors
minimum component
Microcomputers
Ps are suitable to

I/O Systems
processing information
Buses
in computer systems.
Memories

Embedded Systems

www.automatics.pk
Automatics Trainings Group

P vs. C cont.
Microchip 8 Bits

Introduction
C is easy to use and design.
Only single chip can be a complete system
Analog vs Digital

Number Systems
interfacing to other devices,
P vs. C
for example, motors, displays, sensors, and
Microcontrollers
communicate with PC.
Microprocessors
In contrast, similar system that builds
Microcomputers
from P would require a lot of
I/O Systems
additional units,
Buses
such as RAM, UART, I/O , TIMER and etc.
Memories

Embedded Systems
15
www.automatics.pk
Automatics Trainings Group

C is a Reusable Hardware
Microchip 8 Bits

Introduction Logic circuit provides limited function for


Analog vs Digital one single design. In order to change circuits
Number Systems functionality, we need to redesign the
P vs. C
circuits.
C can reprogram and change functionality
Microcontrollers
of every port, input to output or digital to
Microprocessors
analog on the fly.
Microcomputers

I/O Systems

Buses

Memories

Embedded Systems
16
www.automatics.pk
Automatics Trainings Group

Microcontrollers
Microchip 8 Bits

Introduction Many Cs are existing right now.


Analog vs Digital PIC, 8051, 68HC11, MSP430, ARM series, and etc.
Number Systems We may widely divide it with how it is
P vs. C designed
Microcontrollers
RISC/CISC architecture.
Microprocessors
What is the main difference between
Microcomputers
RISC/CISC
I/O Systems
Does it make any difference to our
Buses
application?
Memories

Embedded Systems
17
www.automatics.pk
Automatics Trainings Group

The Microprocessor (MPU)


Microchip 8 Bits

Introduction The P is the brain of the microcomputer


Analog vs Digital Is a single chip which is capable of
Number Systems processing data
controlling all of
the components which make up the
P vs. C
microcomputer system
Microcontrollers P used to sequence executions of
Microprocessors instructions that is in memory
Microcomputers P Fetch , Decode , and Execute the
I/O Systems instruction
Buses The internal architecture of the
Memories microprocessor is complex.
Embedded Systems
18
www.automatics.pk
Automatics Trainings Group

The Microprocessor (MPU)


Microchip 8 Bits

Introduction
Microprocessor (MPU) typically contains
Analog vs Digital
Registers: Temporary storage locations for program
Number Systems
instruction or data.
P vs. C
The Arithmetic Logic unit (ALU): This part of the
Microcontrollers
MPU performs both arithmetic and logical???
Microprocessors

Microcomputers
operations
I/O Systems
Timing and Control Circuits: that keep all of the
Buses
other parts of system (Regs, ALU, memory & I/O)
Memories working together in the right time sequence
Embedded Systems
19
www.automatics.pk
Automatics Trainings Group

Microcomputers
Microchip 8 Bits

Introduction
All Microcomputers consist of (at least)
Analog vs Digital 1. Microprocessor Unit (MPU)
Number Systems 2. Program Memory (ROM)
P vs. C 3. Data Memory (RAM)
Microcontrollers 4. Input / Output ports
Microprocessors 5. Bus System
Microcomputers (and Software)
I/O Systems

Buses MPU is the brain of microcomputer


Memories

Embedded Systems
20
www.automatics.pk
Automatics Trainings Group

Microcomputers
Microchip 8 Bits

Introduction

Analog vs Digital

Number Systems

P vs. C

Microcontrollers

Microprocessors

Microcomputers

I/O Systems

Buses

Memories

Embedded Systems
21
www.automatics.pk
Automatics Trainings Group

The Input/Output (I/O) System


Microchip 8 Bits

Introduction I/O is the link between the MPU and the


Analog vs Digital outside world.
Number Systems An input port is a circuit through which an
P vs. C external device can send signals (data?) to
Microcontrollers the MPU. Eg
Microprocessors An output port is a circuit that allows the
Microcomputers MPU to send signals (data?) to external
I/O Systems
devices. Eg.
Buses I/O ports connect both digital and analogue
Memories devices by DAC and ADC
Embedded Systems
22
www.automatics.pk
Automatics Trainings Group

Bus
Microchip 8 Bits

Introduction A Bus is a common communications pathway


Analog vs Digital used to carry information between the various
Number Systems elements of a computer system
P vs. C
The term BUS refers to a group of wires or
Microcontrollers conduction tracks on a printed circuit board
Microprocessors (PCB) though which binary information is
Microcomputers
transferred from one part of the microcomputer
I/O Systems
to another
Buses The individual subsystems of the digital
Memories computer are connected through an
Embedded Systems
interconnecting BUS system.
23
www.automatics.pk
Automatics Trainings Group

Bus
Microchip 8 Bits

Introduction
There are three main bus groups
Analog vs Digital
ADDRESS BUS
Number Systems
DATA BUS
P vs. C
CONTROL BUS
Microcontrollers

Microprocessors

Microcomputers

I/O Systems

Buses

Memories

Embedded Systems
24
www.automatics.pk
Automatics Trainings Group

Data Bus
Microchip 8 Bits

Introduction
The Data Bus carries the data which is
Analog vs Digital
transferred throughout the system.
Number Systems
( bi-directional)
Examples of data transfers
P vs. C

Microcontrollers
Program instructions being read from memory into
Microprocessors
MPU.
Microcomputers Data being sent from MPU to I/O port
I/O Systems
Data being read from I/O port going to MPU
Results from MPU sent to Memory
Buses

Memories
These are called read and write
Embedded Systems
operations
25
www.automatics.pk
Automatics Trainings Group

Address Bus
Microchip 8 Bits

Introduction
An address is a binary number that
Analog vs Digital
identifies a specific memory storage
Number Systems
location or I/O port involved in a data
P vs. C

Microcontrollers
transfer
Microprocessors
The Address Bus is used to transmit
Microcomputers
the address of the location to the
I/O Systems
memory or the I/O port.
Buses The Address Bus is unidirectional
Memories ( one way ): addresses are always
Embedded Systems issued by the MPU.
26
www.automatics.pk
Automatics Trainings Group

Control Bus
Microchip 8 Bits

Introduction
The Control Bus: is another group of
Analog vs Digital
signals whose functions are to provide
Number Systems
synchronization ( timing control )
P vs. C
between the MPU and the other system
Microcontrollers

Microprocessors
components.
Microcomputers
Control signals are unidirectional, and
I/O Systems
are mainly outputs from the MPU.
Buses Example Control signals
RD:read signal asserted to read data into MPU
Memories
WR: write signal asserted to write data from MPU
Embedded Systems
27
www.automatics.pk
Automatics Trainings Group

Main memory
Microchip 8 Bits

Introduction The duties of the memory are :


Analog vs Digital To store programs
To provide data to the MPU on request
Number Systems
To accept result from the MPU for storage
P vs. C

Microcontrollers Main memory Types


Microprocessors ROM : read only memory. Contains program
(Firmware). does not lose its contents when
Microcomputers
power is removed (Non-volatile)
I/O Systems RAM: random access memory (read/write
Buses
memory) used as variable data, loses contents
when power is removed volatile. When power
Memories
up will contain random data values
Embedded Systems
28
www.automatics.pk
Automatics Trainings Group

Read-Only Memory
Microchip 8 Bits

Introduction
P can read instructions from ROM
Analog vs Digital
quickly
Cannot write new data to the ROM
Number Systems

ROM remembers the data, even after


P vs. C

Microcontrollers

Microprocessors
power cycled
Microcomputers
Typically, when the power is turned on,
I/O Systems
the microprocessor will start fetching
Buses instructions from the still-remembered
Memories program in ROM (bootstrap )
Embedded Systems
29
www.automatics.pk
Automatics Trainings Group

Available ROMs
Microchip 8 Bits

Introduction Masked ROM or just ROM


Analog vs Digital PROM or programmable ROM(once only)
Number Systems EPROM (erasable via ultraviolet light)
P vs. C
Flash (can be erased and re-written about 10000
Microcontrollers
times, usually must write a whole block not just
1 byte or 2 bytes, slow writing, fast reading)
EEPROM (electrically erasable read-only
Microprocessors

Microcomputers
memory, also known as EEROMboth reading
I/O Systems
and writing are very slow but can program
Buses millions of timesuseless for storing a program
Memories but good for say configuration information.
Embedded Systems
30
www.automatics.pk
Automatics Trainings Group

RAM (Random Access Memory)


Microchip 8 Bits

Introduction The P can read the data from RAM quickly


Analog vs Digital The P can write new data quickly to RAM
Number Systems RAM forgets its data if power is turned off
P vs. C Two type of is available :
Microcontrollers Static RAM(SRAM): ff base, fast, expensive,
Microprocessors low cap/vol, applied for cache , no refresh
Microcomputers Dynamic RAM (DRAM): cap base, slow , low
I/O Systems
cost high capacity/volume , applied for main
Buses
memory(pc) need refresh.
Memories

Embedded Systems
31
www.automatics.pk
Automatics Trainings Group

Embedded System
Microchip 8 Bits

Introduction An embedded system is closely


Analog vs Digital integrated with the main
Number Systems
system
It may not interact directly
P vs. C
with the environment
Microcontrollers For example A
Microprocessors microcomputer in a car
Microcomputers
ignition control
I/O Systems
An embedded product uses a microprocessor or
Buses microcontroller to do one task only
Memories There is only one application software that is typically
Embedded Systems
burned into ROM
32
www.automatics.pk
Automatics Trainings Group

Examples of Embedded Systems


Microchip 8 Bits

Introduction Keyboard
Analog vs Digital Printer
Number Systems video game player
P vs. C MP3 music players
Microcontrollers Embedded memories to keep
Microprocessors configuration information
Microcomputers Mobile phone units
I/O Systems Domestic (home) appliances
Buses Data switches
Memories Automotive controls
Embedded Systems
33
www.automatics.pk
Automatics Trainings Group

Three criteria in Choosing a Microcontroller


Microchip 8 Bits

Introduction Meeting the computing needs of the task


Analog vs Digital
efficiently and cost effectively
Number Systems speed, the amount of ROM and RAM, the number of
P vs. C I/O ports and timers, size, packaging, power
Microcontrollers
consumption
easy to upgrade
Microprocessors
cost per unit
Microcomputers
Availability of software development tools
I/O Systems Assemblers, debuggers, C compilers, emulator,
Buses simulator, technical support
Memories Wide availability and reliable sources of
Embedded Systems the microcontrollers
34
www.automatics.pk
Automatics Trainings Group

Automatics Training Group


Microchip 8 Bits

Introduction

Analog vs Digital

Number Systems

P vs. C

Microcontrollers
Thank you
Microprocessors

Microcomputers

I/O Systems

Buses

Memories

Embedded Systems

www.automatics.pk

You might also like