0% found this document useful (0 votes)
370 views46 pages

8051 Timer Programming and Interrupts

Uploaded by

sai vasu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
370 views46 pages

8051 Timer Programming and Interrupts

Uploaded by

sai vasu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 46

8051 MICROCONTROLLER APPLICATIONS

TIMER PROGRAMMING AND


INTERRUPTS
CONTENTS….
Timer Programming
Timer Registers, TCON, TMOD
Modes of Timer/counter
Contrast and compare interrupt versus polling
Interrupt Handling
Interrupts of the 8051
Purpose of the interrupt vector table
Enable or disable interrupts
Timers using interrupts
Interrupt priority
TIMER PROGRAMMING

The 8051 has two timers: Timer 0 and Timer 1


They can be used either as timers to generate a time delay or as
counter to count events happening outside the microcontroller
Both Timer 0 and Timer 1 are 16 bits wide
They are accessed as two separate registers, low byte and high
byte. (TL0 & TH0 for Timer 0 and TL1 & TH1 for timer 1)
TIMER MODE

Both timers 0 and 1 use the same register, called TMOD (timer
mode), to set the various timer operation modes.

TMOD is an 8-bit register

•The lower 4 bits are for Timer 0


•The upper 4 bits are for Timer 1
•In each case,
•The lower 2 bits are used to set the timer mode
•The upper 2 bits to specify the operation
TIMER PROGRAMMING : Timer 0 & Timer 1

There are three Special Function Registers for timer settings


1. Timer Registers (Timer 0 & Timer 1) – store the starting values
of the Timer 0 & Timer 1. Each timer is 16-bit register which is
split into two bytes (THx & TLx).
TH0 TL0

D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0

Timer 0 Register (16 Bit)


TH1 TL1

D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0

Timer 1 Register (16 Bit)


TIMER CONTROL REGISTER (TCON)
2. Timer Control Register (TCON) –It is an 8-bit register and bit-addressable,
and only the upper 4-bit refers to timer control. It is used to turn ON/OFF
of the timers and timer interrupt control.
(MSB) (LSB)
TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0

Timer ON/OFF control bits Trigger mode of external interrupt control bits

TR1 –Timer 1 run control bit. Set = Timer ON and Clear = Timer OFF
TF1 – Timer flag which is set when the Timer 1 rolls over from FFFFH to 0000H
Cleared the bit in software !.
TR0 – Timer 0 run control bit. Set = Timer ON and Clear = Timer OFF
TF0 – Timer flag which is set when Timer 0 rolls over from FFFFH to 0000H.
Cleared the bit in software !
IE1 and IT1 – Set the trigger mode of external interrupt 1
IE0 and IT0 – Set the trigger mode of external interrupt 0
TIMER MODE REGISTER (TMOD)

3. Timer Mode Register (TMOD) – It is used to set the various timer


operation modes. It is an 8-bit register and is bit-addressable.
(MSB) (LSB)
GATE C/T M1 M0 GATE C/T M1 M0

Timer 1 Timer 0
GATE – Gating control when set the timer/counter is enabled only while the INTx
pin is high and the TRx control pin is set. When cleared, the timer is enabled
whenever the TRx control bit is set.
C/T – Timer or counter selected. Cleared for timer operation (input from internal
system clock) and Set for counter operation (input from Tx input pin)
M1 & M0 – Mode bits
TMOD REGISTER
M1 & M0 – Mode bits
M1 M0 Mode Operating Mode

0 0 0 13-bit timer/counter mode. 8-bit timer/counter THx with TLx as 5-


bit prescaler.Timer value range from 0000H to 1FFFH in TH - TL
0 1 1 16-bit timer/counter mode, THx and TLx are cascaded.
Timer value range from 0000H to FFFFH in TH - TL
1 0 2 8-bit auto reload timer/counter mode .THx holds a value that is
to be reloaded into TLx each time it overflows.
1 1 3 Split timer mode

Gating control when set Timer/counter is enabled only while the INTx pin is high and the TRx
control pin is set. When cleared, the timer is enabled whenever the TRx control bit is set

Timer or counter selected Cleared for timer operation (input from internal system clock)
Set for counter operation (input from Tx input pin)

Modes 1 & 2 are widely used.


SOFTWARE or HARDWARE CONTROL OF TIMERS

Operation of 8051 Timers are controlled by Software or Hardware

Software control:
• GATE=0 in the TMOD register
• The start and stop of the timer are controlled by the TR (timer
start) bits TR0 and TR1
• SETB instruction starts it
• CLR instruction stops it as long as GATE=0 in the TMOD register

• Hardware control:
• GATE=1 in the TMOD register
Example

# Find the timer’s clock frequency and its period for various 8051-based
system, with the crystal frequency 11.0592 MHz when C/T bit of TMOD is 0.

Solution:
1/12 × 11.0529 MHz = 921.6 MHz;
T = 1/921.6 kHz = 1.085 us

# Indicate which mode and which timer are selected for each of the following.
(a) MOV TMOD, #01H (b) MOV TMOD, #20H (c) MOV TMOD, #12H

Solution:
We convert the value from hex to binary.
(a) TMOD = 00000001, mode 1 of timer 0 is selected.
(b) TMOD = 00100000, mode 2 of timer 1 is selected.
(c) TMOD = 00010010, mode 2 of timer 0, and mode 1 of timer 1 are selected.
TIMER/COUNTER MODE 0 :13 BIT COUNTER USING TIMER 1
TIMER OPERATION IN MODE1
The following are the characteristics and operations of mode1:
1. It is a 16-bit timer; therefore, it allows value of 0000 to FFFFH
to be loaded into the timer’s register TL and TH.
2. After TH and TL are loaded with a 16-bit initial value, the timer
must be started by SETB TR0 for timer 0 and SETB TR1 for
timer 1.
3. After the timer is started, it starts to count up until it reaches its
limit of FFFFH.
4. When it rolls over from FFFFH to 0000, it sets high a flag bit
called TF (timer flag) : TF0 for timer 0, and TF1 for timer 1
5. When this timer flag is raised, one option would be to stop the
timer with the instructions CLR TR0 or CLR TR1, for timer 0
and timer 1, respectively.
6. To repeat the process TH and TL must be reloaded with the
original value, and TF must be reloaded to 0
TIMER / COUNTER MODE 1 :
16 BIT COUNTER USING TIMER 1

TL1
(8 Bits)

Timer value range from 0000H to FFFFH in TL1 – TH1


TIMER OPERATION IN MODE 2
The following are the characteristics and operations of mode 2:
1. It is an 8-bit timer; therefore, it allows only values of 00 to FFH
to be loaded into the timer’s register TH.
2. After TH is loaded with the 8-bit value, the 8051 gives a copy of
it to TL, then the timer must be started by the instruction SETB
TR0 for timer 0 and SETB TR1 for timer 1.
4. After the timer is started, it starts to count up by incrementing the
TL register until it reaches its limit of FFH.
5. When it rolls over from FFH to 00, it sets high the TF (timer flag)
6. When the TL register rolls from FFH to 0 and TF is set to 1, TL is
reloaded automatically with the original value kept by the TH
register.
7. To repeat the process, TF is simply cleared and let it go without
any need by the programmer to reload the original value.
8. This makes mode 2 an auto-reload, in contrast with mode 1 in
which the programmer has to reload TH and TL
TIMER / COUNTER MODE 2 :
8 BIT AUTO RELOAD
TO GENERATE TIME DELAY

1. Load the TMOD value register indicating timer to be used


(timer 0 or timer 1) and select timer mode to be (0 or 1).
2. Load registers TL and TH with initial count value.
3. Start the timer.
4. Keep monitoring the timer flag (TF) with the JNB TFx, target
instruction to see if it is raised. Get out of the loop when TF
becomes high.
5. Stop the timer.
6. Clear the TF flag for the next round.
7. Go back to Step 2 to load TH and TL again.
Timers Programming
Example 1

Indicate which mode and which timer are selected for each of the following.
(a) MOV TMOD, #01H
(b) MOV TMOD, #20H
(c) MOV TMOD, #12H

Solution:

Convert the values from hex to binary:

(a) TMOD = 0000 0001, mode 1 of Timer 0 is selected


(b) TMOD = 0010 0000, mode 2 of Timer 1 is selected
(c) TMOD = 0001 0010, mode 2 of Timer 0, and mode 1 of Timer 1are
selected
Timers Programming
Example 2
1. Write instructions to do the followings:
a. Set Timer 0 in mode 1, use 8051 XTAL for the clock source,
instructions to start and stop the timer,
b. Set value F0ABH to Timer 0.
c. Start Timer 0
2. Determine the time for Timer 0 rolling over if XTAL = 12 MHz.

Solution:
(1)
MOV TMOD, #01H ; Timer 0 and mode 1 set, C/T = 0 to use XTAL
; clock source, Gate = 0 to use software ON/OFF
MOV TL0, #0ABH ; TL0 =ABH
MOV TH0, #0F0H ; TH0 =F0H
SETB TR0 ; Start Timer 0
Timers Programming
THx TLx # of count to set TFx
FFH FFH 1
Solution: FFH FEH 2
(2)
Assume 12 MHz clock :
1
Time for 1 Timer clock = 1 machine cycle = 6
x12 s = 1s
12x10

Counts for Timer rolling over = Counts from F0ABH to FFFFH


plus rolling over to 0

Timer clock cycles = (FFFFH – F0ABH + 1) = 0F55H


65536 – F0ABH = 3925 in decimal
10

 Time for Timer 0 rolls over = 3925 x 1 s = 3925 s #


Timers Programming

Example 3
In the following program, we create a square wave of 50% duty cycle (with equal portions
high and low) on the P1.5 bit. Timer 0 is used to generate the time delay. Analyze the program

MOV TMOD,#01 ;Timer 0, mode 1(16-bit mode)


HERE: MOV TL0,#0F2H ;TL0=F2H, the low byte
MOV TH0,#0FFH ;TH0=FFH, the high byte
CPL P1.5 ;toggle P1.5
ACALL DELAY
SJMP HERE

In the above program notice the following step.


1. TMOD is loaded.
2. FFF2H is loaded into TH0-TL0.
3. P1.5 is toggled for the high and low portions of the pulse.
Timer Programming
DELAY:
SETB TR0 ;start the timer 0
AGAIN: JNB TF0, AGAIN ;monitor timer flag 0
;until it rolls over
CLR TR0 ;stop timer 0
CLR TF0 ;clear timer 0 flag
RET
4. The DELAY subroutine using the timer is called.
5. In the DELAY subroutine, timer 0 is started by the SETB TR0 instruction.
6. Timer 0 counts up with the passing of each clock, which is provided by the crystal oscillator. As
the timer counts up, it goes through the states of FFF3, FFF4, FFF5, FFF6, FFF7, FFF8, FFF9,
FFFA, FFFB, and so on until it reaches FFFFH. One more clock rolls it to 0, raising the timer
flag (TF0=1). At that point, the JNB instruction falls through.
7. Timer 0 is stopped by the instruction CLR TR0. The DELAY subroutine ends, and the process is
repeated. Notice that to repeat the process, we must reload the TL and TH registers, and start the
process is repeated
Timers Programming
Ie. Toggle P1.3 every 10ms
Example 3
Assume XTAL = 12 MHz, write a program to generate a square wave of 50 Hz
frequency on pin P1.3 by using timer 1 as time control.
Solution:
The period of the square wave, T = 1/50 Hz = 20 ms 65535 – 10000 + 1
½ of it for the high and low portions of the pulse = 10 ms
10 ms/ 1s = 10,000 timer cycles are needed for each pulse.
20ms
Timer 1 value to be set = 65536 – 10000 = 55536 in decimal = D8F0H
i.e. TH1 = D8H and TL1 = F0H ( need 16 bit Counter, so take mode 1)

MOV TMOD, #10H ; Timer 1, mode 1


AGAIN: MOV TL1, #0F0H ; TL1 =F0H
MOV TH1, #0D8H ; TH1 =D8H
SETB TR1 ; Start Timer 1
BACK: JNB TF1, BACK ; Stay until timer rolls over
CLR TR1 ; Stop Timer 1
CPL P1.3 ; Complement P1.3 to set Hi, Low
CLR TF1 ; Clear Timer flag by software
SJMP AGAIN
TIMERS PROGRAMMING
Example 4
Examine the following subroutine and find the time delay for it. (12 MHz clock)
; Time Delay subroutine Machine cycles
MOV TMOD, #10H ; Timer 1, mode 1 2
MOV R3, #200 1
AGAIN: MOV TL1, #08H ; TL1 =08H 2
MOV TH1, #01H ; TH1 =01H 2
SETB TR1 ; Start Timer 1 1
BACK: JNB TF1, BACK ; Stay until timer rolls over 2
CLR TR1 ; Stop Timer 1 1
CLR TF1 ; Clear Timer flag 1
DJNZ R3, AGAIN ; Loop until R3 = 0 2
RET 2

Solution :
Timer value = 0108H = 264 in decimal, counts to rolls over = 65536 – 264 = 65272 in decimal
Timer cycle of Timer = 65272
Total machine cycles of the subroutine = [2 + 1 + (5 + 65272 + 4) x 200 + 2] = 13056205
Total delay time 13056205 x 1s = 13056.2 ms
INTERRUPT & POLLING
A single microcontroller always connects to
serve several peripheral devices through its
I/O ports
There are two ways for the peripheral devices
to request service from microcontroller
POLLING
INTERRUPT
PROGRAMMED I/O (POLLING)

Microcontroller continuously monitors the status of a


certain number of devices in sequence
Services a device if preset condition is met
After the service, the microcontroller will move on to
monitor the status of another device until all devices are
serviced
This operation is called “polling”
INTERRUPT I/O (INTERRUPT)

Whenever any device needs the service, it notifies


the microcontroller by sending it an interrupt
request (IR) signal while the microcontroller is
doing other work.
The microcontroller suspends its work to service
the device at once.
Each IR is associated with an interrupt service
routine (ISR)
COMPARISON BETWEEN INTERRUPT & POLLING

INTERRUPT POLLING
Method Devices notify MCU MCU continuously
by sending it an monitors devices to
interrupt signal determine whether
while the MCU is they need service
doing another work
Response time Faster Slower
Need of MCU time Less More
Priority setting Yes No
STEPS IN HANDLING AN INTERRUPT REQUEST
When an interrupt is activated and is accepted by the MCU, the
main program is interrupted. The following actions occur:

◆ The current instruction is executed


◆ PC is saved on the stack
◆ Current interrupt status is saved internally
◆ PC is loaded with the vector address of the ISR from the
interrupt vector table (Jump to execute ISR)
◆ ISR is executed and is ended with a RETI instruction (return
from interrupt)
◆ It returns to main program by popping the PC from the stack
PROGRAM EXECUTION WITH INTERRUPTS
ISR ISR

Main Main Main

PC saved PC popped
on stack from stack
stack

The program that deals with an interrupt is called an interrupt


service routine (ISR)
ISR is executed in response to the interrupt and generally performs
I/O operation to a device
TYPES OF INTERRUPTS IN 8051
There are 6 interrupts in 8051
Reset – when the reset pin is activated, the 8051 will reset all
registers and ports and jumps to address location 0000H starting up
execution.
2 External Interrupts – Hardware external interrupts (INT0 and
INT1) at pins 12 & 13 are used to receive interrupt signals from
external devices.
2 Timer Interrupts – They are Timer 0 and Timer 1 which will
give out interrupt signal when the timers count to zero.
1 Serial Port Interrupt - It is used for data reception and
transmission during serial communication.
Apart from the Reset, only the 5 interrupts are available to the user
INTERRUPT VECTOR TABLE FOR THE 8051

➢ Interrupt Vector Table holds the addresses of ISR

Priority Interrupt Flag ROM location Pin

1 Reset RST 0000H 9


External 0
2 IE0 0003H P3.2 (12)
(INT0)
3 Timer 0 TF0 000BH ---
External 1
4 IE1 0013H P3.3 (13)
(INT1)
5 Timer 1 TF1 001BH ---

6 Serial port RI or TI 0023H ---


ENABLING AND DISABLING AN INTERRUPT
Upon reset, all interrupts are disabled
The interrupts must be enabled by software
A register called IE (interrupt enable) register, which is bit-
addressable, is responsible for enabling and disabling the
interrupts
Bit IE. 7 must be set high to allow the rest of register to take
effect
➢ EA = 1 ; Global enable interrupt
➢ EA = 0 ; Global disable interrupt

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


EA -- ET2 ES ET1 EX1 ET0 EX0
IE (interrupt enable) register
ENABLING AND DISABLING AN INTERRUPT

Bit Symbol Description (1=Enable, 0=Disable)


IE.7 EA Global Enable/disable
IE.6 -- Not implemented, reserved for future use
IE.5 ET2 Not use for 8051 (8052 only)
IE.4 ES Enable/disable serial port interrupt
IE.3 ET1 Enable/disable timer 1 interrupt
IE.2 EX1 Enable/disable external interrupt 1
IE.1 ET0 Enable/disable timer 0 interrupt
IE.0 EX0 Enable/disable external interrupt 0
Example 5
Write instructions to
(a) Enable serial interrupt, Timer 0 interrupt and external interrupt 1, and
(b) Disable Timer 0 interrupt only, and
(c) Disable all the interrupt with a single instruction

Solution:
(a) MOV IE, #10010110B ; enable serial, Timer 0, EX1 interrupts
or
SETB IE.7 ; EA=1, Global enable
SETB IE.4 ; enable serial interrupt
SETB IE.1 ; enable Timer 0 interrupt
SETB IE.2 ; enable EX1 interrupt
(b) CLR IE.1 ; disable Timer 0 interrupt
(c) CLR IE.7 ; disable all interrupts
TIMER INTERRUPT
When timer rolls over, its timer flag (TF) is set.
If the timer interrupt in the IE register is enabled, whenever the TF is
set, the microcontroller is interrupted and jumps to the interrupt
vector table to service the ISR.
With timer interrupt enabled, microcontroller can do other things and
no need to monitor the TF for rolling over.

TF0 Timer 0 Interrupt Vector


1 Jumps to 000BH

TF1 Timer 1 Interrupt Vector


1 Jumps to 001BH
Timer 1 value to be set = 65536 – 10000 = 55536 in decimal = D8F0H
Example 6
Write a program to generate a square wave of 50 Hz on pin P1.3. This is similar
to Example 8.3 except that it uses an interrupt for Timer 1.
Write a program to generate a square
Solution:
wave of 50 HzORGon pin P1.3. This is similar
0000H
to Example 8.3 except that
LJMP it uses an
MAIN ;by-pass interrupt vector table
interrupt
; ISR for Timer 1.
Timer 1 to generate square wave
ORG 001BH
LJMP ISR_T1 ; jump to ISR_T1
; Main Program for initialization
ORG 30H
MAIN: MOV TMOD, #10H ; Timer 1, mode 1
MOV TL1, #0F0H ; TL1 =F0H
MOV TH1, #0D8H ; TH1 =D8H
MOV IE, #88H ; enable Timer 1 interrupt
SETB TR1 ; Start Timer 1
HERE: SJMP HERE
; Timer 1 ISR
ISR_T1: CPL P1.3 ; Complement P1.3 to set Hi, Low
MOV TL1, #0F0H ; reload timer value Example 8.3 (use TIMER)
MOV TH1, #0D8H ;
SETB TR1 ; Start Timer 1
RETI
END
INTERRUPT PRIORITY
INT0 > TF0 > INT1 > TF1 > SERIAL(RI+TI)

Upon reset, the priorities of interrupt source are assigned from


top to bottom as in the following Table 8 , i.e. if INT0 and
INT1 are activated at the same time, INT0 is first responded.
Table 8.1: 8051 Interrupt Priority Upon Reset
External Interrupt 0 (INT0) Highest
Priority
Timer Interrupt 0 (TF0)
External Interrupt 1 (INT1)
Timer Interrupt 1 (TF1)
Lowest
Serial Communication (RI+TI) Priority
Setting Interrupt Priority with the IP register
The sequence of Table 8 can be changed by assigning a
higher priority to any one of the interrupts.
It is done by setting high at the corresponding bit in the IP
(interrupt priority) register.

Priority bit = 1 (assign high priority) Priority bit = 0 (assign low priority)

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


-- -- PT2 PS PT1 PX1 PT0 PX0
IE (interrupt priority) register (Bit-addressable)

PT2,– Timer 2 (8052 only), PT1 & PT0 -- Timer 1 & Timer 0 interrupts
PX1 & PX0– External interrupts 1 & 0, PS – Serial port interrupt
Setting Interrupt Priority with the IP register

Example 8.7 :
(a) Program the IP register to assign the highest priority to INT1,
(b) Discuss what happens if INT0, INT1 and TF0 are activated at the
same time.

Solution :
(a) MOV IP, #00000100B ; set IP.2=1 INT1 has the highest priority
or SETB IP.2
(b) Priority of interrupt will be changed to INT1 > INT0 > TF0
The 8051 will services INT1 first and then INT0 and TF0.
(As the INT0 and TF0 bits in IP register are 0, their priorities follow the
sequence in Table 8.1)
Setting Interrupt Priority with the IP register
Example 8.8 :
The IP register is set by the instruction “MOV IP, #00001100B”
after reset. Discuss the sequence in which the interrupts are serviced.

Solution :
MOV IP, #00001100B instruction sets INT1 & TF1 to a higher
priority level compared with the rest of the interrupts.

Priority of interrupt will then be


INT1 > TF1 > INT0 > TF0 > Serial

POWER UP DEFAULT PRIORITY: INT0 > TF0 > INT1 > TF1 > SERIAL(RI+TI)
Interrupt inside an interrupt
Higher-priority interrupt can interrupt a low-priority interrupt.
An interrupt cannot be interrupted by a low-priority interrupt
No low priority interrupt can get the immediate attention of the
CPU until the 8051 has finished servicing the high-priority
interrupts

Low ISR is higher ISR lower ISR Lower ISR cannot


interrupted by a interrupt a higher
higher priority ISR priority ISR
ISR ISR ISR

Main Main Main


Example 8.9
Assume that the INT1 pin is connected to a switch that
is normally high. Whenever it goes low, it should turn on
an LED. The LED is connected to P1.3 and is normally off.
When it is turned on it should stay on for a fraction of a
second. As long as the switch is pressed, the LED should
stay on.
5v 8051
P1.3 to LED
INT1 1=ON
0=OFF
0v
Example 8.9 - Solution
ORG 0000H
LJMP MAIN ;by-pass interrupt vector table
; ISR for INT1
ORG 0013H
LJMP ISR_INT1 ; jump to ISR_INT1
; Main Program
ORG 30H
MAIN: MOV IE,#10000100B ;enable external INT 1 + GLOBAL
HERE: SJMP HERE ;stay here until get interrupted
; INT1 ISR
ISR_INT1: SETB P1.3 ;turn on LED
MOV R3,#255
BACK: DJNZ R3, BACK ;keep LED on for a while
CLR P1.3 ;turn off LED
RETI
END
Review Questions
1. How many timers do we have in the 8051_____ ?(8052 _____?)
2. The timers of the 8051 are ___-bit and are designated as ____
and _______.
3. The registers of Timer 0 are accessed as ______ and ______.
4. The registers of Timer 1 are accessed as ______ and ______.
5. The TMOD register is ____-bit register.
6. Find the TMOD value for both Timer 0 and Timer 1, mode 2,
software start/stop (gate=0), with driving by internal clock.
7. Find the frequency and period used by the timer if the crystal
attached to the 8051 has the following values.
(a) XTAL = 11.0592 MHz (b) XTAL = 12 MHz
(c) XTAL = 16 MHz (d) XTAL = 20 MHz
(e) XTAL = 24 MHz (f) XTAL = 30 MHz
Review Questions
8. Find the value (in hex) loaded into TH in each of the following.
(a) MOV TH1, #-120 (b) MOV TH1, #-67
(c) MOV TH1, #-222 (d) MOV TH0, #-104
9. What address in the interrupt vector table is assigned to Time
0?
10. To put the entire interrupt service routine in the interrupt
vector table, it must be no more than _____ bytes in size.
11. Why do we put an LJMP instruction at address 0?
12. What register keeps track of interrupt priority in the 8051? Is it
a bit-addressable register?
13. If the value of IP register is 09H, arrange the priority of the 5
interrupts (exclude Reset) of 8051 in descending order.
14. Assume that the IP register contains all 0s. Explain what
happens if both INT0 and INT1 are activated at the same time.

You might also like