You are on page 1of 9

Course Handout for EE-390 (week 1)

Digital Systems Engineering (Microprocessors and Microcontrollers):

(1) PC: Figure below shows the 80x86 microprocessor and other peripherals in mother-board

Monitor
Graphics Parallel
Adapter Printer
Interface

ROM and
RAM
80x86 serial
Controllers Modem
CPU Interface
of Timer,
DMA,
Interrupt

Hard-disk LAN
LAN Hub
Keyboard/ Floppy Adapter
Mouse/ Controller
Speker

Floppy Hard Disk

(2) Micro-controllers: - PC on chip (System on chip). The non-instantly-reprogrammable or


dedicated use microprocessors are called embedded microprocessors or microcontrollers.
- Data controller (hard disk) and event controller (elevator)

(3) Super-computers: In 1976, Cray-1, the 1st super-computer was built


using ECL circuits. The processing speed was 130 MFLOPS.

(4) RISC Processors: In 1980, reduces instruction set computers were designed (for servers)
- required less processor registers, clock cycles, addressing
modes compared to CISC (complex instruction set) computers

1
Internal Architecture of Microprocessor: Employ simultaneous operation

> 3 Million Transistors

Harvard architecture Princeton/Neumann architecture


Instruction
Data Mermory
Memory
Mermory

Address
Address

Instruction
Princeton
Instruction

Harvard
Architecture Architecture
Data
Data

and

Control
and
Control

Output Arithmetic
Output Arithmetic Control
Control Control
Control Input Logic Unit
Input Logic Unit

Clock
Clock Status
Status

Number systems: Bit (One Binary digit), Byte (Consist of Eight Bits), Word (two Bytes), Double-Word

MSB LSB
Addition Substation
2FH = 00101111B = 47D 0–0=0 0+0=0
0 – 1 = -1 (with 0+1=1
borrow)
MS LS 1–0=1 1+0=1
1–1=0 1 + 1 = 10
nibble nibble (the 1 is carried)

2
Dec.  Bin. Operation Quotient Remainder
Example 3: 6D  2D 3D 0  LSB

Convert 6D into 3D  2D 1D 1
Binary number
Thus, 6D = 110B 1D  2D 0D 1  MSB

Binary Decimal Hexadecimal


(base 2) (base 10D) (base 16D or 10H)
0000B 0D 0H
0001B 1D 1H
0010B 2D 2H
0011B 3D 3H
0100B 4D 4H
0101B 5D 5H
0110B 6D 6H
0111B 7D 7H
1000B 8D 8H
1001B 9D 9H
1010B 10 D AH
1011B 11 D BH
1100B 12 D CH
1101B 13 D DH
1110B 14 D EH
1111B 15 D FH
o 10000B 16 D 10 H

3
Software Model of 8088/8086 microprocessor:
Registers used for physical address generation
CPU

Main Memory Instruction pointer, (IP)

Input/Output
Code Segment, (CS)
00000 H 1 Byte
Data Segment, (DS) 0000 H 1 Byte
00001 H 5 AH
Stack Segment, (SS) 0001 H 5 AH
00002 H
Extra Segment, (ES) 0002 H
00003 H 64-KByte of
0003 H
00004 H Accumulator Reg., (AX) bytewide
1-MByte of . input- output
. Base Register, (BX)
byte–wide address
Main . spaces
Counter Register, (CX)
. memory
storage Data Register, (DX)
locations FFFE H F FH
FFFFC H Stack pointer, (SP) FFFF H A 6H
FFFFC H Base pointer, (BP)

FFFFD H Registers used for Processing


Source Index, (SI)

FFFFE H 8 CH Destination Index, (DI) Registers used for physical address generation
FFFFF H A 6H
Status Register, (SR)

Physical Memory
- 80x86 registers are 16-bit or 4-hex digit Address(PA) Contents

00000 H 4 9H
Aligned
- Main memory (RAM)  1 Mega byte (8-bit)
00001 H 5 AH Word
- Note, PA=00001H stores a data Byte of “5AH”, 00002 H 6 2H

Word of “625AH”, 5AHL.S.Byte & 62HM.S.Byte 00003 H F FH Misaligned


00004 H A 7H Word
and Double-word of “A7FF625AH”
.
- MOV AX, 2345H is the same as .

- MOV AL,45H and MOV AH, 23H


FFFFB H 2 5H Misaligned
FFFFC H 0 0H Word
Status Register of CPU (80x86) is expanded here:
FFFFD H 8 CH
Bit .... FFFFE H 1111 0011B Aligned
TF DF IF OF SF ZF AF PF CF
15 FFFFF H A 6H Word

4
(a) Carry Flag (CF): Carry or Borrow occurred from the MSB of DATA. [CY=1 (set) or NC=0 (reset)].
Example: 10001111B +11110000B = 01111111B and CF  CY
(b) Parity FLAG (PF): Depends on the number of binary 1’ in DATA. [PE=1 (set) or PO=0 (reset) 
only for 8086 and 8088]. Example: 10001111B +11110000B = 01111111B and PF  PO
(c) Auxiliary FLAG (AF): Carry or Borrow from the LSNibble of DATA. [AC=1 (set) or NA=0 (reset)].
Ex: 10001111B +01001000B = 11010111B and AF  AC
(d) Zero FLAG (ZF): Previous program-line results in zero DATA. [ZR=1 (set) or NZ=0 (reset)]. Example:
00000001B -00000001B = 0B and ZF  ZR  only for 8086 and 8088….. not for 8051

The 8051 microcontrollers: This chapter discussed the role and importance of microcontrollers
(MC) in everyday life. Microprocessors (MP) and MC will be contrasted and compared. Discussion will
include the use of MC in embedded market and the criteria for selecting a MC for certain application
based on required speed, memory, I/O, packaging and cost per unit. The 2nd section of this chapter
described various families of 8051 with related features.

Timer: count pulses as counter, or generate pulses related time delay  Chapter 9
Oscillator: needs a external qurtz crystal clock generator.
Four I/O ports with 32 pins: P0 = ‘A’/’D’ (ALE=0D), P2=‘A’, P3=control or interrupt
signals (when connected with external memory)
An Interrupt: is an external or internal event that interrupts the MC to inform it that a
device needs its service. Every interrupt has a program associated with it called
the INT service routine. The 8051 has 6 interrupts, 5 of which are user
accessible. Interrupts One is for reset, Two for the timers, Two for the external
hardware interrupts, and One for serial communication interrupt.  Chapter 11

5
Figure 1-2: SFR (special function register), PC, Timers/counters, RAM, -processor (ALU..)

• Typically, microcontroller can perform ONE external task at a time (as programmed in ROM)

• A PC can be used for any number of applications as processor, memory (RAM, ROM) … can
be instantly accessed using keyboard. It often contain several peripherical with inbuilt
microcontrollers (like Mouse, HD, Keyboard…..)

• Home Applications of microcontrollers

• Appliances, intercom, telephones, security systems, garage door openers, answering


machines, fax machines, home computers, TVs, cable TV tuner, VCR, camcorder, remote
controls, video games, cellular phones, musical instruments, sewing machines, lighting
control, paging, camera, pinball machines, toys, exercise equipment

• Office Applications of microcontrollers

• Telephones, computers, security systems, fax machines, microwave, copier, laser printer,
color printer, paging

• Car Applications of microcontrollers

• Trip computer, engine control, air bag, ABS, instrumentation, security system,
transmission control, entertainment, climate control, cellular phone, keyless entry

• Many manufactures of general-purpose microprocessors have targeted their microprocessor for


the high end of the embedded market. In high-performance microcontrollers, the trend is to

6
integrate more functions on the CPU chip and let designer decide which features they wants.
Popular 8-bit microcontrollers
• Motorola’s 6811: Princeton/Von-Neumann architecture
• Intel’s 8051: Harvard architecture
• ARM’s ARM2: RISC microcontroller that uses Princeton/Von-Neumann architecture. It is
mostly suitable for systems that require fast computing, large number of timer and ADC's
• Microchip’s PIC: Harvard architecture and mostly used in Cheap , used in refrigerators and low
budget projects
• Amtel’s AVR: Harvard architecture, has on-chip flash memory (no EPROM)  ARDUINO
Note that 8051 and PIC need multiple clock cycles per instruction. AVR and ARM execute most
instructions in a single clock cycle

8051 and PIC have limited stack space - limited to 128 bytes for the 8051, and as little as 8 words or
less for PIC. Writing a C compiler for these architectures must have been challenging, and compiler
choice is limited.

8051, AVR and ARM can directly address all available RAM. PIC can only directly address 256 bytes
and must use bank switching to extend it at a cost of speed.

• There are also 16-bit and 32-bit microcontrollers made by various chip makers

• Selection Criteria of microcontroller: needs to meet the computing needs of the task at hand
efficiently and cost effectively
• Speed
• Packaging
• Power consumption
• The amount of RAM and ROM on chip
• The number of I/O pins and the timer on chip
• How easy to upgrade to higher-performance or lower power-consumption versions
• Cost per unit
• Availability of software development tools, such as compilers, assemblers, and debuggers

7
• Wide availability and reliable sources of the microcontroller
• The 8051 family has the largest number of diversified (multiple source) suppliers

• Intel introduced 8051, referred as MCS51, in 1981

• The 8051 became widely popular after allowing other manufactures to make and market any
flavor of the 8051, but remaining code-compatible
• The 8051 is a subset of the 8052
- All programs written for 8051 will run in 8052, but not vice versa
- External ROM (<64K) is addressed using 16-pins of port 0 & 1
- UV-EPROM version of 8051 is called 8751 & AMTEL 8051 is AT89C51.
- Has two external hardware interrupt (INT0 & INT1 of last slide & used through pins P3.2
& P3.3) are activated with “0” and use location 0003 and 0031 (pg 326)
• The 8031 is a ROM-less 8051
• Add external ROM to it
• You lose two ports, and leave only 2 ports for I/O operations
- Summary table:

8
- Various 8051 family of microcontrollers:

You might also like