.
2 Marks
& 16marks
UNIT-V
MICROCONTROLLERS
1. What
is mean by microcontroller?
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.
2.
Explain DJNZ instructions of intel 8051 microcontroller?
a) DJNZ
Rn, rel
Decrement
the content of the register Rn and jump if not zero.
b) DJNZ
direct , rel
Decrement
the content of direct 8-bit address and jump if not zero.
3. Write
a program using 8051 assembly language to change the date 55H
stored in
the lower byte of the data pointer register to AAH using rotate
instruction.
MOV
DPL,#55H
MOV A,
DPL
RL A
Label
:SJMP label
4 Give
the alternate functions for the port pins of port3?
RD – Read
data control output.
WR –
Write data control output.
T1 –
Timer / Counter1 external input or test pin.
T0 –
Timer / Counter0 external input or test pin.
INT1-
Interrupt 1 input pin.
INT 0 –
Interrupt 0 input pin.
TXD –
Transmit data pin for serial port in UART mode.
RXD -
Receive data pin for serial port in UART mode.
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.
6.
Explain the function of the pins PSEN and EA of 8051.
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 addresses 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.
7.
Explain the 16-bit registers DPTR and SP of 8051.
DPTR:
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 register or as two independent 8-bit 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 on-chip RAM. The stack pointer is initialised to 07H after a
reset.
This causes the stack to begin at location
08H.
8 Name
the special functions registers available in 8051.
Accumulator
B Register
Program Status Word.
Stack Pointer.
Data Pointer.
Port 0
Port 1
Port 2
Port 3
Interrupt priority control register.
Interrupt enable control register.
9.Explain
the register IE format of 8051.
EA-
Enable all control bit.
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.
.
10.Name
the five interrupt sources of 8051?.
The
interrupts are:
Vector
address
External interrupt 0 : IE0 : 0003H
Timer interrupt 0 : TF0 : 000BH
External interrupt 1 : IE1 : 0013H
Timer Interrupt 1 : TF1 : 001BH
Serial Interrupt
Receive
interrupt : RI : 0023H
Transmit
interrupt: TI : 0023H
11.Explain
the contents of the accumulator after the execution of the following
program
segments:
MOV
A,#3CH
MOV
R4,#66H
ANL A,R4
A 3C
R4 66
A 24
12. Write
a program to load accumulator A, DPH and DPL with 30H.
MOV A,#30
MOV DPH,A
MOV DPL,A
13.Write
a program to subtract the contents of R1 of Bank0 from the contents
of R0 of
Bank2.
MOV
PSW,#10
MOV A,R0
MOV
PSW,#00
SUBB A,R1
14. How
the RS -232C serial bus is interfaced to 1TL logic device?
The
RS-232C signal voltage levels are not compatible with TTL logic
levels.
Hence for interfacing TTL devices to RS-232C serial bus, level converters are
used. The
popularly used level converters are MC 1488 & MC 1489 or MAX 232.
15. List
some of the features of 8096 microcontroller.
a. The
8096 is a 16-bit microcontroller.
b. The
8096 is designed to use in applications which require high speed
calculations
and fast I/O operations.
c. The
high speed I/O section of an 8096 includes a 16-bit timer, a 16-bit
counter,
a 4 input programmable edge detector, 4 software timers and
a
6-output programmable event generator.
d. It has
100 instructions, which can operate on bit, byte, word, and
double
words.
e. The
bit operations are possible and these can be performed on any bit
in the
register file or in the special function register.
16. List
the features of 8051 microcontroller?
The features
are
*single_
supply +5 volt operation using HMOS technology.
*4096
bytes program memory on chip(not on 8031)
*128 data
memory on chip.
*Four
register banks.
*Two
multiple mode,16-bit timer/counter.
*Extensive
Boolean processing capabilities.
*64 KB
external RAM size
*32
bi-directional individually addressable I/O lines.
*8 bit
CPU optimized for control applications.
17. What
is the function of NEU?
The
numeric execution unit executes all the instructions including arithmetic,
logical
transcendental, and data transfer instructions.
The
numeric execution unit executes all the numeric processor instructions while
the
control unit (CU) receives, decodes instructions, reads and writes memory
operands
and executes the 8087 control instructions.
18. Give
the disadvantages of bus window technique?
The
numeric execution unit executes all the instructions including arithmetic,
logical
transcendental, and data transfer instructions.
The
numeric execution unit executes all the numeric processor instructions while
the
control unit (CU) receives, decodes instructions, reads and writes memory
operands
and executes the 8087 control instructions.
19. What
is swapping out?
A portion
of the program or important partial results required for
further
execution may e saved back on secondary storage to make the physical
memory
free for further execution of another required portion of the program.
This is
called ‘swapping out’ of the executable program.
20.List
the features of 8051 microcontroller?
The
features are
*single_supply
+5 volt operation using HMOS technology.
*4096
bytes program memory on chip(not on 8031)
*128 data
memory on chip.
*Four
register banks.
*Two
multiple mode,16-bit timer/counter.
*Extensive
boolean processing capabilities.
*64 KB
external RAM size
*32
bidirectional individually addressible I/O lines.
*8 bit
CPU optimized for control applications.
21.Explain
the operating mode0 of 8051 serial ports?
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.
22
Explain the operating mode2 of 8051 serial ports?
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/32or1/64 the oscillator frequency.
23.
Explain the mode3 of 8051 serial ports?
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 ,Mode3 is the same as Mode2 in all
respects
except the baud rate. The baud rate in Mode3 is variable.
In all
the four modes, transmission is initiated by any instruction
that uses
SBUF as a destination register. Reception is initiated in Mode0 by
the
condition RI=0&REN=1.Reception is initiated in other modes by the
incoming
start bit if REN=1.
24.Explain
the interrupts of 8051 microcontroller?
The
interrupts are:
Vector
address
External interrupt 0 : IE0 : 0003H
Timer interrupt 0 : TF0 : 000BH
External interrupt 1 : IE1 : 0013H
Timer Interrupt 1 : TF1 : 001BH
Serial Interrupt
Receive
interrupt : RI : 0023H
Transmit
interrupt: TI : 0023H
25.Write
A program to perfom multiplication of 2 nos using 8051?
MOV
A,#data 1
MOV
B,#data 2
MUL AB
MOV
DPTR,#5000
MOV
@DPTR,A(lower value)
INC DPTR
MOV A,B
MOVX @
DPTR,A
26.Write
a program to mask the 0th &7th bit using 8051?
MOV
A,#data
ANL A,#81
MOV
DPTR,#4500
MOVX
@DPTR,A
LOOP SJMP
LOOP
27.List
the addressing modes of 8051?
Direct addressing
Register addressing
Register indirect addressing.
Implicit addressing
Immediate addressing
Index addressing
Bit addressing
28.Write
about CALL statement in 8051?
There are
two subroutine CALL instructions. They are
*LCALL(Long
CALL)
*ACALL(Absolute
CALL)
Each
increments the PC to the 1st byte of the instruction & pushes them
in to the
stack.
29.Write
about the jump statement?
There are
three forms of jump. They are
LJMP(Long
jump)-address 16
AJMP(Absolute
Jump)-address 11
SJMP(Short
Jump)-relative address
30.Write
program to load accumulator ,DPH,&DPL using 8051?
MOV A,#30
MOV DPH,A
MOV DPL,A
31.Write
a program to find the 2’s complement using 8051?
MOV A,R0
CPL A
INC A
32.Write
a program to add 2 8-bit numbers using 8051?
MOV
A,#30H
ADD
A,#50H
33.Write
a program to swap two numbers using 8051?
MOV A,
#data
SWAP A
34.Write
a program to subtract 2 8-bit numbers &exchange the digits using
8051?
MOV A,#9F
MOV
R0,#40
SUBB A,R0
SWAP A
35.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
No comments:
Post a Comment