Up Done
Up Done
By
Mr. C.JAGADEESHWARAN
ASSISTANT PROFESSOR
being prepared by me and it meets the knowledge requirement of the university curriculum.
Name: C.Jagadeeshwaran
This is to certify that the course material being prepared by Mr. C.Jagadeeshwaran is of adequate
quality. He has referred more than five books amont them minimum one is from aborad author.
Signature of HD
Name: S.Sriram
CONTENTS
AIM
To introduce Microprocessor Intel 8085 and 8086 and the Micro Controller 8051
OBJECTIVES
Hardware Architecture pintouts - Signals – Memory interfacing – I/O ports and data transfer concepts –
Timing Diagram – Interrupt structure.
Instruction format and addressing modes – Assembly language format – Data transfer, data manipulation
& control instructions – Programming: Loop structure with counting & Indexing - Look up table -
Subroutine instructions - stack.
Study of Architecture and programming of ICs: 8255 PPI, 8259 PIC, 8251 USART, 8279 Key board
display controller and 8253 Timer/ Counter – Interfacing with 8085 - A/D and D/A converter interfacing.
Functional block diagram - Instruction format and addressing modes – Timing Diagram Interrupt
structure – Timer –I/O ports – Serial communication.
Data Transfer, Manipulation, Control & I/O instructions – Simple programming exercises key board and
display interface – Closed loop control of servo motor- stepper motor control - Washing Machine
Control.
L = 45 T = 15 TOTAL : 60 PERIODS
TEXT BOOKS
1. “Microprocessor and Microcontrollers”, Krishna Kant Eastern Company Edition, Prentice – Hall of
India, New Delhi , 2007.
2. Muhammad Ali Mazidi & Janice Gilli Mazidi, R.D.Kinely ‘The 8051 Micro Controller and
Embedded Systems’, PHI Pearson Education, 5th Indian reprint, 2003.
REFERENCES
1. R.S. Gaonkar, ‘Microprocessor Architecture Programming and Application’, Wiley Eastern Ltd.,
New Delhi.
2. The 8088 & 8086 Microprocessors , Walter A Tribal & Avtar Singh, Pearson, 2007, Fourth Edition.
EE2354 MICROPROCESSOR AND MICROCONTROLLER
UNIT - 1
Control Unit:
Generates signals within Microprocessor to carry out the instruction, which has been decoded.
In reality causes certain connections between blocks of the µP to be opened or closed, so that data
goes where it is required, and so that ALU operations occur.
The ALU performs the actual numerical and logic operation such as add, subtract, AND, OR, etc.
Uses data from memory and from Accumulator to perform arithmetic. Always stores result of operation
in Accumulator.
Registers:
The 8085/8080A-programming model includes six registers, one accumulator, and one flag
register, as shown in Figure. In addition, it has two 16-bit registers: the stack pointer and the program
counter. The 8085/8080A has six general-purpose registers to store 8-bit data; these are identified as B,
C, D, E, H, and L as shown in the figure. They can be combined as register pairs - BC, DE, and HL
- to perform some 16-bit operations. The programmer can use these registers to store or copy data into
the registers by using data copy instructions.
Accumulator:
The accumulator is an 8-bit register that is a part of arithmetic/logic unit (ALU). This register
is used to store 8-bit data and to perform arithmetic and logical operations. The result of an operation
is stored in the accumulator. The accumulator is also identified as register A.
Flags:
The ALU includes five flip-flops, which are set or reset after an operation according to data
conditions of the result in the accumulator and other registers. They are called Zero (Z), Carry (CY),
Sign (S), Parity (P), and Auxiliary Carry (AC) flags. The most commonly used flags are Zero, Carry,
and Sign. The microprocessor uses these flags to test data conditions.
For example, after an addition of two numbers, if the sum in the accumulator id larger than eight
bits, the flip-flop uses to indicate a carry -- called the Carry flag (CY) – is set to one. When an arithmetic
operation results in zero, the flip-flop called the Zero (Z) flag is set to one. The first Figure shows an
8-bit register, called the flag register, adjacent to the accumulator. However, it is not used as a register;
five bit positions out of eight are used to store the outputs of the five flip-flops. The flags are stored in
the 8-bit register so that the programmer can examine these flags (data conditions) by accessing the
register through an instruction.
These flags have critical importance in the decision-making process of the microprocessor. The
conditions (set or reset) of the flags are tested through the software instructions. For example, the
instruction JC (Jump on Carry) is implemented to change the sequence of a program when CY flag is
set.
This 16-bit register deals with sequencing the execution of instructions. This register is a memory
pointer. Memory locations have 16-bit addresses, and that is why this is a16-bit register. The
microprocessor uses this register to sequence the execution of the instructions. The function of the
program counter is to point to the memory address from which the next byte is to be fetched. When a
byte (machine code) is being fetched, the program counter is incremented by one to point to the next
memory location
The stack pointer is also a 16-bit register used as a memory pointer. It points to a memory
location in R/W memory, called the stack. The beginning of the stack is defined by loading 16- bit
address in the stack pointer.
Instruction Register/Decoder:
Temporary store for the current instruction of a program. Latest instruction sent here from
memory prior to execution. Decoder then takes instruction and „decodes‟ or interprets the instruction.
Decoded instruction then passed to next stage.
Holds address, received from PC, of next program instruction. Feeds the address bus with
Control Generator:
Generates signals within µP to carry out the instruction which has been decoded.
In reality causes certain connections between blocks of the µP to be opened or closed, so that
data goes where it is required, and so that ALU operations occur.
Register Selector:
This block controls the use of the register stack in the example. Just a logic circuit which switches
between different registers in the set will receive instructions from Control Unit.
Address Bus: The most significant 8 bits of the memory address or the 8 bits of the I/0 address,3
stated during Hold and Halt modes.
Multiplexed Address/Data Bus; Lower 8 bits of the memory address (or I/0 address) appear on
the bus during the first clock cycle of a machine state. It then becomes thedata bus during the second
and third clock cycles. 3 stated during Hold and Halt modes.
ALE (Output):
Address Latch Enable: It occurs during the first clock cycle of a machine state and enables
the address to get latched into the on chip latch of peripherals. The falling edge of ALE is set to
guarantee setup and hold times for the address information. ALE can also be used to strobe the status
information. ALE is never 3stated.
SO, S1 (Output):
S1 S0
0 0 HALT
0 1 WRITE
1 0 READ
RD (Output 3state):
READ: indicates the selected memory or I/0 device is to be read and that the Data Bus is available
for the data transfer.
WR (Output 3state):
WRITE: indicates the data on the Data Bus is to be written into the selected memory or I/0
location. Data is set up at the trailing edge of WR. 3stated during Hold and Halt modes.
READY (Input):
If Ready is high during a read or write cycle, it indicates that the memory or peripheral is ready
to send or receive data. If Ready is low, the CPU will wait for Ready to go high before completing the
read or write cycle.
HOLD (Input):
HOLD: indicates that another Master is requesting the use of the Address and Data Buses. The
CPU, upon receiving the Hold request will relinquish the use of buses as soon as the completion of the
current machine cycle. Internal processing can continue. The processor can regain the buses only after
the Hold is removed. When the Hold is acknowledged, the Address, Data, RD, WR, and IO/M lines
are 3stated.
HLDA (Output):
HOLD ACKNOWLEDGE: indicates that the CPU has received the Hold request and that it will
relinquish the buses in the next clock cycle. HLDA goes low after the Hold request is removed. The
CPU takes the buses one half clock cycle after HLDA goes low.
INTR (Input):
INTERRUPT REQUEST is used as a general purpose interrupt. It is sampled only during the
next to the last clock cycle of the instruction. If it is active, the Program Counter (PC) will be inhibited
from incrementing and an INTA will be issued. During this cycle a RESTART or CALL instruction
can be inserted to jump to the interrupt service routine. The INTR is enabled and disabled by software.
It is disabled by Reset and immediately after an interrupt is accepted.
INTA (Output):
INTERRUPT ACKNOWLEDGE: is used instead of (and has the same timing as) RDduring the
Instruction cycle after an INTR is accepted. It can be used to activate the 8259 Interrupt chip or
some other interrupt port.
RESTART INTERRUPTS:
These three inputs have the same timing as INTR except they cause an internal
RESTART to be automatically inserted.
TRAP (Input):
Trap interrupt is a non maskable restart interrupt. It is recognized at the same time as INTR. It
is unaffected by any mask or Interrupt Enable. It has the highest priority of any interrupt.
RESET IN (Input):
Reset sets the Program Counter to zero and resets the Interrupt Enable and HLDA flipflops.
None of the other flags or registers (except the instruction register) are affected The CPU is held in the
reset condition as long as Reset is applied.
Indicates CPlJ is being reset. Can be used as a system RESET. The signal is synchronized to the
processor clock.
X1, X2 (Input):
Crystal or R/C network connections to set the internal clock generator X1 can also be an external
clock input instead of a crystal. The input frequency is divided by 2 to give the internal operating
frequency.
CLK (Output):
Clock Output for use as a system clock when a crystal or R/ C network is used as an input to the
CPU. The period of CLK is twice the X1, X2 input period.
IO/M (Output):
IO/M indicates whether the Read/Write is to memory or l/O Tristated during Hold and Halt
modes.
SID (Input):
Serial input data line The data on this line is loaded into accumulator bit 7 whenever a RIM
instruction is executed.
SOD (output):
Serial output data line. The output SOD is set or reset as specified by the SIM instruction.
Vcc:
+5 volt supply.
Vss:
Ground Reference.
The memory is made up of semiconductor material used to store the programs and data. Three
types of memory is,
Process memory
Primary or main memory
Secondary memory
2764/6264 8 kb 13 8
27256/62256 32 kb 15 8
27512/62512 64 kb 16 8
27010/62128 128 kb 17 8
27020/62138 256 kb 18 8
27040/62148 512 kb 19 8
A typical semiconductor memory IC will have n address pins, m data pins (or output pins).
Having two power supply pins (one for connecting required supply voltage (V and the other for
connecting ground).
The control signals needed for static RAM are chip select (chip enable), read control (output
enable) and write control (write enable).
The control signals needed for read operation in EPROM are chip select (chip enable) and read
control (output enable).
Input Output
B A Y3 Y2 Y1 Y0
0 0 1 1 1 0
0 1 1 1 0 1
1 0 1 0 1 1
1 1 0 1 1 1
Consider a system in which the full memory space 64kb is utilized for EPROM memory.
Interface the EPROM with 8085 processor. The memory capacity is 64 Kbytes. i.e 2^n = 64 x 1000
bytes where n = address lines. So, n = 16.
In this system the entire 16 address lines of the processor are connected to address input pins of
memory IC in order to address the internal locations of memory. The chip select (CS) pin of EPROM is
permanently tied to logic low (i.e., tied to ground).
Since the processor is connected to EPROM, the active low RD pin is connected to active low
output enable pin of EPROM. The range of address for EPROM is 0000H to FFFFH.
Timing Diagram is a graphical representation. It represents the execution time taken by each
instruction in a graphical format. The execution time is represented in T-states.
Instruction Cycle:
Machine Cycle:
The time required to access the memory or input/output devices is called machine cycle.
T-State:
The machine cycle and instruction cycle takes multiple clock periods.
A portion of an operation carried out in one system clock period is called as T-state.
The 8085 microprocessor has 5 (seven) basic machine cycles. They are
The memory read machine cycle is executed by the processor to read a data byte from memory.
The processor takes 3T states to execute this cycle.
The instructions which have more than one byte word size will use the machine cycle after the
opcode fetch machine cycle.
Fig 1.9 Memory Read Machine Cycle
The memory write machine cycle is executed by the processor to write a data byte in a memory
location.
The processor takes, 3T states to execute this machine cycle.
The I/O Read cycle is executed by the processor to read a data byte from I/O port or from the
peripheral, which is I/O, mapped in the system.
The processor takes 3T states to execute this machine cycle.
The IN instruction uses this machine cycle during the execution.
STA means Store Accumulator -The contents of the accumulator is stored in the specified address
(526A).
The opcode of the STA instruction is said to be 32H. It is fetched from the memory 41FFH (see
fig). - OF machine cycle
Then the lower order memory address is read (6A). - Memory Read Machine Cycle
Read the higher order memory address (52).- Memory Read Machine Cycle
The combination of both the addresses are considered and the content from accumulator is
written in 526A. - Memory Write Machine Cycle
Assume the memory address for the instruction and let the content of accumulator is C7H. So,
C7H from accumulator is now stored in 526A.
Fetching the Opcode 34H from the memory 4105H. (OF cycle)
Let the memory address (M) be 4250H. (MR cycle -To read Memory address and data)
Let the content of that memory is 12H.
Increment the memory content from 12H to 13H. (MW machine cycle)
1.5 Interrupts
Interrupt is signals send by an external device to the processor, to request the processor to
perform a particular task or work.
Mainly in the microprocessor based system the interrupts are used for data transfer between the
peripheral and the microprocessor.
The processor will check the interrupts always at the 2nd T-state of last machine cycle.
If there is any interrupt it accept the interrupt and send the INTA (active low) signal to the
peripheral.
The vectored address of particular interrupt is stored in program counter.
The processor executes an interrupt service routine (ISR) addressed in program counter.
It returned to main program by RET instruction.
1.5.1Types of Interrupts:
Hardware
Software
The software interrupts are program instructions. These instructions are inserted at desired
locations in a program. The 8085 has eight software interrupts from RST 0 to RST 7. The vector address
for these interrupts can be calculated as follows.
An external device initiates the hardware interrupts and placing an appropriate signal at the
interrupt pin of the processor. If the interrupt is accepted then the processor executes an interrupt service
routine.
TRAP
RST 7.5
RST 6.5
RST 5.5
INTR
TRAP:
RST 7.5:
1.DI instruction
2.System or processor reset.
3.After reorganization of interrupt.
Enabled by EI instruction.
The RST 6.5 and RST 5.5 both are level triggered. . ie. Input goes to high and stay high until it
recognized.
Maskable interrupt. It is disabled by,
Enabled by EI instruction.
The RST 6.5 has the third priority whereas RST 5.5 has the fourth priority.
INTR:
Enabled by EI instruction.
Non- vectored interrupt. After receiving INTA (active low) signal, it has to supply the address
of ISR.
It has lowest priority.
It is a level sensitive interrupts. ie. Input goes to high and it is necessary to maintain high state
until it recognized.
The following sequence of events occurs when INTR signal goes high.
1. The 8085 checks the status of INTR signal during execution of each instruction.
2. If INTR signal is high, then 8085 complete its current instruction and sends active low interrupt
acknowledge signal, if the interrupt is enabled.
3. In response to the acknowledge signal, external logic places an instruction OPCODE on the data bus.
In the case of multibyte instruction, additional interrupt acknowledge machine cycles are generated by
the 8085 to transfer the additional bytes into the microprocessor.
4. On receiving the instruction, the 8085 save the address of next instruction on stack and execute
received instruction.
The 8085 provide additional masking facility for RST 7.5, RST 6.5 and RST 5.5 using SIM
instruction.
The status of these interrupts can be read by executing RIM instruction.
The masking or unmasking of RST 7.5, RST 6.5 and RST 5.5 interrupts can be performed by
moving an 8-bit data to accumulator and then executing SIM instruction.
The status of pending interrupts can be read from accumulator after executing RIM instruction.
When RIM instruction is executed an 8-bit data is loaded in accumulator, which can be
interpreted as shown in fig.
Fig 1.16 Format of 8 bit data in Accumulator after executing RIM Instruction
Instruction Queue:
To increase the execution speed, BIU fetches as many as six instruction bytes ahead to time from
memory.
All six bytes are then held in first in first out 6 byte register called instruction queue.
Then all bytes have to be given to EU one by one.
This pre fetching operation of BIU may be in parallel with execution operation of EU, which
improves the speed execution of the instruction.
The EU contains the control circuitry to perform various internal operations. A decoder in EU
decodes the instruction fetched memory to generate different internal or external control signals
required to perform the operation. EU has 16-bit ALU, which can perform arithmetic and logical
operations on 8-bit as well as 16-bit.
These registers can be used as 8-bit registers individually or can be used as 16-bit in pair to
have AX,BX, CX, and DX.
a. AX Register: AX register is also known as accumulator register that stores operands for
arithmetic operation like divided, rotate.
b. BX Register: This register is mainly used as a base register. It holds the starting base location
of a memory region within a data segment.
c. CX Register: It is defined as a counter. It is primarily used in loop instruction to store loop
counter.
d. DX Register: DX register is used to contain I/O port address for I/O instruction.
Segment Registers:
Additional registers called segment registers generate memory address when combined with
other in the microprocessor. In 8086 microprocessor, memory is divided into 4 segments as follow:
a. Code Segment (CS): The CS register is used for addressing a memory location in the Code
Segment of the memory, where the executable program is stored.
b. Data Segment (DS): The DS contains most data used by program. Data are accessed in the
Data Segment by an offset address or the content of other register that holds the offset
address.
c. Stack Segment (SS): SS defined the area of memory used for the stack.
d. Extra Segment (ES): ES is additional data segment that is used by some of the string to hold
the destination data.
Flags Register determines the current state of the processor. They are modified automatically by
CPU after mathematical operations, this allows to determine the type of the result, and to determine
conditions to transfer control to other parts of the program. 8086 has 9 flags and they are divided into
two categories:
Conditional Flags
Control Flags
Conditional Flags
Conditional flags represent result of last arithmetic or logical instruction executed. Conditional flags are
as follows:
Carry Flag (CF): This flag indicates an overflow condition for unsigned integer arithmetic. It is
also used in multiple-precision arithmetic.
Auxiliary Flag (AF): If an operation performed in ALU generates a carry/barrow from lower
nibble (i.e. D0 D3) to upper nibble (i.e. D4 – D7), the AF flag is set i.e. carry given by D3 bit to
D4 is AF flag. This is not a general-purpose flag, it is used internally by the processor to perform
Binary to BCD conversion.
Parity Flag (PF): This flag is used to indicate the parity of result. If lower order 8-bits of the
result contains even number of 1‟s, the Parity Flag is set and for odd number of 1‟s, the Parity
Flag is reset.
Zero Flag (ZF): It is set; if the result of arithmetic or logical operation is zero else it is reset.
Sign Flag (SF): In sign magnitude format the sign of number is indicated by MSB bit. If the
result of operation is negative, sign flag is set.
Overflow Flag (OF): It occurs when signed numbers are added or subtracted. An OF indicates
that the result has exceeded the capacity of machine.
Control Flags:
Control flags are set or reset deliberately to control the operations of the execution unit. Control flags
are as follows:
Control Signals:
Address Latch Enable (ALE) is a pulse to logic 1 that signals external circuitry when a valid
address is on the bus. This address can be latched in external circuitry on the 1-to-0 edge of the
pulse at ALE.
IO/M line: memory or I/O transfer is selected (complement for 8086)
DT/R line: direction of data is selected
SSO (System Status Output) line: =1 when data is read from memory and =0 when code is
read from memory (only for 8088)
BHE (Bank High Enable) line : =0 for most significant byte of data for 8086 and also carries
S7
RD line: =0 when a read cycle is in progress
WR line: =0 when a write cyle is in progress
DEN line: (Data enable) Enables the external devices to supply data to the processor.
Ready line: can be used to insert wait states into the bus cycle so that it is extended by a number
of clock periods
Interrupt signals:
INTR (Interrupt request) :=1 shows there is a service request, sampled at the final clock cycle
of each instruction acquisition cycle.
INTA : Processor responds with two pulses going to 0 when it services the interrupt and waits
for the interrupt service number after the second pulse.
TEST: Processor suspends operation when =1. Resumes operation when=0. Used to syncronize
the processor to external events.
NMI (Nonmaskable interrupt) : A leading edge transition causes the processor go to the
interrupt routine after the current instruction is executed.
RESET : =0 Starts the reset sequence.
For multiprocessor environment 8288 Bus Controller is used for bus control
WR¯ ,IO/M¯ ,DT/R¯ ,DEN¯ ,ALE, INTA¯ signals are not available
Instead
a. MRDC¯ (memory read command)
b. MWRT¯ (memory write command)
c. AMWC¯ (advanced memory write command)
d. IORC¯ (I/O read command)
e. IOWC¯ (I/O write command)
f. AIOWC¯ (Advanced I/O write command)
g. INTA¯ (interrupt acknowledge)
The signals shown above are produced by 8288 depending on the state of S0, S1 and S2.
a. DEN, DT/R¯ and ALE signals are the same as minimum-mode systems
b. LOCK¯ : when =0, prevents other processors from using the bus
c. QS0 and QS1 (queue status signals): informs about the status of the queue
d. RQ¯ /GT ¯ 0 and RQ¯ /GT ¯ 1 are used instead of HOLD and HLDA lines in a
multiprocessor environment as request/grant lines.
2. I/O Ports
There are two methods in which I/O devices can be connected to the Microprocessor.
In this method I/O device is treated like the memory. Here there is no IO/M signal. If the
processor wants to read the data from a I/O device it will place the address of the I/O device on the
address bus. Then the I/O device will get selected. The memory which is having the same address
will also get selected.so we have to use separate address for memory and separate address for I/O
device.
Here we have the IO/M signal. So we can select either the memory or I/O device for read
and write operation.
Programmed I/O
Interrupt I/O
DMA
Programmed I/O:
Here the processor has to check whether the I/O device is ready or not through the Ready
signal of the I/O device. If the ready signal is high then it will send the data to the I/O device. Otherwise
it will continuously check the Ready signal. The processor is busy in checking the Ready signal. The
Interrupt I/O:
In this method the I/O device will interrupt the Processor through the INTR signal to indicate
to the processor that it is ready to accept the next data. Then the processor will send the INTA signal.
Then the processor stops its normal execution and start transferring the data to the I/O device.
DMA:
Using DMA I/O device can directly transfer the data to the Memory using the Address and Data
buses of Processor.
Some of the external I/0 devices receive only the serial data. Normally serial communication is used
in the MultiProcessor environment. 8051 has two pins for serial communication.
Interrupts
INTR is a maskable hardware interrupt. The interrupt can be enabled/disabled using STI/CLI
instructions or using more complicated method of updating the FLAGS register with the help of the
POPF instruction.
When an interrupt occurs, the processor stores FLAGS register into stack, disables further interrupts,
fetches from the bus one byte representing interrupt type, and jumps to interrupt processing routine
address of which is stored in location 4 * <interrupt type>. Interrupt processing routine should return
with the IRET instruction.
NMI is a non-maskable interrupt. Interrupt is processed in the same way as the INTR interrupt. Interrupt
type of the NMI is 2, i.e. the address of the NMI processing routine is stored in location 0008h. This
interrupt has higher priority then the maskable interrupt.
Processor exceptions: Divide Error (Type 0), Unused Opcode (type 6) and Escape opcode (type 7).
UNIT - 2
The 8085 instruction set is classified into the following three groups according to word size:
In the 8085, "byte" and "word" are synonymous because it is an 8-bit microprocessor. However,
instructions are commonly referred to in terms of bytes rather than words.
A 1-byte instruction includes the opcode and operand in the same byte. Operand(s) are internal
register and are coded into the instruction
These instructions are 1-byte instructions performing three different tasks. In the first instruction,
both operand registers are specified. In the second instruction, the operand B is specified and the
accumulator is assumed. Similarly, in the third instruction, the accumulator is assumed to be the implicit
operand. These instructions are stored in 8- bit binary format in memory; each requires one memory
location.
MOV rd, rs
where ddd is a code for one of the 7 general registers which is the destination of the data, sss is the code
of the source register.
Coded as 01111000 = 78H = 170 octal (octal was used extensively in instruction design of such
processors).
ADD r
AA+r
In a two-byte instruction, the first byte specifies the operation code and the second byte specifies
the operand. Source operand is a data byte immediately following the opcode. For example:
MVI r,data
r data
ADI data
A A + data
OUT port
0011 1110
DATA
Since the byte is not the data but points directly to where it is located this is called direct addressing.
In a three-byte instruction, the first byte specifies the opcode, and the following two bytes specify
the 16-bit address. Note that the second byte is the low-order address and the third byte is the high-order
address.
rp is one of the pairs of registers BC, DE, HL used as 16-bit registers. The two data bytes are 16-bit data
in L H order of significance.
rp data16
LXI H,0520H coded as 21H 20H 50H in three bytes. This is also immediate addressing.
LDA addr
Example: LDA 2134H coded as 3AH 34H 21H. This is also an example of direct addressing.
The instructions MOV B, A or MVI A, 82H are to copy data from a source into a destination. In
these instructions the source can be a register, an input port, or an 8-bit number (00H to FFH). Similarly,
a destination can be a register or an output port. The sources and destination are operands. The various
formats for specifying operands are called the ADDRESSING MODES. For 8085, they are:
Immediate addressing.
Register addressing.
Direct addressing.
Indirect addressing.
Immediate addressing:
Data is present in the instruction. Load the immediate data to the destination provided.
Register addressing:
Direct addressing:
Used to accept data from outside devices to store in the accumulator or send the data stored in
the accumulator to the outside device. Accept the data from the port 00H and store them into the
accumulator or Send the data from the accumulator to the port 01H.
Indirect Addressing:
This means that the Effective Address is calculated by the processor. And the contents of the
address (and the one following) is used to form a second address. The second address is where the data
is stored. Note that this requires several memory accesses; two accesses to retrieve the 16-bit address
and a further access (or accesses) to retrieve the data which is to be loaded into the register.
The data transfer instructions move data between registers or between memory and registers.
MOV Move
An 'X' in the name of a data transfer instruction implies that it deals with a register pair (16-bits);
The arithmetic instructions add, subtract, increment, or decrement data in registers or memory.
This group performs logical (Boolean) operations on data in registers and memory and on
condition flags. The logical AND, OR, and Exclusive OR instructions enable you to set specific bits in
the accumulator ON or OFF.
The Compare instructions compare the content of an 8-bit value with the contents of the accumulator;
CMP Compare
The rotate instructions shift the contents of the accumulator one bit position to the left or right:
The branching instructions alter normal sequential program flow, either unconditionally or
conditionally. The unconditional branching instructions are as follows:
JMP Jump
CALL Call
RET Return
Conditional branching instructions examine the status of one of four condition flags to determine
whether the specified branch is to be executed. The conditions that may be specified are as follows:
NZ Not Zero (Z = 0)
Z Zero (Z = 1)
NC No Carry (C = 0)
C Carry (C = 1)
PO Parity Odd (P = 0)
PE Parity Even (P = 1)
P Plus (S = 0)
M Minus (S = 1)
JNZ
C CNZ
CC RNZ
RC (Not Zero)
(Carry)
JZ CZ RZ (Zero)
SCE 30 Dept. of ECE
JP CP RP (Plus)
EE2354 MICROPROCESSOR AND MICROCONTROLLER
JM CM RM (Minus)
Two other instructions can affect a branch by replacing the contents or the program counter:
HLT Halt
NOP No Operation
1100 0011
1000 0101
0010 0000
ADD D
OUT PORT1
HLT
RRC RRC
OUT PORT1
HLT
JZ EQU JC GRT
OUT PORT1
HLT
HLT
SPHL
LHLD 4202
XCHG
LXI H,0000
L1 LXI B,0000
DAD SP
JNC L2
INX B
L2 DCX D
MOV A,E
ORA D
JNZ L1
SHLD 4204
MOV L,C
MOV H,B
SHLD 4206
HLT
MOV C, A
LXI H, 4501
L2 MOV A, M
L3 DCR C
INX H
JZ L1
CMP M
JC L2
JMP L3
L1 STA 4520
HLT
START
L3 MVI B, 00
LXI H, 4200
MOV C, M
DCR C
INX H
L2 MOV A, M
INX H
CMP M
JC L1
MOV D, M
MOV M, A
DCX H
MOV M, D
INX H
MVI B, 01
L1 DCR C
JNZ L2
DCR B
JZ L3
HLT
OUT C8
CALL DELAY
MVI A,FF
OUT C8
CALL DELAY
JMP START
MVI B,05H
MVI C,FF
DELAY DCR C
L2 JNZ L1
L1 DCR B
JNL L2
RET
OUT C2
OUT C2
OUT C2
OUT C0
DCR B
JNZ L1
IN C2
L2 ANI 07
JZ L2
OUT C2
IN C0
ANI 0F
MOV L, A
MVI H, 42
MOV A, M
OUT C0
JMP L2
LOOKUP TABLE
4200 0C 9F 4A 0B
4204 99 29 28 8F
4208 08 09 88 38
420C 6C 1A 68 E8
UNIT - 3
PERIPHERAL INTERFACING
The parallel input-output port chip 8255 is also called as programmable peripheral input- output
port. The Intel’s 8255 is designed for use with Intel’s 8-bit, 16-bit and higher capability microprocessors.
It has 24 input/output lines which may be individually programmed in two groups of twelve lines each,
or three groups of eight lines. The two groups of I/O pins are named as Group A and Group B. Each of
these two groups contains a subgroup of eight I/O lines called as 8-bit port and another subgroup of four
lines or a 4-bit port.
Thus Group A contains an 8-bit port A along with a 4-bit port. C upper. The port A lines are
identified by symbols PA0-PA7 while the port C lines are identified as PC4-PC7. Similarly, Group B
contains an 8-bit port B, containing lines PB0-PB7 and a 4-bit port C with lower bits PC0- PC3. The
port C upper and port C lower can be used in combination as an 8-bit port C. Both the port C are assigned
the same address. Thus one may have either three 8-bit I/O ports or two 8-bit and two 4-bit ports from
8255. All of these ports can function independently either as input or as output ports. This can be
achieved by programming the bits of an internal register of 8255 called as control word register (CWR).
This buffer receives or transmits data upon the execution of input or output instructions by the
microprocessor. The control words or status information is also transferred through the buffer.
PA7-PA0: These are eight port A lines that acts as either latched output or buffered input lines
depending upon the control word loaded into the control word register.
PC7-PC4: Upper nibble of port C lines. They may act as either output latches or input buffers lines.
This port also can be used for generation of handshake lines in mode 1 or mode 2.
PC3-PC0: These are the lower port C lines, other details are the same as PC7-PC4 lines.
PB0-PB7: These are the eight port B lines which are used as latched output lines or buffered input
lines in the same way as port A.
RD: This is the input line driven by the microprocessor and should be low to indicate read operation
to 8255.
WR: This is an input line driven by the microprocessor. A low on this line indicates write operation.
CS: This is a chip select line. If this line goes low, it enables the 8255 to respond to RD and WR
signals, otherwise RD and WR signal are neglected.
A1-A0: These are the address input lines and are driven by the microprocessor. These lines A1-A0
with RD, WR and CS from the following operations for 8255. These address lines are used for
addressing any one of the four registers, i.e. three ports and a control word register as given in table
below. In case of 8086 systems, if the 8255 is to be interfaced with lower order data bus, the A0 and
A1 pins of 8255 are connected with A1 and A2 respectively.
D0-D7: These are the data bus lines those carry data or control word to/from the microprocessor.
RESET: A logic high on this line clears the control word register of 8255. All ports are set as input
ports by default after reset.
Input/output mode
Bit set/reset mode
There are three types of the input/output mode. They are as follows:
Mode 0
In this mode, the ports can be used for simple input/output operations without handshaking. If
both port A and B are initialized in mode 0, the two halves of port C can be either used together as an
additional 8-bit port, or they can be used as individual 4-bit ports. Since the two halves of port C are
independent, they may be used such that one-half is initialized as an input port while the other half is
initialized as an output port. The input output features in mode 0 are as follows:
Mode 1
When we wish to use port A or port B for handshake (strobed) input or output operation, we
initialize that port in mode 1 (port A and port B can be initialized to operate in different modes, ie, for
eg., port A can operate in mode 0 and port B in mode 1). Some of the pins of port C function as handshake
lines.
For port B in this mode (irrespective of whether is acting as an input port or output port), PC0,
PC1 and PC2 pins function as handshake lines. If port A is initialized as mode 1 input port, then, PC3,
PC4 and PC5 function as handshake signals. Pins PC6 and PC7 are available for use as input/output
lines. The mode 1 which supports handshaking has following features: 1.
Two ports i.e. port A and B can be used as 8-bit I/O port. 2. Each port uses three lines of port c
as handshake signal and remaining two signals can be function as I/O port. 3. Interrupt logic is supported.
4. Input and Output data are latched.
Mode 2
Only group A can be initialized in this mode. Port A can be used for bidirectional handshake data
transfer. This means that data can be input or output on the same eight lines (PA0 - PA7). Pins PC3 -
PC7 are used as handshake lines for port A. The remaining pins of port C (PC0 - PC2) can be used as
input/output lines if group B is initialized in mode 0. In this mode, the 8255 may be used to extend the
system bus to a slave microprocessor or to transfer data bytes to and from a floppy disk controller.
In this mode only port b can be used (as an output port). Each line of port C (PC0 - PC7) can be
set/reset by suitably loading the command word register.no effect occurs in input-output mode. The
individual bits of port c can be set or reset by sending the signal OUT instruction to the control register.
The figure shows the control word format in the input/output mode. This mode is selected by making
D7 = '1' .
D0, D1, D3, D4 are for lower port C, port B, upper port C and port A respectively. When D0 or D1
or D3 or D4 are "SET", the corresponding ports act as input ports. For eg, if D0 = D4 = '1', then
lower port C and port A act as input ports. If these bits are "RESET", then the corresponding ports
act as output ports. For eg, if D1 = D3 = '0', then port B and upper port C act as output ports.
D2 is used for mode selection for group B (Port B and Lower Port C). When D2 = '0', mode 0 is
selected and when D2 = '1', mode 1 is selected.
D5, D6 are used for mode selection for group A (Upper Port C and Port A). The format is as follows:
D6 D5 Mode
0 0 0
0 1 1
1 X 2
3.2.1 Features
8 levels of interrupts.
Can be cascaded in master-slave configuration to handle 64 levels of interrupts.
Internal priority resolver.
Fixed priority mode and rotating priority mode.
Individually maskable interrupts.
Modes and masks can be changed dynamically.
Accepts IRQ, determines priority, checks whether incoming priority > current level being
serviced, issues interrupt signal.
In 8085 mode, provides 3 byte CALL instruction. In 8086 mode, provides 8 bit vector number.
Polled and vectored mode.
Starting address of ISR or vector number is programmable.
No clock required.
3.2.2 Pinout
Bi-directional, 3 bit cascade lines. In master mode, PIC places slave ID no. on these
CAS0-2 lines. In slave mode, the PIC reads slave ID no. from master on these lines. It may
be regarded as slave-select.
SP-bar /EN- Slave program / enable. In non-buffered mode, it is SP-bar input, used to distinguish
bar master/slave PIC. In buffered mode, it is output line used to enable buffers
A0 D7 D6 D5 D4 D3 D2 D1 D0
The lower byte is of which A7, A6, A5 are provided by D7-D5 of ICW1 (if ADI=1), or A7, A6 are
provided if ADI=0. A4-A0 (or A5-A0) are set by 8259 itself:
A7 A6 A5 A4 A3 A2 A1 A0
IRQ A7 A6 A5 A4 A3 A2 A1 A0
IR0 A7 A6 A5 0 0 0 0 0
IR1 A7 A6 A5 0 0 1 0 0
IR2 A7 A6 A5 0 1 0 0 0
IR3 A7 A6 A5 0 1 1 0 0
IR4 A7 A6 A5 1 0 0 0 0
IR5 A7 A6 A5 1 0 1 0 0
IR6 A7 A6 A5 1 1 1 0 0
IR7 A7 A6 A5 1 1 1 0 0
IRQ A7 A6 A5 A4 A3 A2 A1 A0
IR0 A7 A6 0 0 0 0 0 0
IR1 A7 A6 0 0 1 0 0 0
IR2 A7 A6 0 1 0 0 0 0
IR3 A7 A6 0 1 1 0 0 0
IR4 A7 A6 1 0 0 0 0 0
IR5 A7 A6 1 0 1 0 0 0
IR6 A7 A6 1 1 0 0 0 0
IR7 A7 A6 1 1 1 0 0 0
A0 D7 D6 D5 D4 D3 D2 D1 D0
D7 D6 D5 D4 D3 D2 D1 D0
A0
Master S7 S6 S5 S4 S3 S2 S1 S0
1
Slave 0 0 0 0 0 ID3 ID2 ID1
Master mode: 1 indicates slave is present on that interrupt, 0 indicates direct interrupt
Slave mode: ID3-ID2-ID1 is the slave ID number. Slave 4 on IR4 has ICW3=04h (0000 0100)
A0 D7 D6 D5 D4 D3 D2 D1 D0
A0 D7 D6 D5 D4 D3 D2 D1 D0
1 M7 M6 M5 M4 M3 M2 M1 M0
A0 D7 D6 D5 D4 D3 D2 D1 D0
1 R SL EOI 0 0 L3 L2 L1
R SL EOI Action
EOI
Specific EOI command (Interrupt to clear
0 1 1
given by L3L2L1)
Auto rotation of priorities (L3L2L1=000) 1 0 0 Rotate priorities in auto EOI mode set
0 1 0 No operation
A0 D7 D6 D5 D4 D3 D2 D1 D0
0 X No effect
The 8251 is a USART (Universal Synchronous Asynchronous Receiver Transmitter) for serial
data communication. As a peripheral device of a microcomputer system, the 8251receives parallel data
from the CPU and transmits serial data after conversion. This device also receives serial data from the
outside and transmits parallel data to the CPU after conversion.
Fig 3.7 Block diagram of the 8251 USART (Universal Synchronous Asynchronous
Receiver Transmitter)
1) Mode Instruction
Mode instruction is used for setting the function of the 8251. Mode instruction will be in "wait for write"
at either internal reset or external reset. That is, the writing of a control word after resetting will be
recognized as a "mode instruction."
Synchronous/asynchronous mode
Stop bit length (asynchronous mode)
Character length
Parity bit
Baud rate factor (asynchronous mode)
Internal/external synchronization (synchronous mode)
Number of synchronous characters (Synchronous mode)
The bit configuration of mode instruction is shown in Figures 3.8 and 3.9. In the case of
synchronous mode, it is necessary to write one-or two byte sync characters. If sync characters were
written, a function will be set because the writing of sync characters constitutes part of mode instruction.
2) Command
Command is used for setting the operation of the 8251. It is possible to write a command
whenever necessary after writing a mode instruction and sync characters.
Transmit Enable/Disable
Receive Enable/Disable
DTR, RTS Output of data.
Resetting of error flag.
Sending to break characters
Internal resetting
Hunt mode (synchronous mode)
It is possible to see the internal status of the 8251 by reading a status word.
A programmable keyboard and display interfacing chip. Scans and encodes up to a 64-key
keyboard. Controls up to a 16-digit numerical display. Keyboard section has a built-in FIFO 8 character
buffer. The display is controlled from an internal 16x8 RAM that stores the coded display information.
A0: Selects data (0) or control/status (1) for reads and writes between micro and 8279.
BD: Output that blanks the displays.
CLK: Used internally for timing. Max is 3 MHz.
CN/ST: Control/strobe, connected to the control key on the keyboard
CS: Chip select that enables programming, reading the keyboard, etc.
DB7-DB0: Consists of bidirectional pins that connect to data bus on micro.
IRQ: Interrupt request, becomes 1 when a key is pressed, data is available.
OUT A3-A0/B3-B0: Outputs that sends data to the most significant/least significant nibble of
display.
RD(WR): Connects to micro's IORC or RD signal, reads data/status registers.
RESET: Connects to system RESET.
RL7-RL0: Return lines are inputs used to sense key depression in the keyboard matrix.
Shift: Shift connects to Shift key on keyboard.
SL3-SL0: Scan line outputs scan both the keyboard and displays.
Display section:
The display section has eight output lines divided into two groups A0-A3 and B0-B3.
The output lines can be used either as a single group of eight lines or as two groups of four lines,
in conjunction with the scan lines for a multiplexed display.
The output lines are connected to the anodes through driver transistor in case of common cathode
7-segment LEDs.
The cathodes are connected to scan lines through driver transistors.
The display can be blanked by BD (low) line.
The display section consists of 16 x 8 display RAM. The CPU can read from or write into any
location of the display RAM.
Scan section:
The scan section has a scan counter and four scan lines, SL0 to SL3.
In decoded scan mode, the output of scan lines will be similar to a 2-to-4 decoder.
In encoded scan mode, the output of scan lines will be binary count, and so an external decoder
should be used to convert the binary count to decoded output.
The scan lines are common for keyboard and display.
The scan lines are used to form the rows of a matrix keyboard and also connected to digit drivers
of a multiplexed display, to turn ON/OFF.
The CPU interface section takes care of data transfer between 8279 and the processor.
This section has eight bidirectional data lines DB0 to DB7 for data transfer between 8279 and
CPU. It requires two internal address A =0 for selecting data buffer and A = 1 for selecting
control register of8279.
The control signals WR (low), RD (low), CS (low) and A0 are used for read/write to 8279.
It has an interrupt request line IRQ, for interrupt driven data transfer with processor.
The 8279 require an internal clock frequency of 100 kHz. This can be obtained by dividing the
input clock by an internal prescaler.
The RESET signal sets the 8279 in 16-character display with two -key lockout keyboard modes.
The keyboard matrix can be any size from 2x2 to 8x8.Pins SL2-SL0 sequentially scan each
column through a counting operation. The 74LS138 drives 0's on one line at a time. The 8279 scans RL
pins synchronously with the scan. RL pins incorporate internal pull-ups, no need for external resistor
pull-ups. The 8279 must be programmed first.
First three bits given below select one of 8 control registers (opcode).
000DDMMM
8- or 16-digit display
Whether new data are entered to the rightmost or leftmost display position.
MMM Field:
DD Function
000 Encoded keyboard with 2 key lockout
001 Decoded keyboard with 2 key lockout
010 Encoded keyboard with N key rollover
011 Decoded keyboard with N key rollover
100 Encoded sensor matrix
101 Decoded sensor matrix
110 Strobed keyboard, encoded display scan
111 Strobed keyboard, decoded display scan
Encoded: SL outputs are active-high, follow binary bit pattern 0-7 or 0-15.
Strobed: An active high pulse on the CN/ST input pin strobes data from the RL pins into an internal
FIFO for reading by micro later.
3.5.1 Features
The ADC0809 is an 8-bit successive approximation type ADC with inbuilt 8-channel
multiplexer.
The ADC0809 is suitable for interface with 8086 microprocessor.
The ADC0809 is available as a 28 pin IC in DIP (Dual Inline Package).
The ADC0809 has a total unadjusted error of ±1 LSD (Least Significant Digit).
The ADC0808 is also same as ADC0809 except the error. The total unadjusted error in ADC0808
is ± 1/2 LSD.
The successive approximation register (SAR) performs eight iterations to determine the digital
code for input value. The SAR is reset on the positive edge of START pulse and start the conversion
process on the falling edge of START pulse. A conversion process will be interrupted on receipt of new
START pulse. The End-Of-Conversion (EOC) will go low between 0 and 8 clock pulses after the
positive edge of START pulse. The ADC can be used in continuous conversion mode by tying the EOC
output to START input. In this mode an external START pulse should be applied whenever power is
switched ON. The 256R ladder network has been provided instead of conventional R/2R ladder because
of its inherent monotonic, which guarantees no missing digital codes. Also the 256R resistor network
does not cause load variations on the reference voltage.
analog value is quantized and each quantized analog value will have a unique binary equivalent. The
quantization step in ADC0809/ADC0808 is given by,
PROGRAM
HLT
To convert the digital signal to analog signal a Digital-to-Analog Converter (DAC) has to be
employed.
The DAC will accept a digital (binary) input and convert to analog voltage or current.
Every DAC will have "n" input lines and an analog output.
The DAC require a reference analog voltage (Vref) or current (Iref) source.
The smallest possible analog value that can be represented by the n-bit binary code is called
resolution.
The resolution of DAC with n-bit binary input is 1/2nof reference analog value.
The DAC0800 is an 8-bit, high speed, current output DAC with a typical settling time
(conversion time) of 100 ns.
It produces complementary current output, which can be converted to voltage by using simple
resistor load.
The DAC0800 require a positive and a negative supply voltage in the range of ± 5V to ±18V.
It can be directly interfaced with TTL, CMOS, PMOS and other logic families.
For TTL input, the threshold pin should be tied to ground (VLC = 0V).
The reference voltage and the digital input will decide the analog output current, which can be
converted to a voltage by simply connecting a resistor to output terminal or by using an op-amp
I to V converter.
The DAC0800 is available as a 16-pin IC in DIP.
OUT C8
CALL DELAY
MVI A,FF
OUT C8
CALL DELAY
JMP START
MVI B,05H
MVI C,FF
DELAY DCR C
L2 JNZ L1
DCR B
L1 JNL L2
RET
UNIT - 4
Program Memory
Data Memory
Includes 128 bytes of on-chip Data Memory which are more easily accessible directly by its
instructions
There is also a number of Special Function Registers (SFRs)
Internal Data Memory contains four banks of eight registers and a special 32- byte long segment
which is bit addressable by 8051 bit-instructions
External memory of maximum 64K bytes is accessible by “movx”
4.1.4 Timer/Counter
The 8051 instruction set is classified into the following three groups according to word size:
A 1-byte instruction includes the opcode and operand in the same byte. Operand(s) are internal
register and are coded into the instruction.
These instructions are 1-byte instructions performing three different tasks. In the first instruction,
both operand registers are specified. In the second instruction, the operand B is specified and the
accumulator is assumed. Similarly, in the third instruction, the accumulator is assumed to be the implicit
operand. These instructions are stored in 8- bit binary format in memory; each requires one memory
location.
In a two-byte instruction, the first byte specifies the operation code and the second byte specifies
the operand. Source operand is a data byte immediately following the opcode.
In a three-byte instruction, the first byte specifies the opcode, and the following two bytes specify
the 16-bit address. Note that the second byte is the low-order address and the third byte is the high-order
address.
immediate
register
direct
register indirect
indexed
Register addressing mode involves the use of registers to hold the data to be manipulated
Indexed addressing mode is widely used in accessing data elements of look-up table entries
located in the program ROM space of the 8051.
The instruction used for this purpose is : MOVC A, @ A+DPTR
The 16-bit register DPTR and register A are used to form the address of the data element stored
in on-chip ROM.
Because the data elements are stored in the program (code) space ROM of the 8051, the
instruction MOVC is used instead of MOV. The "C" means code.
In this instruction the contents of A are added to the 16-bit register DPTR to form the 16- bit
address of the needed data.
When interrupt occurs (or correctly, when the flag for an enabled interrupt is found to be set
(1)), the interrupt system generates an LCALL to the appropriate location in Program Memory,
unless some other conditions block the interrupt
Several conditions can block an interrupt
An interrupt of equal or higher priority level is already in progress
The current (polling) cycle is not the final cycle in the execution of the instruction in progress
The instruction in progress is RETI or any write to IE or IP registers
If an interrupt flag is active but not being responded to for one of the above conditions,
must be still active when the blocking condition is removed, or the denied interrupt will not be
serviced
Next step is saving the registers on stack. The hardware-generated LCALL causes only the
contents of the Program Counter to be pushed onto the stack, and reloads the PC with the
beginning address of the service routine
In some cases it also clears the flag that generated the interrupt, and in other cases it doesn‟t. It
clears an external interrupt flag (IE0 or IE1) only if it was transition- avtivated.
Having only PC be automatically saved gives programmer more freedom to decide how
much time to spend saving other registers. Programmer must also be more careful with proper
selection, which register to save.
The service routine for each interrupt begins at a fixed location. The interrupt locations are
spaced at 8-byte interval, beginning at 0003H for External Interrupt 0, 000BH for Timer 0,
0013H for External Interrupt 1 and 001BH for Timer 1.
4.6 Timers
The 8051 comes equipped with two timers, both of which may be controlled, set, read, and
configured individually. The 8051 timers have three general functions: 1) Keeping time and/or
calculating the amount of time between events, 2) Counting the events themselves, or 3) Generating
baud rates for the serial port.
One of the primary uses of timers is to measure time. We will discuss this use of timers first and
will subsequently discuss the use of timers to count events. When a timer is used to measure time it is
also called an "interval timer" since it is measuring the time of the interval between two events.
4.6.1Timer SFR
8051 has two timers which each function essentially the same way. One timer is TIMER0 and
the other is TIMER1. The two timers share two SFRs (TMOD and TCON) which control the timers,
and each timer also has two SFRs dedicated solely to itself (TH0/TL0 and TH1/TL1).
Timer mode "0" is a 13-bit timer. This is a relic that was kept around in the 8051 to maintain
compatability with its predecesor, the 8048. Generally the 13-bit timer mode is not used in new
development.
When the timer is in 13-bit mode, TLx will count from 0 to 31. When TLx is incremented from
31, it will "reset" to 0 and increment THx. Thus, effectively, only 13 bits of the two timer bytes are
being used: bits 0-4 of TLx and bits 0-7 of THx. This also means, in essence, the timer can only contain
8192 values. If you set a 13-bit timer to 0, it will overflow back to zero 8192 machine cycles later.
Again, there is very little reason to use this mode and it is only mentioned so you wont be
surprised if you ever end up analyzing archaeic code which has been passed down through the
generations (a generation in a programming shop is often on the order of about 3 or 4 months).
Timer mode "1" is a 16-bit timer. This is a very commonly used mode. It functions just like 13-
bit mode except that all 16 bits are used.
TLx is incremented from 0 to 255. When TLx is incremented from 255, it resets to 0 and causes
THx to be incremented by 1. Since this is a full 16-bit timer, the timer may contain up to
65536 distinct values. If you set a 16-bit timer to 0, it will overflow back to 0 after 65,536
machine cycles.
Timer mode "2" is an 8-bit auto-reload mode. What is that, you may ask? Simple. When a
timer is in mode 2, THx holds the "reload value" and TLx is the timer itself. Thus, TLx starts counting
up. When TLx reaches 255 and is subsequently incremented, instead of resetting to 0 (as in the case
of modes 0 and 1), it will be reset to the value stored in THx.
Timer mode "3" is a split-timer mode. When Timer 0 is placed in mode 3, it essentially becomes
two separate 8-bit timers. That is to say, Timer 0 is TL0 and Timer 1 is TH0. Both timers count
from 0 to 255 and overflow back to 0. All the bits that are related to Timer 1 will now be tied to TH0.
While Timer 0 is in split mode, the real Timer 1 (i.e. TH1 and TL1) can be put into modes
0, 1 or 2 normally--however, you may not start or stop the real timer 1 since the bits that do that are
now linked to TH0. The real timer 1, in this case, will be incremented every machine cycle no matter
what.
We've discussed how a timer can be used for the obvious purpose of keeping track of time.
However, the 8051 also allows us to use the timers to count events.
How can this be useful? Let's say you had a sensor placed across a road that would send a pulse
every time a car passed over it. This could be used to determine the volume of traffic on the road.
We could attach this sensor to one of the 8051's I/O lines and constantly monitor it, detecting when it
pulsed high and then incrementing our counter when it went back to a low state. This is not terribly
difficult, but requires some code. Let's say we hooked the sensor to P1.0; the code to count cars
passing would look something like this:
JB P1.0, $ ; The line is high which means the car is on the sensor right now
Some of the external I/0 devices receive only the serial data. Normally serial communication is
used in the Multi-Processor environment.8051 has two pins for serial communication.
UNIT – 5
5.3 Data Transfer Instructions that access the Internal Data Memory
5.4 Data Transfer Instructions that access the External Data Memory
The key board here we are interfacing is a matrix keyboard. This key board is designed with a
particular rows and columns. These rows and columns are connected to the microcontroller through its
ports of the micro controller 8051. We normally use 8*8 matrix key board. So only two ports of 8051
can be easily connected to the rows and columns of the key board.
Whenever a key is pressed, a row and a column gets shorted through that pressed key and all
the other keys are left open. When a key is pressed only a bit in the port goes high. Which indicates
microcontroller that the key is pressed. By this high on the bit key in the corresponding column is
identified.
Once we are sure that one of key in the key board is pressed next our aim is to identify that key.
To do this we firstly check for particular row and then we check the corresponding column the key
board.
To check the row of the pressed key in the keyboard, one of the row is made high by making
one of bit in the output port of 8051 high . This is done until the row is found out. Once we get the
row next out job is to find out the column of the pressed key. The column is detected by contents in the
input ports with the help of a counter. The content of the input port is rotated with carry until the carry
bit is set.
The contents of the counter is then compared and displayed in the display. This display is
designed using a seven segment display and a BCD to seven segment decoder IC 7447.
The BCD equivalent number of counter is sent through output part of 8051 displays the number
of pressed key.
mov a,r4
mov r4,a
mov a,r3
mov r3,a
after identifying the row to check the colomn following steps are followed
colscan:mov r5,#00h
in: rrc a ;rotate right with carry until get the carry
jmp in
mov p2,a
This section describes the operation modes of LCDs, then describes how to program and interface an
LCD to an 8051 using Assembly and C.
LCD operation:
In recent years the LCD is finding widespread use replacing LEDs (seven-segment LEDs or other
multisegment LEDs). This is due to the following reasons:
The LCD discussed in this section has 14 pins. The function of each pin is given in Table 5-1.
Figure 5.6 shows the pin positions for various LCDs.
While Vcc and Vss provide +5V and ground, respectively, VEE is used for controlling LCD contrast.
There are two very important registers inside the LCD. The RS pin is used for their selection as
follows. If RS = 0, the instruction command code register is selected, allowing the user to send a
command such as clear display, cursor at home, etc. If RS = 1 the data register is selected, allowing the
user to send data to be displayed on the LCD.
R/W, read/write
R/W input allows the user to write information to the LCD or read information from it. R/W =
1 when reading; R/W = 0 when writing.
E, enable
The enable pin is used by the LCD to latch information presented to its data pins. When data is
supplied to data pins, a high-to-low pulse must be applied to this pin in order for the LCD to latch in the
data present at the data pins. This pulse must be a minimum of 450 ns wide.
DO-D7
The 8-bit data pins, DO - D7, are used to send information to the LCD or read the contents of
the LCD's internal registers. To display letters and numbers, we send ASCII codes for the letters A - Z,
a - z, and numbers 0 - 9 to these pins while making RS = 1.
There are also instruction command codes that can be sent to the LCD to clear the display or
force the cursor to the home position or blink the cursor. Table 12-2 lists the instruction command codes.
We also use RS = 0 to check the busy flag bit to see if the LCD is ready to receive information. The
busy flag is D7 and can be read when R/W = 1 and RS = 0, as follows: if R/W= 1, RS = 0. When D7 =
1 (busy flag = 1), the LCD is busy taking care of internal operations and will not accept any new
information. When D7 = 0, the LCD is ready to receive new information. Note: It is recommended to
check the busy flag before writing any data to the LCD.
To send any of the commands from Figure 5.6 to the LCD, make pin RS = 0. For data, make RS
= 1. Then send a high-to-low pulse to the E pin to enable the internal latch of the LCD. This is shown
in Program 5-1. See Figure 5.7 for LCD connections.
Program 5.2 Sending code or data to the LCD with checking busy flag
The above code showed how to send commands to the LCD without checking the busy flag.
Notice that we must put a long delay between issuing data or commands to the LCD. However, a much
better way is to monitor the busy flag before issuing a command or data to the LCD. This is shown in
Program 5.3.
Notice in the above program that the busy flag is D7 of the command register. To read the
command register we make R/W = 1 and RS = 0, and a L-to-H pulse for the E pin will provide us the
command register. After reading the command register, if bit D7 (the busy flag) is high, the LCD is busy
and no information (command or data) should be issued to it. Only when D7 = 0 can we send data or
commands to the LCD. Notice in this method that no time delays are used since we are checking the
busy flag before issuing commands or data to the LCD.
Contrast the Read and Write timing for the LCD in Figures 5.8 and 5.9. Note that the E line is
negative-edge triggered for the write while it is positive-edge triggered for the read.
In the LCD, one can put data at any location. The following shows address locations and how
they are accessed.
where AAAAAAA = 0000000 to 0100111 for line 1 and AAAAAAA - 1000000 to 1100111 for
line 2. See Table 12-3.
The upper address range can go as high as 0100111 for the 40-charac-ter-wide LCD, while for
the 20-character-wide LCD it goes up to 010011 (19 decimal = 10011 binary). Notice that the upper
range 0100111 (binary) = 39 decimal, which corresponds to locations 0 to 39 for the LCDs of 40x2 size.
From the above discussion we can get the addresses of cursor positions for various sizes of
LCDs. See Figure 12-5 for the cursor addresses for common types of LCDs. Note that all the addresses
are in hex. Table 12-4 provides a detailed list of LCD commands and instructions. Table 12-2 is
extracted from this table.
This section begins with an overview of the basic operation of stepper motors. Then we describe
how to interface a stepper motor to the 8051. Finally, we use Assembly language programs to
demonstrate control of the angle and direction of stepper motor rotation.
Stepper motors:
A stepper motor is a widely used device that translates electrical pulses into mechanical
movement. In applications such as disk drives, dot matrix printers, and robotics, the stepper motor is
used for position control. Stepper motors commonly have a permanent magnet rotor (also called the
shaft) surrounded by a stator. There are also steppers called variable reluctance stepper motors that do
not have a PM rotor. The most common stepper motors have four stator windings that are paired with a
center-tapped common as shown in Figure 5.11. This type of stepper motor is commonly referred to as
a. four-phase or unipolar stepper motor. The center tap allows a change of current direction in each of
two coils when a winding is grounded, thereby resulting in a polarity change of the stator. Notice that
while a conventional motor shaft runs freely, the stepper motor shaft moves in a fixed repeat-able
increment, which allows one to move it to a precise position. This repeatable fixed movement is possible
as a result of basic magnetic theory where poles of the same polarity repel and opposite poles attract.
The direction of the rotation is dictated by the stator Poles. The stator poles are determined by the
current sent through the wire coils. As the direction of the current is changed, the polarity is also changed
causing the reverse motion of the rotor. The stepper motor discussed here has a total of 6 leads: 4 leads
representing the four stator windings and 2 commons for the center-tapped leads. As the sequence of
power is applied to each stator winding, the rotor will rotate.
There are several widely used sequences where each has a different degree of precision. Table
5.4 shows a 2-phase, 4-step stepping sequence.
It must be noted that although we can start with any of the sequences in Table 5.5, once we start
we must continue in the proper order. For example, if we start with step 3 (0110), we must continue in
the sequence of steps 4, 1,2, etc.
Step angle
How much movement is associated with a single step? This depends on the internal construction
of the motor, in particular the number of teeth on the stator and the rotor. The step angle is the minimum
degree of rotation associated with a single step. Various motors have different step angles. Table 5.5
shows some step angles for various motors. In Table 5.5, notice the term steps per revolution. This is
the total number of steps needed to rotate one complete rotation or 360 degrees (e.g., 180 steps x 2
degrees = 360). It must be noted that perhaps contrary to one's initial impression, a stepper motor does
not need more terminal leads for the stator to achieve smaller steps. All the stepper motors discussed in
this section have 4 leads for the stator winding and 2 COM wires for the center tap. Although some
manufacturers set aside only one lead for the common signal instead of two, they always have 4 leads
for the stators. Next we discuss some associated terminology in order to understand the stepper motor
further.
Example 5.1
Describe the 8051 connection to the stepper motor of Figure 5.11 and code a program to rotate it
continuously.
Solution:
The following steps show the 8051 connection to the stepper motor and its programming.
Use an ohmmeter to measure the resistance of the leads. This should identify which COM leads
are connected to which winding leads.
The common wire(s) are connected to the positive side of the motor's power supply.
In many motors, +5 V is sufficient.
The four leads of the stator winding are controlled by four bits of the 8051 port (Pl.O
- P1.3). However, since the 8051 lacks sufficient current to drive the stepper motor
windings, we must use a driver such as the ULN2003 to energize the stator. Instead
of the ULN2003, we could have used transistors as drivers, as shown in Figure 17-9.
However, notice that if transistors are used as drivers, we must also use diodes to
take care of inductive current generated when the coil is turned off. One reason that
using the ULN2003 is preferable to the use of transistors as drivers is that the
ULN2003 has an internal diode to take care of back EMF.
Change the value of DELAY to set the speed of rotation. We can use the single-bit instructions
SETB and CLR instead of RR A to create the sequences.
The relation between rpm (revolutions per minute), steps per revolution, and steps per second is
as follows.
The switching sequence shown earlier in Table 5.4 is called the 4-step switching sequence since
after four steps the same two windings will be "ON" How much movement is associated with these four
steps? After completing every four steps, the rotor moves only one tooth pitch. Therefore, in a stepper
motor with 200 steps per revolution, the rotor has 50 teeth since 4x50 = 200 steps are needed to complete
one revolution. This leads to the conclusion that the minimum step angle is always a function of the
number of teeth on the rotor. In other words, the smaller the step angle, the more teeth the rotor passes.
Servos are DC motors with built in gearing and feedback control loop circuitry. And no motor
drivers required. They are extremely popular with robot, RC plane, and RC boat builders. Most servo
motors can rotate about 90 to 180 degrees. Some rotate through a full 360 degrees or more. However,
servos are unable to continually rotate, meaning they can't be used for driving wheels, unless they are
modified (how to modify), but their precision positioning makes them ideal for robot legs and arms,
rack and pinion steering, and sensor scanners to name a few.
Since servos are fully self-contained, the velocity and angle control loops are very easy to
implement, while prices remain very affordable. To use a servo, simply connect the black wire to
ground, the red to a 4.8-6V source, and the yellow/white wire to a signal generator (such as from your
microcontroller). Vary the square wave pulse width from 1-2 ms and your servo is now position/velocity
controlled. Pulse width modulation (PWM) is a powerful technique for controlling analog circuits with
a processor's digital outputs. PWM is employed in a wide variety of applications, ranging from
measurement and communications to power control and conversion. The general concept is to simply
send an ordinary logic square wave to your servo at a specific wave length, and your servo goes to a
particular angle (or velocity if your servo is modified). The wavelength directly maps to servo angle.
PWM
Pulse width modulation (PWM) is a powerful technique for controlling analog circuits with a
processor's digital outputs. PWM is employed in a wide variety of applications, ranging from
measurement and communications to power control and conversion. The general concept is to
simply send an ordinary logic square wave to your servo at a specific wave length, and your servo
goes to a particular angle (or velocity if your servo is modified). The wavelength directly maps
to servo angle.
The PCA is a special modules in Philips P89V51RD2 which includes a special 16-bit Timer that
has five 16-bit capture/compare modules associated with it. Each of the modules can be programmed to
operate in one of four modes: rising and/or falling edge capture, software timer, high-speed output, or
pulse width modulator. Each module has a pin associated with it in port 1.
Module 0 is connected to P1.3 (CEX0), module 1 to P1.4 (CEX1), etc. Registers CH and CL
contain current value of the free running up counting 16-bit PCA timer. The PCA timer is a common
time base for all five modules and can be programmed to run at: 1/6 the oscillator frequency, 1/2 the
oscillator frequency, the Timer 0 overflow, or the input on the ECI pin (P1.2). The timer count source
is determined from the CPS1 and CPS0 bits in the CMOD SFR.
In the CMOD SFR there are three additional bits associated with the PCA. They are CIDL which
allows the PCA to stop during idle mode, WDTE which enables or disables the Watchdog function on
module 4, and ECF which when set causes an interrupt and the PCA overflow flag CF (in the CCON
SFR) to be set when the PCA timer overflows. The Watchdog timer function is implemented in module
4 of PCA. Here, we are interested only PWM mode.
All of the PCA modules can be used as PWM outputs. Output frequency depends on the source
for the PCA timer. All of the modules will have the same frequency of output because they all
share one and only PCA timer.
The duty cycle of each module is independently variable using the module's capture register
CCAPnL. When the value of the PCA CL SFR is less than the value in the module's CCAPnL SFR the
output will be low, when it is equal to or greater than the output will be high.
When CL overflows from FF to 00, CCAPnL is reloaded with the value in CCAPnH. This
allows updating the PWM without glitches. The PWM and ECOM bits in the module's CCAPMn
register must be set to enable the PWM mode. For more details see P89V51RD2 datasheet.
This is an example how to control servos with 8051 by using PWM. The schematic is shown below.
I use P1.4 (CEX1) to control the left servo and P1.2 (CEX2) to control the right servo. Here, I use
GWS servo motor model S03T STD. I need three states of duty cycle:
Calculation for duty cycle (for XTAL 18.432 MHz with 6 Clock/Machine cycle)
5.13.2 Program
Filename : pwm_servos.h
Hardware : Controller -> P89V51RD2
XTAL -> 18.432 MHz
Mode -> 6 Clock/MC
I/O : P1.4 -> Left (PWM-CEX1)
P1.5 -> Right (PWM-CEX2)
Compiler : SDCC
/* Control the Left servo */
void ServoL_back()
{
CCAP1H = 243;
}
void ServoL_forward()
{
CCAP1H = 230;
}
void ServoL_stop()
{
CCAP1H = 0;
}
/* Control the Right servo */
void ServoR_back()
{
CCAP2H = 230;
}
void ServoR_forward()
{
CCAP2H = 243;
}
void ServoR_stop()
{
CCAP2H = 0;
}
Many washing m/c shell in the market has mechanical controlled sequence for activated the
timer and the sequence back and forth for their motor; washing motor or spinning motor. Spinning
motor control only has one direction only, and its simple could be changed to the discrete mechanical
timer which sell on the market. But washing motor control has 2 direction for this purpose, it means
to squeeze the clothes, it must go to forward and then reversed. The sequence is like this:
5.14.1 Schematic
Timing sequence like the above description, can be implemented with many way, by using
discrete electronic components, timer, using a program or a microcontroller or microprocessor, etc.
Because I am learning the PIC microcontroller for right now, I will implement this function using this
microcontroller, but for you who familiar with another kind of microcontroller my adapted it to your
purpose. By using PIC micro, it can be made more compact. First I plan to make 2 buttons, 1 for set
the timer and another for reset the timer or for the emergency stop push button. Then to know the timer
works or not, I need a visual display.
For this purpose I will use 7-segmen display showing the rest of the timer. To run the motor
sequence of course I need a pair of relays (power relays, about 3 Amperes output), one for forward
and another for reverse option. I will use the very common family of PIC micro, ie : 16F84A, because
this is the most popular type and very simples used and very much used. Also can be obtained easily
in the market. But this is the medium type of PIC micro family. It has 1kByte of memory (EEPROM
type) and 13 I/O pins. It can be reprogrammable thousands times. Because the I/O just only 13 pins, I
used a BCD to 7-segmen chip. So it will left a few I/O pins for expanded in the future. You can
omitted this chip for timing sequence purpose and save one IC price, because the I/O just exactly
enough.
The I/O can be configured as input pin or output pin bit-ly. It is up to you to choose the I/O pin
number goes to what function, but it infect the program firmware of course. Once you choose,
then it is just like that, except you also change both, the program and the hardware.
The direction of rotation can be controlled when switchS1 is in position A, coil L1 of the motor
receives the current directly, whereas coil L2 receives the current with a phase shift due to
capacitor C. So the rotor rotates in clockwise direction (see Fig. 2(a)). When switch S1 is in
position B, the reverse happens and the rotor rotates in anti-clock wise direction Thus switch S1 can
change the rotation direction. The motor cannot be reversed instantly. It needs a brief pause between
switching directions, or else it may get damaged. For this purpose, another spin direction control
timer (IC2) is employed. It is realised with an IC 555. This timer gives an alternate „on‟ and „off‟
time duration of 10 seconds and 3 seconds, respectively. So after every l0 seconds of running (either
in clockwise or anti clockwise direction), the motor stops for a brief duration of 3 seconds. The values
of R3 and R4 are calculated accordingly. The master timer is realised with monostable IC555 (IC1) and
its „on‟ time is decided by the resistance of 1-mega- ohm potmeter VR. A 47-kilo-ohm resistor is added
in series so that even when the VR knob is in zero resistance position, the net series resistance is not
zero
QUESTION BANK
UNIT-1
It is used:
For measurements, display and control of current, voltage, Temperature, pressure, etc.
For traffic control and industrial tool control.
For speed control of machines.
The accumulator is the register associated with the ALU operations and sometimes I/O
operations. It is an integral part of ALU. It holds one of d a t a t o be processed by ALU. It also
temporarily stores the result of the operation performed by the ALU.
It is an output line through which the microprocessor sends output serial data.
7.What is an opcode?
The part of the instruction that specifies the operation to be performed is called the
operation code or opcode.
9. What is an operand?
12 Address lines.
HOLD
HLDA
This state is used by slow peripheral devices. The peripheral devices can transfer the data to
or from the microprocessor by using READY input line. The microprocessor remains in the wait
state as long as READY line is low. During the wait state, the contents of the address, address/data and
control buses are held constant.
Polling or device polling is a process which identifies the device that has interrupted the
microprocessor.
The 8085 microprocessor has five interrupt inputs. They are TRAP, RST7.5, RST 6.5, RST
5.5, and INTR. these interrupts have a fixed priority of interrupt service. If two or more interrupts
go high at the same time, the 8085 will service them on priority basis. The TRAP has the highest priority
followed by RST7.5, RST6.5, and RST5.5. The p r i o r i t y of interrupts in 8085 is shown in the
table.
Interrupts priority
TRAP 1
RST7.5 2
RST6.5 3
RST5.5 4
INTR 5
Address bus
Data bus
Control and status signals
Power supply and frequency signals
Externally intiated signals
Serial I/O ports
The 8085 has 5 interrupt signals they have INTR, RST7.5, RST6.5, RST5.5 and TRAP
The primary function of memory interfacing is that the microprocessor should be able to read
from and write into a given register of a memory chip.to perform these operations the
microprocessor should,
The ALE is used to latch the lower order address so that it can be available in T2 and T3 and
used for identifying the memory address. During T1 the ALE goes high, the latch is transparent ie,
the output changes according to the input data, so the output of the latch is the lower order address.
When ALE goes low, the lower order address is latched until the next ALE.
24. How many machine cycles does 8085 have? Mention them.
Opcode fetch
Memory read
Memory write
I/O read
I/Owrite
Interrupt acknowledge
Bus idle
HOLD indicates that a peripheral such a DMA controller is requesting the use of address bus,
data bus and control bus.
READY is used to delay the microprocessor read or write cycles until a slow responding
peripheral is ready to accept or send data.
SID is used to accept serial data bit by bit.
It is used to increase the driving capacity of data bus. The data bus of the microcomputer system
is bidirectional, so it requires a buffer that allow the data to flow in both directions.
W(8)Register
Z(8) Register
B(8)Register
E(8)Register
H(8) Register
L(8) Register
Stack pointer(16)
Program counter(16)
Microcontroller is a device that includes microprocessor, memory and I/O signal lines on a
single chip, fabricated using VLSI technology.
Microcomputer is a computer that is designed using microprocessor as its CPU.it
includes microprocessor, memory and I/O.
The flags are used to reflect the data conditions in the accumulator. The 8085 flags are
S-sign flag
Zero flag
Auxiliary flag
Parity flag
Carry Flag
An interface is a shared boundary between the devices which involves sharing information.
Interfacing is the process of making two different systems communicate with each other.
The assignment of address to various I/O devices in the memory chip is called as I/O
Mapping
………………………………………………………………….
8 Marks Questions
1. Describe the functional pin diagram of 8085.
2. Describe the functional block diagram of 8085.
3. Explain the 8085 interrupt system in detail.
4. Explain various machine cycles supported by 8085
5. What is the difference between minimum and maximum modes of 8086? How are T modes selected?
6. Describe the sequence of event that may occur during the different T state in the opcode fetch
machine cycle of 8086
7. List out the maskable and non maskable interrupts available in 8086
8. Write short notes on addressing memory
9. Give the functions of NMI, BHE and TEST pins of 8086
10. Write notes on addressing input and output devices.
11. Describe the sequence of event that may occur during the different T state in the opcode fetch
machine cycle of 8086
12. Explain the concept of pipelining in 8086. Discuss its advantages and disadvantages
………………………………………………………………….
16 Marks Questions
UNIT-2
1. What is an instruction?
2. How many operations are there in the instruction set of 8085 microprocessor?
3. List out the five categories of the 8085 instructions. Give e.g. of the instructions for each
group?
A JMP instruction permanently changes the program counter. A CALL instruction leaves
information on the stack so that the original program execution sequence can be resumed.
The IN instruction is used to move data from an I/O port in to the accumulator.
The OUT instruction is used to move data from the accumulator to an I/O port.
The IN and OUT instructions are used only on microprocessor, which u s e a separate
address space for interfacing.
A rotate instruction is a closed loop instruction .that is the data moved out at one end is put
back in at the other end. The shift instruction loses the data that is moved out of the last bit
locations.
7. List the four instructions which control the interrupt structure of the 8085
microprocessor?
DI(disable interrupts)
EI(enable interrupts)
RIM(read interrupt masks)
SIM(set interrupt masks)
8. Mention the categories of instruction and give two ex for each category?
LDA copies the data byte in to the accumulator from the memory location specified by the
16-bit address. STA copies the data byte from the accumulator in the memory location specified
by 16-bit address. DAA changes the content of the accumulator from binary to 4-bit BCD digits
The instruction set is grouped in to the following formats One byte instruction MOV C,A
Two byte instruction MVI A,39H Three byte instruction JMP 2345H
11. What is the use of addressing modes, mention the different types?
The v a r i o u s formats of specifying the operands are called as addressing modes, it is used to access
the operands or data. The different types are as follows
1. Immediate addressing
2. Register addressing
3. Direct addressing
4. Indirect addressing
5. Implicit addressing
The stack is a group of memory locations in the R/W memory that is used for the
temporary storage of binary information during the execution of the program. The stack related
instructions are PUSH and POP
The XRA A instruction is used to clear the contents of the accumulator and store the
value 00H
CALL PUSH
When CALL is executed the stack pointer is When PUSH is executed the stack pointer
decremented by two register is decremented by two
15. How does the microprocessor differentiate b/w data and instruction?
When the first m/c code of an instruction is fetched and decoded in the instruction register, the
RET POP
RET transfers the content of the top two locations Pop transfers the content of the top two locations
of the stack to the PC of the stack to the specified register pair
When RET is executed the SP is incremented by When POP is executed the SP is incremented by
two. And it has 8 conditional RETURN two and no conditional POP instructions
instructions
A recursive procedure is a procedure, which calls itself. Recursive procedures are used to
work with complex data structures called trees. If the procedure is called with N=3, then the N i s
decremented by 1 after each procedure CALL and the procedure is called until N=0.
The timing and control unit synchronizes all the microprocessor operations with clock and
generates control signals necessary for communication between the microprocessor and
peripherals.
A minimum s/m is one which is formed using minimum number of IC chips. The 8085
based minimum s/m is formed using 8155, 8355 & 8755.
………………………………………………………………….
8 Marks Questions
2. Write a program to unpack a two digit BCD number stored at memory location 1C00H
4. Write a program to find the number of negative, zero and positive numbers
8. Explain the BCD to Decimal code conversion technique and write 8085 assembly language
9. Explain the BCD to Seven Segment code conversion technique and write 8085 assembly
11. Discuss the operation of Looping, Counting and indexing with Look up table
………………………………………………………………….
16 Marks Questions
………………………………………………………………….
UNIT- 3
PERIPHERAL INTERFACING
2. What are the different types of methods used for data transmission?
Simplex
Duplex
Half Duplex
In simplex mode, data is transmitted only in one direction over a single communication channel.
For example, a computer (CPU) may transmit data for a CRT display unit in this mode.
In duplex mode, data may be transferred between two trans receivers in both directions
simultaneously.
In half duplex mode, on the other hand, data transmission may take place in either direction,
but at a time may be transmitted only in one direction. For example, a computer may communication
with a terminal in this mode. When the terminal sends data (i.e. terminal is sender).The message is
received by the computer (i.e. computer is receiver). However, it is not possible to transmit data
from the computer to terminal and from terminal to the computer simultaneously.
It is a data method which is used when the I/O device and the microprocessor match in
speed. The transfer a data to or from the device, the user program issues a suitable instruction
addressing the device. The data transfer is completed at the end of the execution of this
instruction.
It is a data transfer method which is used when the speed of I/O device does not match with
the speed of the microprocessor. Asynchronous data transfer is also called as Handshaking.
The control words of 8251A are divided into two functional types
Mode Instruction control word: - This defines the general operational characteristics of 8251A.
Command Instruction control word: - The command instruction controls the actual operations of
the selected format like enable transmit/receiver, error reset and modem control.
I/O mode.
BSR mode
In I/O mode, the 8255 ports work as programmable I/O ports, while in BSR mode only port C
(PC0-PC7) can be used to set or reset its individual port bits. Under the IO mode of operation, further
there are three modes of operation of 8255, So as to support different types of applications,
viz. mode 0, mode 1, and mode 2.
Two 8-bit ports (port A and port B) and two 4-bit ports (port C upper and lower) are available.
Thetwo 4-bit ports can be combined used as a third8-bitport.
Any port can be used as an input or output port.
Output ports are latched. Input ports are not latched.
A maximum of four ports are available so that overall 16 I/O configurations are possible.
Two groups A and group B are available for strobe data transfer.
Each group contains one 8-bit data I/O port and one 4-bit control/data port.
The 8-bit data port can be either used as input or output port. The inputs and outputs both are
latched.
Out of 8-bit port C, PC0-PC2 is used to generate control signals for port B and PC3=PC5 are
used to generate control signals for port A. The inputs PC6, PC7 may be used as independent
data lines.
10. What are the signals used in input control signal and output control signals?
The 8-bit port is bi-directional and additionally a 5-bit control port is available.
Three I/O lines are available at port C, viz PC2-PC0.
Inputs and output are both latched.
The 5-bit control port C (PC3-PC7) is used for generating/accepting handshake Signals for the
8-bit data transfer on port A.
Each of the three counters of 8253 can be operated in one of the following six modes of operation.
13. What are the different types of write operations used in 8253?
The control word register accepts data from the data buffer and initialize
The mode control register is a write only register and the CPU cannot read its contents.
Buffered Mode
Cascade Mode
The scan counter has two modes to scan the key matrix and refresh the display. In the encoded
mode, the counter provides binary count that is to be externally decoded to provide the scan lines for
keyboard and display. In the decoded scan mode, the counter internally decodes the least significant 2
bit and provides a decoded 1 out of 4 scan on SL3-SL 3. The keyboard and display both are in the
same mode at a time.
8279 provides two output modes for selecting the display options.
Display scan
In this mode, 8279 provides 8 or 16 character- multiplexed displays those can be organized as
dual 4-bit or single 8-bit display units.
Display Entry 8279 allows options for data entry on the displays. The display data is entered
for display from the right side or from the left side.
In the left entry mode, the data is entered from the left side of the display unit.
In the right entry mode, the first entry to be displayed is entered on the rightmost display.
The modem control unit handles the modem handshake signals to coordinate the
communication between the modem and the USART.
a) I/O Mode
It is a word stored in a register (control register) used to control the operation of a program
digital device.
23. What is the purpose of control word written to control register in 8255?
The control words written to control register specify an I/O function for each I/O port. The
bit D7 of the control word determines either the I/O functions of the BSR function.
8251 chip is mainly used as the asynchronous serial interface between the processor and the
external equipment.
Keyboard/ Display
Keyboard section
Scan section
Display section
CPUinterface section
Mechanical switch are used as keys in most of the keyboard. When a key is pressed the contact
bounce back and forth and settle down only after a small time delay (about 20ms). Even though a key
is actuated once, it will appear to have been actuated several times. This problem is called Key
Bouncing
This output pin carries serial of the transmitted data bits along with other information like start bit,
stop bits and priority bit.
The hold request output request the access of the system bus. In non- cascaded 8257
systems, this is connected with HOLD pin of CPU. In cascade mode, this pin of a slave is
connected with a DRQ input line of the master 8257, while that of the master is connected with HOLD
input of the CPU.
This input pin of 8251A receives a composite stream of the data to be received by 8251A.
The internal devices of a DAC are R/2R resistive network, an internal latch and current to voltage
converting amplifier.
The time taken by the DAC to convert a given digital data to corresponding analog signal is called
conversion time.
The different types of ADC are successive approximation ADC, counter type ADC, flash type
ADC, integrator converters and voltage to frequency converters
………………………………………………………………….
8 Marks Questions
1. Using model, write a program to communicate between two microprocessors using 8255
3. Explain the advantages of using the USART chips in microprocessor based systems
4. Show the control word format of 8255 and explain how each bit is programmed
5. Use RST 5.5 instead of RST 7.5 and change mask pattern accordingly
6. Describe with any one of the mode configurations of 8254 timer in detail
7. Use RST 5.5 instead of RST 7.5 and change mask pattern accordingly
10. Explain the advantages of using the keyboard and display controller chips in microprocessor
based system
………………………………………………………………….
16 Marks Questions
………………………………………………………………….
UNIT-IV
MICROCONTROLLERS 8051
A device which contains the microprocessor with integrated peripherals like memory,
serial ports, parallel ports, timer/counter, interrupt controller, data acquisition interfaces like
ADC, DAC is called microcontroller.
DJNZ Rn, rel Decrement the content of the register Rn and jump if not zero.
DJNZ direct, rel Decrement the content of direct 8- bit address and jump if not zero.
3. State the function of RS1 and RS0 bits in the flag register of Intel 8051 microcontroller?
Bank 0
Bank 1
Bank 2
Bank 3
RD WR T1 T0
5. Specify the single instruction, which clears the most significant bit of B register of 8051,
without affecting the remaining bits.
Single instruction, which clears the most significant bit of B register of 8051, without
affecting the remaining bits, is CLR B.7.
PSEN: PSEN stands for program store enable. In 8051 based system in which an external
ROM holds the program code, this pin is connected to the OE pin of the ROM.
EA: EA stands for external access. When the EA pin is connected to Vcc, program fetched to address
0000H through 0FFFH are directed to the internal ROM and program fetches to addresses
1000H through FFFFH are directed to external ROM/EPROM. When the EA pin is grounded, all
addresses fetched by program are directed to the external ROM/EPROM.
DPTR stands for data pointer. DPTR consists of a high byte (DPH) and a low byte (DPL).
Its function is to hold a 16-bit address. It may be manipulated as a 16- bit data registers. It
serves as a base register in indirect jumps, lookup table instructions and external data transfer.
SP:
SP stands for stack pointer. SP is a 8-bit wide register. It is incremented before data is
stored during PUSH and CALL instructions. The stack array can reside anywhere in-chip RAM.
The stack pointer is initiailsed to 07H after a reset. This causes the stack to begin at location. 08H.
Accumulator
B Register
Stack pointer.
Data pointer
Interrupt priority control register.
Interrupt enable control register.
ET2- Timer 2 interrupt enable bit. ES- Enable serial port control bit. ET1- Enable Timer1
control bit.
EX1-Enable external interrupt1 control bit. ET0-Enable Timer0 control bit.
EX0-Enable external interrupt0 control bit.
Microprocessor Microcontroller
2. It has many instructions to move data It has many instructions to move between memory
and CPU. data between memory and CPU.
3. It has one or two bit handling it has many bit handling instructions.
instruction .
4. Access times for memory and I/O Less access times for built-in memory
Devices are more. and I/O devices.
Vector address
Serial interrupt
12. Write a program to subtract the contents of RI of Bank0 from the contents of R0 0f Bank2.
MOV A, R0
SUBB A, R1
13. How the RS-232 serial bus is interrupt to 1TL logic device?
The RS-232 signal voltage level devices are not compatible with TTL logic levels. Hence for
interfacing TTL devices to RS-232 serial bus, level converters are used. The popularly used level
converters are MC 1488 & MC 1489 or MAX 232.
In this mode serial enters & exits through RXD, TXD outputs the shift clock 8 bits are
transmitted/received: 8 data bits (LSB first). The baud rate is fixed at 1/12 the oscillator
frequency.
In this mode 11 bits are transmitted (through TXD) or received (through RXD): a start bit (0),
8 data bits (LSB first) a, programmable 9th data bit, & a stop bit (1).ON transmit the 9th data bit
(TB* in SCON) can be assigned the value of 0 or 1.
For eg: the parity bit (P, in the PSW) could be moved into TB8. On receive the 9th data bit
go in to the RS8 in Special Function Register SCON, while the stop bit is ignored. The baud rate
is programmable to either 1/32, or 1/64 the oscillator frequency.
In this mode 11 bits are transmitted (through TXD) or received (through RXD): a start bit (0),
8 data bits (LSB first) a, programmable 9th data bit, & a stop bit (1). In fact, Mode 3 is the same
as Mode 2 in all respect except the baud rate. The baud rate in Mode 3 is variable.
In all the four modes, transmission is initiated by any instruction that uses SBUF as a destination
register. Reception is initiated in Mode 0 by the condition RI=0 & REN=1. Reception is initiated in
other modes by the incoming start bit if REn=1.
Direct addressing
Register addressing
Register indirect addressing
Implicit addressing
Immediate addressing
Index addressing
Bit addressing
………………………………………………………………….
8 Marks Questions
4. Explain the interrupt structure of 8051 microcontroller Explain how interrupts are Prioritized
………………………………………………………………….
16 Marks Questions
………………………………………………………………….
UNIT V
1. Write a program using 8051 assembly language to change the data 55h stored in the lower
byte of the data pointer register to AAH using rotate instruction?
MOV DPL,#55H
MOV A,DPL RL A
2. Explain the contents of the accumulator after the execution of the following program
segments?
MOV A,#3CH
A 3C R4 66
A 24
MOV A,#30
MOV A,#data 1
MOV B,#data 2
MUL AB
MOV DPTR,#5000
MOV A,B
MOVX@DPTR,A
MOV A,#data
ANL A,#81
MOV DPTR,#4500
LCALL(Long CALL)
ACALL(Absolute CALL)
Each increments the pc to the 1st byte of the instruction & pushes them in to the stack.
LJMP(Long-jump)-address 16
AJMP(Absolute jump)-address 11
Sjmp(short jump)-relative address
MOV A,#30
MOV A,R0
CPL A INC A
MOV A,#30H
ADD A,#50H
MOV A,#data
SWAP A
12. Write a program to subtract two 8-bit numbers & exchange the digits using 8051?
SUBB A,R0
SWAP A
13. Write a program to subtract the contents of R1 of bank 0from the contents of R0 of
bank 2 using 8051?
MOV PSW,#10
MOV A,R0
MOV PSW,#00
SUBB A,R1
In this mode serial enters & exits through RXD,TXD output the shift clock 8 bits are transmitted
or received 8 data bits(LSB first).the baud rate is fixed at 1/12 the oscillator frequency.
In this mode 11 bits are transmitted (through TXD)or received(through RXD)A start
bit(0),8 data bits(LSB first),a programmable 9th data bit & a stop bit(1) ON transmit the 9th data
bit(TB*in SCON) can be assigned the value of 0 or 1.or for eg: the parity bit(p,in the PSW) could be
moved into TB8. On receive the 9th data bit go in to the RB8 in special function register SCON,
while the stop bit is ignored. The baud rate is programmable to either 1/32 or 1/64 the oscillator
frequency.
The task involved in keyboard interfacing are sensing a keyboard interfacing are sensing a
key actuation, de bouncing the key and generating key codes(decoding the key).these task are
performed software if the keyboard is interfaced through ports and they are performed by
hardware if the keyboard is interfaced through 8279.
The return lines RL0 to RL7 of 8279 are used to form the columns of keyboard matrix.in
decoded scan the scan lines SLO to SL3 of 8279 are used to form the rows of keyboard matrix. In
encoded scan mode, the output lines of external decoder are used as rows of keyboard matrix.
The process of sending a zero to each row of a keyboard matrix and reading the columns for
key actuation is called scanning. The scan time is the time taken by the processor to scan all the
rows one by one starting from first row and coming back to the first row.
In display devices the process of sending display codes to 7-segment LED’S to display the
led’s one by one is called scanning. The scan time is the time taken to display all the 7- segment
LED’S one by one, starting from first LED and coming back to the first LED again.
The input devices used in the microprocessor- based system are keyboards, DIP switches ADC,
floppy disc, etc.
………………………………………………………………….
8 Marks Questions
1. Write 8051 ALP to read data from port I when negative edge triggered at INTO and supply the data
2. Write 8051 ALP to transmit ‘Hello World’ to PC at 9600 baud for external crystal frequency of
11.0592MHz
………………………………………………………………….
16 Marks Questions
1. With a neat circuit diagram explain how a 4 х 4 keypad is interfaced with 8051 microcontroller and
2. Draw the schematic for interfacing a stepper motor with 8051 microcontroller and write 8051 ALP
3. Draw the schematic for interfacing a servo motor with 8051 microcontroller and write 8051 ALP for
………………………………………………………………….
UNIVERSITY
QUESTION PAPERS
21
EE 2354 — MICROPROCESSORS AND MICROCONTROLLERS
(Regulation 2008)
Time : Three hours Maximum : 100 marks
Answer ALL questions
4
PART A — (10 × 2 = 20 marks)
1. Specify the size of data, address, memory word and memory capacity of
8085 microprocessor.
2. How is the memory segment accessed by 8086 microprocessor identified?
3. State the function of given 8085 instructions: JP, JPE, JPO, JNZ.
4. How is PUSH B instruction executed? Find the status after the execution.
21
5. What are the different ways to end the interrupt execution in 8259
programmable Interrupt controller?
6. What is the function of Scan section in 8279 programmable
keyboard/Display Controller?
7. List the alternative functions assigned to Port 3 pins of 8051
4
microcontroller.
8. Mention the size of DPTR and Stack Pointer in 8051 microcontroller.
9. What is the operation of the given 8051 microcontroller instructions: XRL
A, direct?
10. What are the different operations performed by Boolean variable
instructions of 8051?
21
PART B — (5 × 16 = 80 marks)
11. (a) (i) Explain the architecture, data flow and instruction execution of
8085 microprocessor. (8)
(ii) With timing diagram, explain the memory read operation in
8085 microprocessor. (8)
4
Or
(b) (i) Show the pin configuration and function of signals of 8086
microprocessor. (8)
(ii) Show the memory organization and interfacing with 8086
microprocessor. Explain how the memory is accessed. (8)
12. (a) (i) Describe the instruction format and addressing modes of 8085
microprocessor. (8)
(ii) Write an assembly language program based on 8085
microprocessor instruction set to search the smallest data in a
set. (8)
Or
(b) (i) With suitable example, discuss about 8085 microprocessor
instructions used for data manipulation. (8)
(ii) Write an assembly language program based on 8085
21
microprocessor instruction set to find the square root of data
from 1 to n using Lookup table. (8)
13. (a) (i) Explain the operation of 8255 PPI Port A programmed as input
and output in Mode 1 with necessary handshaking signals. (8)
(ii) Show and explain the ADC interfacing with 8085
4
microprocessor.
(8)
Or
(b) With functional block diagram, explain the operation and
programming of 8251 USART in detail. (16)
14. (a) Discuss about the organization of Internal RAM and Special function
21
registers of 8051 microcontroller in detail. (16)
Or
(b) (i) Explain the Interrupt structure with the associated registers in
8051 microcontroller. (8)
(ii) Explain in detail the modes of operation of Timer unit in 8051
4
microcontroller. (8)
15. (a) (i) Explain the Data transfer instructions and Program control
instructions of 8051 microcontroller. (8)
21
Or
(b) (i) Explain the interfacing of Keyboard/Display with 8051
microcontroller. (8)
(ii) Explain the Servomotor control using 8051 microcontroller. (8)
4
————––––——
2 11322
Anna University
B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER 2011.
Sixth Semester
Electrical and Electronics Engineering
EE 2354 — MICROPROCESSORS AND MICROCONTROLLER
(Regulation 2008)
Time : Three hours Maximum : 100 marks
Answer ALL questions.
PART A — (10 × 2 = 20 marks)
1. Draw the schematic of latching low-order address bus in 8085 microprocessor.
2. If the stack segment register contains 3000h and stack pointer register contains 8434h, what is the physical address of the
top of the stack in 8086 microprocessor?
3. Why do we need look-up table?
4. How are the 8085 instructions classified according to the functional categories?
5. Draw the ‘Mode Word’ format of 8251 USART.
6. State the use of ISR and PR registers in 8259 PIC.
7. List the on-chip peripherals of 8051 microcontroller.
8. What are the addressing modes of 8051 microcontroller?
9. Why do we need opto-isolator circuit between microcontroller and the Stepper motor?
10. Mention the I/O instructions of 8051 microcontroller.
PART B — (5 × 16 = 80 marks)
11. (a) (i) Explain in detail the 8085 interrupt structure. (8)
(ii) Draw the timing diagram for IN and OUT instruction of 8085 and explain. (8)
Or
(b) (i) Draw the internal block diagram of 8086 and explain the bus interface unit and execution unit. (8)
(ii) How address decoding is done in memory Interface. (8)
12. (a) (i) Write a program to count from 0 to 9 with one second delay between each count. At the count of 9, the counter
should reset itself to 0 and repeat the sequence continuously. Assume the clock frequency is 1 MHz. (8)
(ii) Write a program with a flowchart to multiply two 8-bit numbers.(8)
Or
(b) (i) Compare the similarities and differences of CALL and RET instructions with PUSH and POP instructions. (8)
(ii) Sixteen bytes are stored in memory locations at XX50h to XX5Fh. Transfer the entire block of data to new memory
locations starting at XX70h. (8)
13. (a) (i) Explain the operating modes of 8255 programmable peripheral interface. (8)
(ii) Draw the logical block diagram of 8279 keyboard display controller and explain. (8)
Or
(b) (i) Draw the control word of 8253 timer/counter and explain the operating modes of 8253 timer/counter. (8)
(ii) Why do we need A/D converter and D/A converter? Draw the block diagram to interface 8085 microprocessor with A/D
convertor and D/A convertor. (8)
14. (a) (i) Explain the program memory and data memory structure of 8051 microcontroller. (8)
(ii) Draw the pin diagram of 8051 microcontroller and explain its port structure. (8)
Or
(b) (i) Draw the TMOD register format and explain the different operating modes of timer in 8051 microcontroller. (8)
(ii) Explain how serial communication is performed in 8051 microcontroller. (8)
15. (a) (i) Explain with a program to rotate the stepper motor in both clockwise and anticlockwise direction using 8051
microcontroller. (8)
(ii) How to interface a 7 segment display using 8051 microcontroller. (8)
Or
(b) (i) How 8051 is used in washing machine control? (8)
(ii) How do you interface a 4 × 4 matrix keyboard using 8051 microcontroller? (8)
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.com
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.com
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.com
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.com
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.com
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.com
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.com
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re
www.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.rejinpaul.comwww.re