Introduction of microprocessor

• • • • • • CPU for Computers No RAM, ROM, I/O ports on CPU chip itself All components are interfaced externally Becomes bulky costly Example : Intel’s x86, Motorola’s 680x0
CPU GeneralPurpose Microprocessor Data Bus Many chips on mother’s board

RAM

ROM

I/O Port

Timer

Serial COM Port

Address Bus General-Purpose Microprocessor System

Intrduction of Microcontroller
• • • • • Mini computer All the components (Ram,Rom,I/O ports,Timer..) are inbuilt on the single chip Compact size Fast processing Example : Motorola’s 6811, Intel’s 8051, Zilog’s Z8 and PIC 16X

CPU I/O Port

RAM ROM Serial Timer COM Port

A single chip
Microcontroller

Comparison of the 8051 Family Members

Feature 8051 ROM (program space in bytes) 4K RAM (bytes) 128 Timers 2 I/O pins 32 Serial port 1 Interrupt sources 6

8052 8K 256 3 32 1 8

8031 0K 128 2 32 1 6

Contents:
Features Block Diagram Memory Organization Some registers

Block Diagram
External interrupts Interrupt Control On-chip ROM for program code
Timer/Counter

On-chip RAM

Timer 1 Timer 0

Counter Inputs

CPU Serial Port

OSC

Bus Control

4 I/O Ports

P0 P1 P2 P3

TxD RxD

Address/Data

Memory mapping in 8051
• ROM memory map in 8051 family
4k
0000H 0000H

8k
0000H

32k

0FFFH DS5000-32 8751 AT89C51 1FFFH 8752 AT89C52 7FFFH

from Atmel Corporation

from Dallas Semiconductor

• RAM memory space allocation in the 8051
7FH Scratch pad RAM

30H 2FH Bit-Addressable RAM 20H 1FH 18H 17H 10H 0FH 08H 07H 00H Register Bank 3 Register Bank 2 Stack) Register Bank 1)

Register Bank 0

Families of Microcontrollers
8051 MCS (Micro Controller Series): • • • • • • • 89C51 89S51 89C52 89S52 89C1051 89C2051 89C4051

8095 MCS (Micro Controller Series): • • • • • • 8095 8096 8097 8395 8396 8397

The necessary tools for a microprocessor/controller
       

CPU: Central Processing Unit I/O: Input /Output Bus: Address bus & Data bus Memory: RAM & ROM Timer Interrupt Serial Port Parallel Port

Embedded system
Features:
Small size Low power Efficient use of PCB space High performance in small size High MIPS / power consumption ratio High bus bandwidth Low interface bottlenecks

Examples
Products Personal information :
Cell phone, pager, watch, pocket recorder, calculator Watch, pocket recorder, calculator.

Laptop components:
mouse, keyboard, modem, faxcard, sound card, battery charger

Home appliances:
Door lock, alarm clock, thermostat, air conditioner, tv remote, VCR, small refrigerator, exercise equipment, washer/dryer, Microwave oven.

Toys:
Video games, cars, dolls, etc.

What is a microcontroller ?
• A Microcontroller is a small CPU with many support
• • • • • • devices built into the chip Self Contained (CPU, Memory, I/O) Application or Task Specific (Not a general purpose computer) Appropriately scaled for the job Small power consumption Low costs ( $0.50 to $5.00.)

Embedded System
• Embedded system means the processor is embedded into that application. • An embedded product uses a microprocessor or microcontroller to do one task only. • In an embedded system, there is only one application software that is typically burned into ROM. • Example:printer, keyboard, video game player

Registers
A B R0 R1 R2 R3 R4 R5 R6 R7 Some 8-bitt Registers of the 8051 Some 8051 16-bit Register PC PC DPTR DPH DPL

8051 Flag bits and the PSW register
• PSW Register
CY AC F0 RS1 RS0 OV -P

Carry flag Auxiliary carry flag Available to the user for general purpose Register Bank selector bit 1 Register Bank selector bit 0 Overflow flag User define bit Parity flag Set/Reset odd/even parity

PSW.7 PSW.6 PSW.5 PSW.4 PSW.3 PSW.2 PSW.1 PSW.0

CY AC -RS1 RS0 OV -P

RS1 0 0 1 1

RS0 0 1 0 1

Register Bank 0 1 2 3

Address 00H-07H 08H-0FH 10H-17H 18H-1FH

Instructions that Affect Flag Bits:

Note: X can be 0 or 1