0% found this document useful (0 votes)
28 views

Lab 6

The document discusses microprocessors and microcontrollers. It explains that microprocessors are the core components of modern electronic devices that control functions like communication, entertainment and more. Microcontrollers integrate CPU, memory and I/O components onto a single chip. Common microcontrollers include the Intel 8051, which has RAM, ROM, I/O ports and other components integrated onto one chip. The document also describes the architecture of the Intel 8051 microcontroller in detail, including its ports, pins and registers.
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Lab 6

The document discusses microprocessors and microcontrollers. It explains that microprocessors are the core components of modern electronic devices that control functions like communication, entertainment and more. Microcontrollers integrate CPU, memory and I/O components onto a single chip. Common microcontrollers include the Intel 8051, which has RAM, ROM, I/O ports and other components integrated onto one chip. The document also describes the architecture of the Intel 8051 microcontroller in detail, including its ports, pins and registers.
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 25

LAB 6

Why do we need to learn


Microprocessors/controllers?

The microprocessor is the core of computer systems.

Nowadays communication, digital entertainment, portable


devices, are controlled by them.
The necessary tools for a
microprocessor/controller
 CPU: Central Processing Unit
 I/O: Input /Output
 Memory: RAM & ROM
 Timer
 Interrupt
 Serial Port
 Parallel Port
General-Purpose Microprocessor

 CPU for Computers


 No RAM, ROM, I/O on CPU chip itself
 Example : Intel’s x86, Pentium

Many chips on mother’s board


Data Bus
CPU
General-
Serial
Purpose RAM ROM I/O Timer COM
Micro- Port
Port
processor
Address Bus

General-Purpose Microprocessor System


Microcontroller

 A smaller computer
 On-chip RAM, ROM, I/O ports...
 Example : Intel’s 8051, Zilog’s Z8 and PIC 16X

CPU RAM ROM


A single chip
Serial
I/O Timer COM
Port
Port
Microcontroller
Applications
 Microcontrollers for embedded systems
Embedded System
General Block Diagram

Sensor Sensor conditioning

Output interfaces
Feedback

Sensor Microcontroller
(uC)
Indicator

Sensor
Pin Description of the 8051
P1.0 1 40 Vcc
P1.1 2 39 P0.0
P1.2 3 38 P0.1
P1.3
P1.4
4
5
8051 37
36
P0.2
P0.3
P1.5 6 35 P0.4
P1.6 7 34 P0.5
P1.7 8 33 P0.6
RST 9 32 P0.7
(RXD)P3.0 10 31 EA/VPP
(TXD)P3.1 11 30 ALE/PROG
(INT0)P3.2 12 29 PSEN
(INT1)P3.3 13 28 P2.7
(T0)P3.4 14 27 P2.6
(T1)P3.5 15 26 P2.5
P3.6 16 25 P2.4
P3.7 17 24 P2.3
XTAL2 18 23 P2.2
XTAL1 19 22 P2.1
GND 20 21 P2.0
PINS

 Vcc ( pin 40 ):
 Vcc provides supply voltage to the chip.
 The voltage source is +5V.

 GND ( pin 20 ): ground

 XTAL1 and XTAL2 ( pins 19,18 )


PINS
 The 8051 has four I/O ports
 Port 0 ( pins 32-39 ): P0 ( P0.0 ~ P0.7 )
 Port 1 ( pins 1-8 ) : P1 ( P1.0 ~ P1.7 )
 Port 2 ( pins 21-28 ): P2 ( P2.0 ~ P2.7 )
 Port 3 ( pins 10-17 ): P3 ( P3.0 ~ P3.7 )
 Each port has 8 pins.
 Named P0.X ( X=0,1,...,7 ) , P1.X, P2.X, P3.X
 Ex : P0.0 is the bit 0 ( LSB ) of P0
 Ex : P0.7 is the bit 7 ( MSB ) of P0
 These 8 bits form a byte.
 Each port can be used as input or output (bi-direction).

Figure (a). XTAL Connection to 8051

 Using a crystal oscillator


 We can observe the frequency on the XTAL2 pin.

C2
XTAL2
30pF

C1
XTAL1
30pF

GND


PINS
 RST ( pin 9 ): reset
 It is an input pin and is active high ( normally low ) .

 The high pulse must be high at least 2 machine cycles.


 It is a power-on reset.

 Upon applying a high pulse to RST, the microcontroller


will reset and all values in registers will be lost.
 Reset values of some 8051 registers
PINS
 EA ( pin 31 ): external access
 The EA pin is connected to GND to indicate the code is
stored externally.
 PSEN & ALE are used for external ROM.

 For 8051, EA pin is connected to Vcc.


PINS
 ALE ( pin 30 ): address latch enable
 It is an output pin and is active high.
 8051 port 0 provides both address and data.
 The ALE pin is used for de-multiplexing the address
and data

 I/O port pins


 The four ports P0, P1, P2, and P3.
 Each port uses 8 pins.
 All I/O pins are bi-directional.
Power-On RESET Circuit
LANGUAGES
Machine Language
 Early when computer was first invented, there programs are
prepared in machine language using a code based on the
binary number system (0`s & 1`s).

 Note: Computers are Digital Systems i.e. All of their


working occurs in the forms of 0`s and 1`s.

 This method of giving instructions soon limited the


complexity of the problems because even the simplest
program consists of thousands of 0`s and 1`s. So, Assembly
Language is introduced.
Assembly Language (Low-Level Language)

 They are considered the second generation of programming languages.


Assembly Language allows a programmer to design a program and
translate it into machine language using a piece of software called an
assembler.

 “In other words, you can design your program using English language
words i.e. abbreviations”.

 However, the biggest disadvantage of assembly language is that they


are processor specific. This means that programs written in assembly
language will only work on processor similar one of the machine that
they are written to. Like, Assembly code written for Intel Processor
based machine cannot run on IBM Processor based machine.
High-Level Language

 They are considered as the Third generation language. They are similar to
Assembly Language but they are not processor specific.

 A program written in this language will be able to run on any machine.

 Third generation languages are much more abstract than assembly language i.e. it
is closer to English Language and more user friendly.

 Programs written in High-Level Language are translated into machine language by


a software called compiler.
INSIDE 8051
MOV DESTINATION, SOURCE
Inside 8051
 For the CPU to process information, the data must
be stored in RAM or ROM, which are referred to
as memory

 ROM provides information that is fixed and


permanent
 Tables or initialization program

 RAM stores information that is not permanent and


can change with time
Registers
 The CPU uses registers to store information
temporarily
 Values to be processed
 Address of value to be fetched from memory
 In general, the more and bigger the registers, the
better the CPU
 Registers can be 8-, 16-, 32-, or 64-bit
 The disadvantage of more and bigger registers is
the increased cost of such a CPU
8051
 In 1981, Intel Corporation introduced an 8-bit
microcontroller called the 8051.

 The 8051 is an 8-bit processor, meaning that the CPU


can work on only 8 bits of data at a time.

 Data larger than 8 bits has to be broken into 8-bit


pieces to be processed by the CPU.
Registers
MOV destination, source

You might also like