SlideShare a Scribd company logo
1 
The 8051 Microcontroller and 
Embedded Systems 
CHAPTER 15 
RTC Interfacing and 
Programming
Introduction of Real Time Clock 
 The real-time clock (RTC) is a widely used 
device that provides accurate time and date 
for many applications 
 Many systems such as the x86 IBM PC come 
with such a chip on the motherboard 
 The RTC chip in the IBM PC provides time 
components of hour, minute, and second, in 
addition to the date/calendar components of 
year, month, and day 
2
Introduction of Real Time Clock 
 The RTC chip uses an internal battery, which 
keeps the time and date even when the 
power is off 
 One of the most widely used RTC chips is 
the DS 12887 from Dallas Semiconductor 
/Maxim Corp 
 It uses an internal lithium battery to keep 
operating for over 10 years in the absence of 
external power 
3
Introduction of Real Time Clock 
 According to the DS 12887 data sheet from 
Maxim, it keeps track of “seconds, minutes, 
hours, days, day of week, date, month, and 
year with leap-year compensation valid up to 
year 2100″ 
 The above information is provided in both 
binary (hex) and BCD formats. The DS 
12887 supports both 12-hour and 24-hour 
clock modes with AM and PM in the 12-hour 
4 mode
 It also supports the Daylight Savings Time 
option 
 The DS 12887 uses CMOS technology to 
keep the power consumption low and it has 
the designation DS12C887, where C is for 
CMOS 
 The DS12887 has a total of 128 bytes of 
nonvolatile RAM 
5 
Introduction of Real Time Clock
 It uses 14 bytes of RAM for clock/calendar 
and control registers, and the other 114 
bytes of RAM are for general-purpose data 
storage 
 In the x86 IBM PC, these 114 bytes of NV-RAM 
are used for the CMOS configuration, 
where the system setups are kept before the 
operating system takes over 
6 
Introduction of Real Time Clock
Pin Diagram of DS12887 RTC 
7
Address map of the DS12887 
8
 The DS12887 has a total of 128 bytes of 
RAM space with addresses 00 -7FH 
 The first ten locations, 00 – 09, are set aside 
for RTC values of time, calendar, and alarm 
data 
 The next four bytes are used for the control 
and status registers 
9 
Address map of the DS12887
 They are registers A, B, C, and D and are 
located at addresses 10-13 (OA – OD in hex) 
 The next 114 bytes from addresses OEH to 
7FH are available for data storage 
 The entire 128 bytes of RAM are accessible 
directly for read or write except the following: 
– Registers C and D are read-only 
– D7 bit of register A is read-only 
– The high-order bit of the seconds byte is read-only 
10 
Address map of the DS12887
DS12887 Address Location for 
Time, Calendar, and Alarm 
11
Interfacing of DS12887 with 8051 
12
Turning on the oscillator for the 
first time 
 The DS12887 is equipped with the internal 
oscillator which is turned off in order to save 
the lithium battery. 
 We need to turn on the oscillator before we 
use the time keeping features of the DS 
12887 
 To do that, bits D6 – D4 of register A must be 
set to value 010 
13
Register A Bits for Turning on the 
DS12887′s Oscillator 
14
Code for turning ON DS12887 
 ACALL DELAY_200MS ;Giving settling time 
 MOV R0,#0AH ; Reg A address of DS12887 
 MOV A,#20H ; 010 DATA FOR D6-D4 
 MOVX @R0,A 
15
Bits of Register B 
16
Register C 
17 
– IRQF =1: if PF = PIE= 1 orAF=AIE= 1 orUF = 
UIE= 1 
– PF Periodic interrupt flag. Periodic interrupts can 
be generated at a rate of once every 500 ms to 
once every 122 us. The rate is set by bits RS3 – 
RSO of register A
Register C 
 AF Alarm interrupt flag. The AF becomes 1 
when the current real time matches the alarm 
time. AF and AIE of register B together (if 
both are 1) will allow the IRQ to be 
asserted low when all the three bytes of the 
real time (yy:mm:dd) are the same as the 
bytes in the alarm time 
 The AF also becomes 1 for cases of once 
per second, once per minute, and once per 
18 hour alarm
ALARM AND SQW FEATURES OF 
THE DS12887 CHIP 
19 
The SQW pin 
provides us a 
square wave 
output of various 
frequencies 
The frequency is 
chosen by bits 
RSO – RS3 of 
register A
 Also enable SQWE bit in Register B 
20 
ALARM AND SQW FEATURES OF 
THE DS12887 CHIP
ALARM FEATURE OF DS12887 
CHIP 
 The alarm interrupt can be programmed to 
occur at rates of 
– (a) once per day 
– (b) once per hour 
– (c) once per minute 
– (d) once per second 
21
Once-per-day alarm 
 To program the alarm for once per day, we 
write the desired time for the alarm into the 
hour, minute, and second RAM locations 1, 
3, and 5 
 As the clock keeps the time, when all three 
bytes of hour, minute, and second for the 
real time clock match the values in the alarm 
hour, minute, and second, the AF (alarm 
flag) bit in register C of the DS 12887 will go 
22 high
Once-per-hour, minute and second 
alarms 
 To program the alarm for once per hour, we 
write value FFH into the alarm hour location 
of 5 only 
 To program the alarm for once per minute, 
we write value FFH into both the alarm hour 
and alarm minute locations of 5 and 3 
 To program the alarm for once per second, 
we write value FFH into all three locations of 
alarm hour, alarm minute, and alarm second 
23
 We can poll the AF bit in register C, which is 
a waste of microcontroller resources, or allow 
the IRQ pin to be activated upon matching 
the alarm time with the real time 
 It must be noted that in order to use the IRQ 
pin of the DS 12887 for an alarm, the 
interrupt-enable bit for alarm in register B 
(AIE) must be set high 
24 
IRQ FEATURE OF THE DS12887 
CHIP
IRQ FEATURE OF THE DS12887 
CHIP 
25
 Interrupt request (IRQ) is an output pin for 
the DS12887 RTC chip 
 There are three possible sources that can 
activate the IRQ pin 
– (a) alarm interrupt 
– (b) periodic pulse interrupt 
– (c) update interrupt 
 We can choose which source to activate the 
IRQ pin using the interrupt-enable bit in 
register B of the DS 12887 
26 
IRQ FEATURE OF THE DS12887 
CHIP
PERIODIC INTERRUPT 
 The second source of interrupt is the periodic 
interrupt flag (PF) 
 The periodic interrupt flag is part of register C 
 It will go high at a rate set by the RS3 -RSO 
bits of register A 
 This rate can be from once every 500 ms to 
once every 122 us as shown 
 The PF becomes 1 when an edge is detected 
27 for the period
 Just like alarm interrupt, the periodic interrupt 
can also be directed to the IRQ pin 
 To use IRQ, the interrupt-enable bits of PIE 
in register B must be set to 1 
 In other words, we can poll the PF bit of 
register C, which is a waste of the 
microcontroller’s resources, or it can be 
directed to the hardware IRQ pin 
 If we set PIE = 1, the IRQ pin is asserted low 
when PF goes high 
28 
PERIODIC INTERRUPT
 While the alarm interrupt gave us the options 
from once per day to once per second, the 
periodic interrupt gives us the option of 
subsecond interrupts 
 For example, we can write a program to send 
a message to the screen twice per second (2 
Hz) 
29 
PERIODIC INTERRUPT
Internal 
Architecture 
of DS12887 
30

More Related Content

What's hot (20)

PDF
Unit III ARM Interface and ARM Programming
Dr. Pankaj Zope
 
PPTX
INTERRUPTS OF 8086 MICROPROCESSOR
Gurudev joshi
 
PDF
vlsi design flow
Anish Gupta
 
PDF
Structural modelling
Revathi Subramaniam
 
PDF
Unit II arm 7 Instruction Set
Dr. Pankaj Zope
 
PPT
06. thumb instructions
balaji raja rajan Venkatachalam
 
PPT
Verilog hdl
Muhammad Uzair Rasheed
 
PDF
System On Chip
anishgoel
 
PPTX
program status word
sheetalverma38
 
PPTX
Vlsi design flow
Rajendra Kumar
 
PPSX
8051 microcontroller and embedded system
sb108ec
 
PPT
8051 block diagram
DominicHendry
 
PPT
Memory & I/O interfacing
deval patel
 
PPTX
Analog to Digital converter in ARM
Aarav Soni
 
PPTX
PROGRAMMABLE KEYBOARD AND DISPLAY INTERFACE(8279).pptx
SanjayV73
 
PDF
18CS44-MES-Module3-ppt.pdf
Mohd Saifudeen
 
PDF
VHDL- gate level modelling
VandanaPagar1
 
PPTX
Introduction to Embedded Systems
Sandeep Reddy
 
PPT
Interfacing LCD with 8051 Microcontroller
Pantech ProLabs India Pvt Ltd
 
PDF
DSP Processor
Laxmikant Kalkonde
 
Unit III ARM Interface and ARM Programming
Dr. Pankaj Zope
 
INTERRUPTS OF 8086 MICROPROCESSOR
Gurudev joshi
 
vlsi design flow
Anish Gupta
 
Structural modelling
Revathi Subramaniam
 
Unit II arm 7 Instruction Set
Dr. Pankaj Zope
 
06. thumb instructions
balaji raja rajan Venkatachalam
 
System On Chip
anishgoel
 
program status word
sheetalverma38
 
Vlsi design flow
Rajendra Kumar
 
8051 microcontroller and embedded system
sb108ec
 
8051 block diagram
DominicHendry
 
Memory & I/O interfacing
deval patel
 
Analog to Digital converter in ARM
Aarav Soni
 
PROGRAMMABLE KEYBOARD AND DISPLAY INTERFACE(8279).pptx
SanjayV73
 
18CS44-MES-Module3-ppt.pdf
Mohd Saifudeen
 
VHDL- gate level modelling
VandanaPagar1
 
Introduction to Embedded Systems
Sandeep Reddy
 
Interfacing LCD with 8051 Microcontroller
Pantech ProLabs India Pvt Ltd
 
DSP Processor
Laxmikant Kalkonde
 

Viewers also liked (20)

PPTX
Audio devices and applications
Devashish Raval
 
PPTX
Motor Control Relay, Pwm, DC and Stepper Motors
Devashish Raval
 
PPTX
Introduction to Video Signals
Devashish Raval
 
PPTX
Television Receiver
Devashish Raval
 
PDF
Question paper with solution the 8051 microcontroller based embedded systems...
manishpatel_79
 
PPTX
RTOS based Confidential Area Security System
ajinky gadewar
 
PDF
8051 microcontrollers
Chih-Hsiang Tang
 
PPTX
Sound amplification
Devashish Raval
 
PPTX
Television Signal Transmission & Propagation
Devashish Raval
 
PPT
Television Basics
Nishith Kumar
 
PPTX
Digital audio
Devashish Raval
 
PPTX
Project report on embedded system using 8051 microcontroller
Vandna Sambyal
 
DOC
8051 Microcontroller Notes
Dr.YNM
 
PPT
Sound fundamentals
Devashish Raval
 
PPT
PIC32MX Microcontroller Family
Premier Farnell
 
PPT
1 introducing embedded systems and the microcontrollers
Bidhu Deka
 
DOC
Timer based automatic power cutoff for industrial sealing or packaging machines
Ecwayt
 
PPTX
Intro to micro controller (Atmega16)
Ramadan Ramadan
 
PPTX
Loudness and pitch
bethfernandezaud
 
PDF
Axis Camera Companion
bethhaldane
 
Audio devices and applications
Devashish Raval
 
Motor Control Relay, Pwm, DC and Stepper Motors
Devashish Raval
 
Introduction to Video Signals
Devashish Raval
 
Television Receiver
Devashish Raval
 
Question paper with solution the 8051 microcontroller based embedded systems...
manishpatel_79
 
RTOS based Confidential Area Security System
ajinky gadewar
 
8051 microcontrollers
Chih-Hsiang Tang
 
Sound amplification
Devashish Raval
 
Television Signal Transmission & Propagation
Devashish Raval
 
Television Basics
Nishith Kumar
 
Digital audio
Devashish Raval
 
Project report on embedded system using 8051 microcontroller
Vandna Sambyal
 
8051 Microcontroller Notes
Dr.YNM
 
Sound fundamentals
Devashish Raval
 
PIC32MX Microcontroller Family
Premier Farnell
 
1 introducing embedded systems and the microcontrollers
Bidhu Deka
 
Timer based automatic power cutoff for industrial sealing or packaging machines
Ecwayt
 
Intro to micro controller (Atmega16)
Ramadan Ramadan
 
Loudness and pitch
bethfernandezaud
 
Axis Camera Companion
bethhaldane
 
Ad

Similar to RTC Interfacing and Programming (20)

PPTX
rtcinterfacingandprogramming-141016105525-conversion-gate01.pptx
SnehalPawar406569
 
PDF
Datasheet RTC DS1307 untuk waktu yang tepat pada mikrokontroler
Muhammad Kennedy Ginting
 
PDF
Datasheet PIC16f887
whendygarcia
 
PPT
AVR Fundamentals
Vinit Vyas
 
PDF
16 f887
lala
 
PDF
PIC16F1934.PDF
BrayanJulian8
 
PDF
Dalls02950 1
S BW
 
PDF
Interfacing Of PIC 18F252 Microcontroller with Real Time Clock via I2C Protocol
IJERA Editor
 
PDF
Pic16F887
wolf3245
 
PDF
Pic16 f676
veenaarams
 
PDF
At89c2051 Data sheet
Microtech Solutions
 
PPTX
8051
Wave Digitech
 
PDF
6datasheets
Muhammad Iman Santoso
 
PDF
Datasheet
Dario Castro
 
PDF
Pic 16f877a
KRNFORD
 
PDF
89c5131datasheet
SaravananVijayakumar4
 
PDF
EE6008 MCBSD - Introduction to PIC Micro controller
pavihari
 
PDF
EE6008 MBSD
rmkceteee
 
PDF
At89c4051
Microtech Solutions
 
rtcinterfacingandprogramming-141016105525-conversion-gate01.pptx
SnehalPawar406569
 
Datasheet RTC DS1307 untuk waktu yang tepat pada mikrokontroler
Muhammad Kennedy Ginting
 
Datasheet PIC16f887
whendygarcia
 
AVR Fundamentals
Vinit Vyas
 
16 f887
lala
 
PIC16F1934.PDF
BrayanJulian8
 
Dalls02950 1
S BW
 
Interfacing Of PIC 18F252 Microcontroller with Real Time Clock via I2C Protocol
IJERA Editor
 
Pic16F887
wolf3245
 
Pic16 f676
veenaarams
 
At89c2051 Data sheet
Microtech Solutions
 
Datasheet
Dario Castro
 
Pic 16f877a
KRNFORD
 
89c5131datasheet
SaravananVijayakumar4
 
EE6008 MCBSD - Introduction to PIC Micro controller
pavihari
 
EE6008 MBSD
rmkceteee
 
Ad

Recently uploaded (20)

PPT
SF 9_Unit 1.ppt software engineering ppt
AmarrKannthh
 
PDF
May 2025: Top 10 Read Articles in Data Mining & Knowledge Management Process
IJDKP
 
PDF
Rapid Prototyping for XR: Lecture 6 - AI for Prototyping and Research Directi...
Mark Billinghurst
 
PPTX
CST413 KTU S7 CSE Machine Learning Introduction Parameter Estimation MLE MAP ...
resming1
 
PPTX
Introduction to Python Programming Language
merlinjohnsy
 
PPTX
Introduction to File Transfer Protocol with commands in FTP
BeulahS2
 
PPTX
LECTURE 7 COMPUTATIONS OF LEVELING DATA APRIL 2025.pptx
rr22001247
 
PPTX
Computer network Computer network Computer network Computer network
Shrikant317689
 
PDF
01-introduction to the ProcessDesign.pdf
StiveBrack
 
PDF
Plant Control_EST_85520-01_en_AllChanges_20220127.pdf
DarshanaChathuranga4
 
PDF
Rapid Prototyping for XR: Lecture 5 - Cross Platform Development
Mark Billinghurst
 
PPT
FINAL plumbing code for board exam passer
MattKristopherDiaz
 
PDF
Rapid Prototyping for XR: Lecture 3 - Video and Paper Prototyping
Mark Billinghurst
 
PDF
13th International Conference of Security, Privacy and Trust Management (SPTM...
ijcisjournal
 
PDF
June 2025 Top 10 Sites -Electrical and Electronics Engineering: An Internatio...
elelijjournal653
 
PPTX
MATERIAL SCIENCE LECTURE NOTES FOR DIPLOMA STUDENTS
SAMEER VISHWAKARMA
 
PDF
Rapid Prototyping for XR: Lecture 2 - Low Fidelity Prototyping.
Mark Billinghurst
 
PPTX
FSE_LLM4SE1_A Tool for In-depth Analysis of Code Execution Reasoning of Large...
cl144
 
PPTX
WHO And BIS std- for water quality .pptx
dhanashree78
 
PDF
PRIZ Academy - Process functional modelling
PRIZ Guru
 
SF 9_Unit 1.ppt software engineering ppt
AmarrKannthh
 
May 2025: Top 10 Read Articles in Data Mining & Knowledge Management Process
IJDKP
 
Rapid Prototyping for XR: Lecture 6 - AI for Prototyping and Research Directi...
Mark Billinghurst
 
CST413 KTU S7 CSE Machine Learning Introduction Parameter Estimation MLE MAP ...
resming1
 
Introduction to Python Programming Language
merlinjohnsy
 
Introduction to File Transfer Protocol with commands in FTP
BeulahS2
 
LECTURE 7 COMPUTATIONS OF LEVELING DATA APRIL 2025.pptx
rr22001247
 
Computer network Computer network Computer network Computer network
Shrikant317689
 
01-introduction to the ProcessDesign.pdf
StiveBrack
 
Plant Control_EST_85520-01_en_AllChanges_20220127.pdf
DarshanaChathuranga4
 
Rapid Prototyping for XR: Lecture 5 - Cross Platform Development
Mark Billinghurst
 
FINAL plumbing code for board exam passer
MattKristopherDiaz
 
Rapid Prototyping for XR: Lecture 3 - Video and Paper Prototyping
Mark Billinghurst
 
13th International Conference of Security, Privacy and Trust Management (SPTM...
ijcisjournal
 
June 2025 Top 10 Sites -Electrical and Electronics Engineering: An Internatio...
elelijjournal653
 
MATERIAL SCIENCE LECTURE NOTES FOR DIPLOMA STUDENTS
SAMEER VISHWAKARMA
 
Rapid Prototyping for XR: Lecture 2 - Low Fidelity Prototyping.
Mark Billinghurst
 
FSE_LLM4SE1_A Tool for In-depth Analysis of Code Execution Reasoning of Large...
cl144
 
WHO And BIS std- for water quality .pptx
dhanashree78
 
PRIZ Academy - Process functional modelling
PRIZ Guru
 

RTC Interfacing and Programming

  • 1. 1 The 8051 Microcontroller and Embedded Systems CHAPTER 15 RTC Interfacing and Programming
  • 2. Introduction of Real Time Clock  The real-time clock (RTC) is a widely used device that provides accurate time and date for many applications  Many systems such as the x86 IBM PC come with such a chip on the motherboard  The RTC chip in the IBM PC provides time components of hour, minute, and second, in addition to the date/calendar components of year, month, and day 2
  • 3. Introduction of Real Time Clock  The RTC chip uses an internal battery, which keeps the time and date even when the power is off  One of the most widely used RTC chips is the DS 12887 from Dallas Semiconductor /Maxim Corp  It uses an internal lithium battery to keep operating for over 10 years in the absence of external power 3
  • 4. Introduction of Real Time Clock  According to the DS 12887 data sheet from Maxim, it keeps track of “seconds, minutes, hours, days, day of week, date, month, and year with leap-year compensation valid up to year 2100″  The above information is provided in both binary (hex) and BCD formats. The DS 12887 supports both 12-hour and 24-hour clock modes with AM and PM in the 12-hour 4 mode
  • 5.  It also supports the Daylight Savings Time option  The DS 12887 uses CMOS technology to keep the power consumption low and it has the designation DS12C887, where C is for CMOS  The DS12887 has a total of 128 bytes of nonvolatile RAM 5 Introduction of Real Time Clock
  • 6.  It uses 14 bytes of RAM for clock/calendar and control registers, and the other 114 bytes of RAM are for general-purpose data storage  In the x86 IBM PC, these 114 bytes of NV-RAM are used for the CMOS configuration, where the system setups are kept before the operating system takes over 6 Introduction of Real Time Clock
  • 7. Pin Diagram of DS12887 RTC 7
  • 8. Address map of the DS12887 8
  • 9.  The DS12887 has a total of 128 bytes of RAM space with addresses 00 -7FH  The first ten locations, 00 – 09, are set aside for RTC values of time, calendar, and alarm data  The next four bytes are used for the control and status registers 9 Address map of the DS12887
  • 10.  They are registers A, B, C, and D and are located at addresses 10-13 (OA – OD in hex)  The next 114 bytes from addresses OEH to 7FH are available for data storage  The entire 128 bytes of RAM are accessible directly for read or write except the following: – Registers C and D are read-only – D7 bit of register A is read-only – The high-order bit of the seconds byte is read-only 10 Address map of the DS12887
  • 11. DS12887 Address Location for Time, Calendar, and Alarm 11
  • 12. Interfacing of DS12887 with 8051 12
  • 13. Turning on the oscillator for the first time  The DS12887 is equipped with the internal oscillator which is turned off in order to save the lithium battery.  We need to turn on the oscillator before we use the time keeping features of the DS 12887  To do that, bits D6 – D4 of register A must be set to value 010 13
  • 14. Register A Bits for Turning on the DS12887′s Oscillator 14
  • 15. Code for turning ON DS12887  ACALL DELAY_200MS ;Giving settling time  MOV R0,#0AH ; Reg A address of DS12887  MOV A,#20H ; 010 DATA FOR D6-D4  MOVX @R0,A 15
  • 17. Register C 17 – IRQF =1: if PF = PIE= 1 orAF=AIE= 1 orUF = UIE= 1 – PF Periodic interrupt flag. Periodic interrupts can be generated at a rate of once every 500 ms to once every 122 us. The rate is set by bits RS3 – RSO of register A
  • 18. Register C  AF Alarm interrupt flag. The AF becomes 1 when the current real time matches the alarm time. AF and AIE of register B together (if both are 1) will allow the IRQ to be asserted low when all the three bytes of the real time (yy:mm:dd) are the same as the bytes in the alarm time  The AF also becomes 1 for cases of once per second, once per minute, and once per 18 hour alarm
  • 19. ALARM AND SQW FEATURES OF THE DS12887 CHIP 19 The SQW pin provides us a square wave output of various frequencies The frequency is chosen by bits RSO – RS3 of register A
  • 20.  Also enable SQWE bit in Register B 20 ALARM AND SQW FEATURES OF THE DS12887 CHIP
  • 21. ALARM FEATURE OF DS12887 CHIP  The alarm interrupt can be programmed to occur at rates of – (a) once per day – (b) once per hour – (c) once per minute – (d) once per second 21
  • 22. Once-per-day alarm  To program the alarm for once per day, we write the desired time for the alarm into the hour, minute, and second RAM locations 1, 3, and 5  As the clock keeps the time, when all three bytes of hour, minute, and second for the real time clock match the values in the alarm hour, minute, and second, the AF (alarm flag) bit in register C of the DS 12887 will go 22 high
  • 23. Once-per-hour, minute and second alarms  To program the alarm for once per hour, we write value FFH into the alarm hour location of 5 only  To program the alarm for once per minute, we write value FFH into both the alarm hour and alarm minute locations of 5 and 3  To program the alarm for once per second, we write value FFH into all three locations of alarm hour, alarm minute, and alarm second 23
  • 24.  We can poll the AF bit in register C, which is a waste of microcontroller resources, or allow the IRQ pin to be activated upon matching the alarm time with the real time  It must be noted that in order to use the IRQ pin of the DS 12887 for an alarm, the interrupt-enable bit for alarm in register B (AIE) must be set high 24 IRQ FEATURE OF THE DS12887 CHIP
  • 25. IRQ FEATURE OF THE DS12887 CHIP 25
  • 26.  Interrupt request (IRQ) is an output pin for the DS12887 RTC chip  There are three possible sources that can activate the IRQ pin – (a) alarm interrupt – (b) periodic pulse interrupt – (c) update interrupt  We can choose which source to activate the IRQ pin using the interrupt-enable bit in register B of the DS 12887 26 IRQ FEATURE OF THE DS12887 CHIP
  • 27. PERIODIC INTERRUPT  The second source of interrupt is the periodic interrupt flag (PF)  The periodic interrupt flag is part of register C  It will go high at a rate set by the RS3 -RSO bits of register A  This rate can be from once every 500 ms to once every 122 us as shown  The PF becomes 1 when an edge is detected 27 for the period
  • 28.  Just like alarm interrupt, the periodic interrupt can also be directed to the IRQ pin  To use IRQ, the interrupt-enable bits of PIE in register B must be set to 1  In other words, we can poll the PF bit of register C, which is a waste of the microcontroller’s resources, or it can be directed to the hardware IRQ pin  If we set PIE = 1, the IRQ pin is asserted low when PF goes high 28 PERIODIC INTERRUPT
  • 29.  While the alarm interrupt gave us the options from once per day to once per second, the periodic interrupt gives us the option of subsecond interrupts  For example, we can write a program to send a message to the screen twice per second (2 Hz) 29 PERIODIC INTERRUPT