SlideShare a Scribd company logo
COUNTERS AND TIME
DELAYS
PAVITHRA D.R ,BMSCW
• A counter is designed simply by loading appropriate
number into one of the registers and using INR or
DNR instructions.
• Loop is established to update the count.
• Each count is checked to determine whether it has
reached final number ;if not, the loop is repeated.
COUNTER AND TIME DELAYS
PAVITHRA D.R ,BMSCW
TIME DELAY
 Procedure used to design a specific delay.
 A register is loaded with a number , depending on the
time delay required and then the register is
decremented until it reaches zero by setting up a loop
with conditional jump instruction.
 Time delay using
One register:
PAVITHRA D.R ,BMSCW
COMMENTS T
Clock frequency of the system = 2 MHz
Clock period= 1/T= 0.5 μs
Time to execute MVI = 7 T states * 0.5= 3.5 μs
Time Delay in Loop TL= T*Loop T states *N10
= 0.5 * 14* 255
= 1785 μs = 1.8 ms
N10 = Equivalent decimal number of hexadecimal count loaded in the
delay register
TLA= Time to execute loop instructions
=TL –(3T states* clock period)=1785-1.5=1783.5 μs
Note: Total time delay Td= To+ TLA
To=T X outside loop T-states
LABEL OPCODE OPERAND
STATES
MVI C,FFH ;Load register C 7
LOOP: DCR C ;Decrement C 4
JNZ LOOP ;Jump back to 10/7
PAVITHRA D.R ,BMSCW
TIME DELAY USING A REGISTER PAIR
Label Opcode Operand Comments T states
LXI B,2384H Load BC with 16-bit count 10
LOOP: DCX B Decrement BC by 1 6
MOV A,C Place contents of C in A 4
ORA B OR B with C to set Zero flag 4
JNZ LOOP if result not equal to 0 , 10/7
jump back to loop
Time Delay in Loop TL= T*Loop T states *N10
= 0.5 * 24* 9092
= 109 ms
Time Delay using a LOOP within a LOOP
MVI B,38H 7T Delay in Loop TL1=1783.5 μs
LOOP2: MVI C,FFH 7T Delay in Loop TL2= (0.5*21+TL1)*56
LOOP1: DCR C 4T =100.46ms
JNZ LOOP1 10/7 T
DCR B 4T
JNZ LOOP 2 10/7T PAVITHRA D.R ,BMSCW
Flowchart
for
time
delay with
two loops
PAVITHRA D.R ,BMSCW
Flowchart of a counter with time delay
PAVITHRA D.R ,BMSCW
ILLUSTRATIVE PROGRAM: HEXADECIMAL
COUNTER
Write a Program to count continuously from FFH to 00H using
register C with delay count 8CH between each count and
display the number at one of the output ports.
MVI B,00H
DCR B
MVI C,8CH
NEXT:
DELAY: DCR C
JNZ DELAY
MOV A,B
OUT PORT#
JMP NEXT
PAVITHRA D.R ,BMSCW
ILLUSTRATIVE PROGRAM: ZERO TO NINE
(MODULO TEN) COUNTER
START: MVI B,00H
MOVA,B
DSPLAY: OUT PORT #
LXI H,16-bit
LOOP: DCX H
MOV A,L
ORA H
JNZ LOOP
INR B
MOV A,B
CPI 0AH
JNZ DSPLAY
JZ START
Start
Initialize counter
Display Output
Load Delay register
Decrement Delay register
Is Delay register=0?
Next Count
Is count =0AH?
If yes, Initialize counter
If no, Display Output
PAVITHRA D.R ,BMSCW
ILLUSTRATIVE PROGRAM:
GENERATING PULSE WAVEFORMS
•Generates a continuous
square wave with the period
of 500 Micro Sec. Assume
the system clock period is
325ns, and use bit D0
output the square wave.
PAVITHRA D.R ,BMSCW

More Related Content

Similar to Microprocessor_Counter_and_Time_Delay.pptx

4.Timer_1.ppt
4.Timer_1.ppt4.Timer_1.ppt
4.Timer_1.ppt
YashwanthChandra7
 
8.1 Counters & Time Delays.pptx
8.1 Counters & Time Delays.pptx8.1 Counters & Time Delays.pptx
8.1 Counters & Time Delays.pptx
Devashish397099
 
Timer programming
Timer programming Timer programming
Timer programming
vijaydeepakg
 
8051 ch9
8051 ch98051 ch9
8051 ch9
860540760
 
computer architecture 4
computer architecture 4 computer architecture 4
computer architecture 4
Dr.Umadevi V
 
Delay routine
Delay routineDelay routine
Delay routine
Yash Gandhi
 
MEASUREMENT AND DISPLAY OF THE MAINS FREQUENCY USING PIC18F4520/50
MEASUREMENT AND DISPLAY OF THE MAINS FREQUENCY USING PIC18F4520/50MEASUREMENT AND DISPLAY OF THE MAINS FREQUENCY USING PIC18F4520/50
MEASUREMENT AND DISPLAY OF THE MAINS FREQUENCY USING PIC18F4520/50
Ruthvik Vaila
 
FREQUENCY COUNTERS AND TIME-INTERVAL MEASUREMENTS.pdf
FREQUENCY COUNTERS AND TIME-INTERVAL MEASUREMENTS.pdfFREQUENCY COUNTERS AND TIME-INTERVAL MEASUREMENTS.pdf
FREQUENCY COUNTERS AND TIME-INTERVAL MEASUREMENTS.pdf
ssuser72979d
 
AVRTIMER.pptx
AVRTIMER.pptxAVRTIMER.pptx
AVRTIMER.pptx
Pratik Gohel
 
PIC-Chapter_10.pptx
PIC-Chapter_10.pptxPIC-Chapter_10.pptx
PIC-Chapter_10.pptx
AliBzeih7
 
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2
KanchanPatil34
 
Addressing mode and instruction set using 8051
Addressing mode and instruction set using 8051Addressing mode and instruction set using 8051
Addressing mode and instruction set using 8051
logesh waran
 
8051 ch9-950217
8051 ch9-9502178051 ch9-950217
8051 ch9-950217
Gopal Krishna Murthy C R
 
8051 Timer
8051 Timer8051 Timer
8051 Timer
Ramasubbu .P
 
Chp7 pic 16 f84 interfacing - copy
Chp7 pic 16 f84 interfacing - copyChp7 pic 16 f84 interfacing - copy
Chp7 pic 16 f84 interfacing - copy
mkazree
 
Lec12
Lec12Lec12
EC8691 - UNIT 5.pdf
EC8691 - UNIT 5.pdfEC8691 - UNIT 5.pdf
EC8691 - UNIT 5.pdf
SPonmalar1
 
8255 programming
8255 programming8255 programming
8255 programming
Jeyalaksmi V Professor ECE
 
8085-Programming-II-mod-1.pptx
8085-Programming-II-mod-1.pptx8085-Programming-II-mod-1.pptx
8085-Programming-II-mod-1.pptx
Asmita Bhagdikar
 
9 timer programming
9 timer programming9 timer programming
9 timer programming
Channabasappa Kudarihal
 

Similar to Microprocessor_Counter_and_Time_Delay.pptx (20)

4.Timer_1.ppt
4.Timer_1.ppt4.Timer_1.ppt
4.Timer_1.ppt
 
8.1 Counters & Time Delays.pptx
8.1 Counters & Time Delays.pptx8.1 Counters & Time Delays.pptx
8.1 Counters & Time Delays.pptx
 
Timer programming
Timer programming Timer programming
Timer programming
 
8051 ch9
8051 ch98051 ch9
8051 ch9
 
computer architecture 4
computer architecture 4 computer architecture 4
computer architecture 4
 
Delay routine
Delay routineDelay routine
Delay routine
 
MEASUREMENT AND DISPLAY OF THE MAINS FREQUENCY USING PIC18F4520/50
MEASUREMENT AND DISPLAY OF THE MAINS FREQUENCY USING PIC18F4520/50MEASUREMENT AND DISPLAY OF THE MAINS FREQUENCY USING PIC18F4520/50
MEASUREMENT AND DISPLAY OF THE MAINS FREQUENCY USING PIC18F4520/50
 
FREQUENCY COUNTERS AND TIME-INTERVAL MEASUREMENTS.pdf
FREQUENCY COUNTERS AND TIME-INTERVAL MEASUREMENTS.pdfFREQUENCY COUNTERS AND TIME-INTERVAL MEASUREMENTS.pdf
FREQUENCY COUNTERS AND TIME-INTERVAL MEASUREMENTS.pdf
 
AVRTIMER.pptx
AVRTIMER.pptxAVRTIMER.pptx
AVRTIMER.pptx
 
PIC-Chapter_10.pptx
PIC-Chapter_10.pptxPIC-Chapter_10.pptx
PIC-Chapter_10.pptx
 
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 2
 
Addressing mode and instruction set using 8051
Addressing mode and instruction set using 8051Addressing mode and instruction set using 8051
Addressing mode and instruction set using 8051
 
8051 ch9-950217
8051 ch9-9502178051 ch9-950217
8051 ch9-950217
 
8051 Timer
8051 Timer8051 Timer
8051 Timer
 
Chp7 pic 16 f84 interfacing - copy
Chp7 pic 16 f84 interfacing - copyChp7 pic 16 f84 interfacing - copy
Chp7 pic 16 f84 interfacing - copy
 
Lec12
Lec12Lec12
Lec12
 
EC8691 - UNIT 5.pdf
EC8691 - UNIT 5.pdfEC8691 - UNIT 5.pdf
EC8691 - UNIT 5.pdf
 
8255 programming
8255 programming8255 programming
8255 programming
 
8085-Programming-II-mod-1.pptx
8085-Programming-II-mod-1.pptx8085-Programming-II-mod-1.pptx
8085-Programming-II-mod-1.pptx
 
9 timer programming
9 timer programming9 timer programming
9 timer programming
 

Recently uploaded

Upturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in NashikUpturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio, Inc.
 
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and MoreManyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
narinav14
 
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
campbellclarkson
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
Maitrey Patel
 
Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...
Paul Brebner
 
DevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps ServicesDevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps Services
seospiralmantra
 
42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert
vaishalijagtap12
 
Boost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management AppsBoost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management Apps
Jhone kinadey
 
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
kalichargn70th171
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Paul Brebner
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
kalichargn70th171
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
kgyxske
 
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptxOperational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
sandeepmenon62
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
Massimo Artizzu
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
dakas1
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
ervikas4
 
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdfThe Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
kalichargn70th171
 

Recently uploaded (20)

Upturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in NashikUpturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in Nashik
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
 
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and MoreManyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
 
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
 
Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...
 
DevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps ServicesDevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps Services
 
42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert
 
Boost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management AppsBoost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management Apps
 
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
 
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptxOperational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
 
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdfThe Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
 

Microprocessor_Counter_and_Time_Delay.pptx

  • 2. • A counter is designed simply by loading appropriate number into one of the registers and using INR or DNR instructions. • Loop is established to update the count. • Each count is checked to determine whether it has reached final number ;if not, the loop is repeated. COUNTER AND TIME DELAYS PAVITHRA D.R ,BMSCW
  • 3. TIME DELAY  Procedure used to design a specific delay.  A register is loaded with a number , depending on the time delay required and then the register is decremented until it reaches zero by setting up a loop with conditional jump instruction.  Time delay using One register: PAVITHRA D.R ,BMSCW
  • 4. COMMENTS T Clock frequency of the system = 2 MHz Clock period= 1/T= 0.5 μs Time to execute MVI = 7 T states * 0.5= 3.5 μs Time Delay in Loop TL= T*Loop T states *N10 = 0.5 * 14* 255 = 1785 μs = 1.8 ms N10 = Equivalent decimal number of hexadecimal count loaded in the delay register TLA= Time to execute loop instructions =TL –(3T states* clock period)=1785-1.5=1783.5 μs Note: Total time delay Td= To+ TLA To=T X outside loop T-states LABEL OPCODE OPERAND STATES MVI C,FFH ;Load register C 7 LOOP: DCR C ;Decrement C 4 JNZ LOOP ;Jump back to 10/7 PAVITHRA D.R ,BMSCW
  • 5. TIME DELAY USING A REGISTER PAIR Label Opcode Operand Comments T states LXI B,2384H Load BC with 16-bit count 10 LOOP: DCX B Decrement BC by 1 6 MOV A,C Place contents of C in A 4 ORA B OR B with C to set Zero flag 4 JNZ LOOP if result not equal to 0 , 10/7 jump back to loop Time Delay in Loop TL= T*Loop T states *N10 = 0.5 * 24* 9092 = 109 ms Time Delay using a LOOP within a LOOP MVI B,38H 7T Delay in Loop TL1=1783.5 μs LOOP2: MVI C,FFH 7T Delay in Loop TL2= (0.5*21+TL1)*56 LOOP1: DCR C 4T =100.46ms JNZ LOOP1 10/7 T DCR B 4T JNZ LOOP 2 10/7T PAVITHRA D.R ,BMSCW
  • 7. Flowchart of a counter with time delay PAVITHRA D.R ,BMSCW
  • 8. ILLUSTRATIVE PROGRAM: HEXADECIMAL COUNTER Write a Program to count continuously from FFH to 00H using register C with delay count 8CH between each count and display the number at one of the output ports. MVI B,00H DCR B MVI C,8CH NEXT: DELAY: DCR C JNZ DELAY MOV A,B OUT PORT# JMP NEXT PAVITHRA D.R ,BMSCW
  • 9. ILLUSTRATIVE PROGRAM: ZERO TO NINE (MODULO TEN) COUNTER START: MVI B,00H MOVA,B DSPLAY: OUT PORT # LXI H,16-bit LOOP: DCX H MOV A,L ORA H JNZ LOOP INR B MOV A,B CPI 0AH JNZ DSPLAY JZ START Start Initialize counter Display Output Load Delay register Decrement Delay register Is Delay register=0? Next Count Is count =0AH? If yes, Initialize counter If no, Display Output PAVITHRA D.R ,BMSCW
  • 10. ILLUSTRATIVE PROGRAM: GENERATING PULSE WAVEFORMS •Generates a continuous square wave with the period of 500 Micro Sec. Assume the system clock period is 325ns, and use bit D0 output the square wave. PAVITHRA D.R ,BMSCW