SlideShare a Scribd company logo
1 of 4
ORG 00H // origin
MOV DPTR,#LUT // moves the address of LUT to DPTR
MOV P1,#00000000B // sets P1 as output port
MOV P0,#00000000B // sets P0 as output port
CLR P3.0 // sets P3.0 as output for sending trigger
SETB P3.1 // sets P3.1 as input for receiving echo
MOV TMOD,#00100000B // sets timer1 as mode 2 auto reload timer
MAIN: MOV TL1,#207D // loads the initial value to start counting from
MOV TH1,#207D // loads the reload value
MOV A,#00000000B // clears accumulator
SETB P3.0 // starts the trigger pulse
ACALL DELAY1 // gives 10uS width for the trigger pulse
CLR P3.0 // ends the trigger pulse
HERE: JNB P3.1,HERE // loops here until echo is received
BACK: SETB TR1 // starts the timer1
HERE1: JNB TF1,HERE1 // loops here until timer overflows (ie;48 count)
CLR TR1 // stops the timer
CLR TF1 // clears timer flag 1
INC A // increments A for every timer1 overflow
JB P3.1,BACK // jumps to BACK if echo is still available
MOV R4,A // saves the value of A to R4
ACALL DLOOP // calls the display loop
SJMP MAIN // jumps to MAIN loop
DELAY1: MOV R6,#2D // 10uS delay
LABEL1: DJNZ R6,LABEL1
RET
DLOOP: MOV R5,#100D // loads R5 with 100D
BACK1: MOV A,R4 // loads the value in R4 to A
MOV B,#100D // loads B with 100D
DIV AB // isolates the first digit
SETB P1.0 // activates LED display unit D1
ACALL DISPLAY // calls DISPLAY subroutine
MOV P0,A // moves digit drive pattern for 1st digit to P0
ACALL DELAY // 1mS delay
ACALL DELAY
MOV A,B // moves the remainder of 1st division to A
MOV B,#10D // loads B with 10D
DIV AB // isolates the second digit
CLR P1.0 // deactivates LED display unit D1
SETB P1.1 // activates LED display unit D2
ACALL DISPLAY
MOV P0,A // moves digit drive pattern for 2nd digit to P0
ACALL DELAY
ACALL DELAY
MOV A,B // moves the remainder of 2nd division to A
CLR P1.1 // deactivates LED display unit D2
SETB P1.2 // activates LED display unit D3
ACALL DISPLAY
MOV P0,A // moves the digit drive pattern for 3rd digit to P0
ACALL DELAY
ACALL DELAY
CLR P1.2 // deactivates LED display unit D3
DJNZ R5,BACK1 // repeats the display loop 100 times
RET
DELAY: MOV R7,#250D // 1mS delay
LABEL2: DJNZ R7,LABEL2
RET
DISPLAY: MOVC A,@A+DPTR // gets the digit drive pattern for the content in A
CPL A // complements the digit drive pattern (see Note 1)
RET
LUT: DB 3FH // look up table (LUT) starts here
DB 06H
DB 5BH
DB 4FH
DB 66H
DB 6DH
DB 7DH
DB 07H
DB 7FH
DB 6FH
END

More Related Content

What's hot

Timer programming for 8051 using embedded c
Timer programming for 8051 using embedded cTimer programming for 8051 using embedded c
Timer programming for 8051 using embedded cVikas Dongre
 
The 8051 assembly language
The 8051 assembly languageThe 8051 assembly language
The 8051 assembly languagehemant meena
 
Maicrocontroller lab basic experiments
Maicrocontroller lab basic experimentsMaicrocontroller lab basic experiments
Maicrocontroller lab basic experimentsNoor Tahasildar
 
Micro c lab7(timers)
Micro c lab7(timers)Micro c lab7(timers)
Micro c lab7(timers)Mashood
 
New text document
New text documentNew text document
New text documentzocaniveb
 
Timer programming
Timer programming Timer programming
Timer programming vijaydeepakg
 
Using Timers in PIC18F Microcontrollers
Using Timers in PIC18F MicrocontrollersUsing Timers in PIC18F Microcontrollers
Using Timers in PIC18F MicrocontrollersCorrado Santoro
 
Stack and subroutine
Stack and subroutineStack and subroutine
Stack and subroutinemilandhara
 
86409 interfacing the keyboard to 8051 microcontroller
86409 interfacing the keyboard to 8051 microcontroller86409 interfacing the keyboard to 8051 microcontroller
86409 interfacing the keyboard to 8051 microcontrollerbheemsain
 

What's hot (14)

Timer programming for 8051 using embedded c
Timer programming for 8051 using embedded cTimer programming for 8051 using embedded c
Timer programming for 8051 using embedded c
 
The 8051 assembly language
The 8051 assembly languageThe 8051 assembly language
The 8051 assembly language
 
Mic practicals
Mic practicalsMic practicals
Mic practicals
 
Maicrocontroller lab basic experiments
Maicrocontroller lab basic experimentsMaicrocontroller lab basic experiments
Maicrocontroller lab basic experiments
 
8051 timers--2
   8051 timers--2   8051 timers--2
8051 timers--2
 
Micro c lab7(timers)
Micro c lab7(timers)Micro c lab7(timers)
Micro c lab7(timers)
 
8051 Timer
8051 Timer8051 Timer
8051 Timer
 
New text document
New text documentNew text document
New text document
 
Timer programming
Timer programming Timer programming
Timer programming
 
Using Timers in PIC18F Microcontrollers
Using Timers in PIC18F MicrocontrollersUsing Timers in PIC18F Microcontrollers
Using Timers in PIC18F Microcontrollers
 
Timers
TimersTimers
Timers
 
8051 ch9-950217
8051 ch9-9502178051 ch9-950217
8051 ch9-950217
 
Stack and subroutine
Stack and subroutineStack and subroutine
Stack and subroutine
 
86409 interfacing the keyboard to 8051 microcontroller
86409 interfacing the keyboard to 8051 microcontroller86409 interfacing the keyboard to 8051 microcontroller
86409 interfacing the keyboard to 8051 microcontroller
 

Viewers also liked

China dingxing desiccant factory assessment report
China dingxing desiccant factory assessment reportChina dingxing desiccant factory assessment report
China dingxing desiccant factory assessment reportScott Zhong
 
Brasil - inundações e deslizamentos 2011
Brasil - inundações e deslizamentos 2011Brasil - inundações e deslizamentos 2011
Brasil - inundações e deslizamentos 2011Carlos Gomes
 
Annu E-License (1)
Annu E-License (1)Annu E-License (1)
Annu E-License (1)Annu Manosh
 
How to Get the Younger Generation Involved - NAIOP Chapter Leadership & Legis...
How to Get the Younger Generation Involved - NAIOP Chapter Leadership & Legis...How to Get the Younger Generation Involved - NAIOP Chapter Leadership & Legis...
How to Get the Younger Generation Involved - NAIOP Chapter Leadership & Legis...Katie Olbrich
 
ก้าวแรกส่งานบริการ
ก้าวแรกส่งานบริการก้าวแรกส่งานบริการ
ก้าวแรกส่งานบริการSutthiluck Kaewboonrurn
 
Quality Improvement Project
Quality Improvement ProjectQuality Improvement Project
Quality Improvement ProjectKristen Oxender
 
Use Promise, Future and some functional programing stuff without being a math...
Use Promise, Future and some functional programing stuff without being a math...Use Promise, Future and some functional programing stuff without being a math...
Use Promise, Future and some functional programing stuff without being a math...Quentin Adam
 
Hacking Ruby with Python
Hacking Ruby with PythonHacking Ruby with Python
Hacking Ruby with PythonTaisuke Yamada
 
Las estaciones del año. educapeque 2ºb. educapeque 2ºb s
Las estaciones del año. educapeque 2ºb. educapeque 2ºb sLas estaciones del año. educapeque 2ºb. educapeque 2ºb s
Las estaciones del año. educapeque 2ºb. educapeque 2ºb sMarta López
 
Micro c lab3(ssd)
Micro c lab3(ssd)Micro c lab3(ssd)
Micro c lab3(ssd)Mashood
 
preventing sqli and xss by ravi rajput in owasp meet ahmedabad
preventing sqli and xss by ravi rajput in owasp meet ahmedabadpreventing sqli and xss by ravi rajput in owasp meet ahmedabad
preventing sqli and xss by ravi rajput in owasp meet ahmedabadRavi Rajput
 
Building a Dynamic Website Using Django
Building a Dynamic Website Using DjangoBuilding a Dynamic Website Using Django
Building a Dynamic Website Using DjangoNathan Eror
 
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium MeetupSelenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium MeetupDave Haeffner
 
Defcon 21 - Fear the Evil FOCA: mitm attacks using IPv6
Defcon 21 - Fear the Evil FOCA: mitm attacks using IPv6Defcon 21 - Fear the Evil FOCA: mitm attacks using IPv6
Defcon 21 - Fear the Evil FOCA: mitm attacks using IPv6Chema Alonso
 

Viewers also liked (20)

Story
StoryStory
Story
 
Creating CD Covers
Creating CD CoversCreating CD Covers
Creating CD Covers
 
China dingxing desiccant factory assessment report
China dingxing desiccant factory assessment reportChina dingxing desiccant factory assessment report
China dingxing desiccant factory assessment report
 
A life kamarzi
A life  kamarziA life  kamarzi
A life kamarzi
 
Brasil - inundações e deslizamentos 2011
Brasil - inundações e deslizamentos 2011Brasil - inundações e deslizamentos 2011
Brasil - inundações e deslizamentos 2011
 
Annu E-License (1)
Annu E-License (1)Annu E-License (1)
Annu E-License (1)
 
How to Get the Younger Generation Involved - NAIOP Chapter Leadership & Legis...
How to Get the Younger Generation Involved - NAIOP Chapter Leadership & Legis...How to Get the Younger Generation Involved - NAIOP Chapter Leadership & Legis...
How to Get the Younger Generation Involved - NAIOP Chapter Leadership & Legis...
 
ก้าวแรกส่งานบริการ
ก้าวแรกส่งานบริการก้าวแรกส่งานบริการ
ก้าวแรกส่งานบริการ
 
Quality Improvement Project
Quality Improvement ProjectQuality Improvement Project
Quality Improvement Project
 
Use Promise, Future and some functional programing stuff without being a math...
Use Promise, Future and some functional programing stuff without being a math...Use Promise, Future and some functional programing stuff without being a math...
Use Promise, Future and some functional programing stuff without being a math...
 
Middle man
Middle manMiddle man
Middle man
 
Hacking Ruby with Python
Hacking Ruby with PythonHacking Ruby with Python
Hacking Ruby with Python
 
Django Testing
Django TestingDjango Testing
Django Testing
 
Las estaciones del año. educapeque 2ºb. educapeque 2ºb s
Las estaciones del año. educapeque 2ºb. educapeque 2ºb sLas estaciones del año. educapeque 2ºb. educapeque 2ºb s
Las estaciones del año. educapeque 2ºb. educapeque 2ºb s
 
Hacking y python: Hacking de redes con Python
Hacking y python: Hacking de redes con PythonHacking y python: Hacking de redes con Python
Hacking y python: Hacking de redes con Python
 
Micro c lab3(ssd)
Micro c lab3(ssd)Micro c lab3(ssd)
Micro c lab3(ssd)
 
preventing sqli and xss by ravi rajput in owasp meet ahmedabad
preventing sqli and xss by ravi rajput in owasp meet ahmedabadpreventing sqli and xss by ravi rajput in owasp meet ahmedabad
preventing sqli and xss by ravi rajput in owasp meet ahmedabad
 
Building a Dynamic Website Using Django
Building a Dynamic Website Using DjangoBuilding a Dynamic Website Using Django
Building a Dynamic Website Using Django
 
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium MeetupSelenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
 
Defcon 21 - Fear the Evil FOCA: mitm attacks using IPv6
Defcon 21 - Fear the Evil FOCA: mitm attacks using IPv6Defcon 21 - Fear the Evil FOCA: mitm attacks using IPv6
Defcon 21 - Fear the Evil FOCA: mitm attacks using IPv6
 

Similar to Code 8051

8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf
8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf
8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdfShashiKiran664181
 
PWM wave generator using microcontroller
 PWM wave generator using microcontroller  PWM wave generator using microcontroller
PWM wave generator using microcontroller Swapnil2515
 
Solutionmanual8051microcontrollerbymazidi
Solutionmanual8051microcontrollerbymazidi Solutionmanual8051microcontrollerbymazidi
Solutionmanual8051microcontrollerbymazidi Ahsan Mehmood
 
Solutionmanual8051microcontrollerbymazidi 131215070701-phpapp02
Solutionmanual8051microcontrollerbymazidi 131215070701-phpapp02Solutionmanual8051microcontrollerbymazidi 131215070701-phpapp02
Solutionmanual8051microcontrollerbymazidi 131215070701-phpapp02SURYA DEEPAK
 
Applications of microcontroller(8051)
Applications of microcontroller(8051) Applications of microcontroller(8051)
Applications of microcontroller(8051) vijaydeepakg
 
Microcontrollers-MODULE4.pptx
Microcontrollers-MODULE4.pptxMicrocontrollers-MODULE4.pptx
Microcontrollers-MODULE4.pptxAmoghR3
 
Microcontroller (8051) general and simple alp n cprograms
Microcontroller (8051) general and simple alp n cprogramsMicrocontroller (8051) general and simple alp n cprograms
Microcontroller (8051) general and simple alp n cprogramsVedavyas PBurli
 
WINSEM2023-24_BECE204L_TH_VL2023240505625_2024-01-29_Reference-Material-I.pptx
WINSEM2023-24_BECE204L_TH_VL2023240505625_2024-01-29_Reference-Material-I.pptxWINSEM2023-24_BECE204L_TH_VL2023240505625_2024-01-29_Reference-Material-I.pptx
WINSEM2023-24_BECE204L_TH_VL2023240505625_2024-01-29_Reference-Material-I.pptxSrinivasanUma1
 
Microcontroller 8051- soft.ppt
Microcontroller 8051- soft.pptMicrocontroller 8051- soft.ppt
Microcontroller 8051- soft.pptsteffydean
 
1203 Ppi 8155
1203 Ppi 81551203 Ppi 8155
1203 Ppi 8155techbed
 
Microprocessor Week 9: Timer and Counter
Microprocessor Week 9: Timer and CounterMicroprocessor Week 9: Timer and Counter
Microprocessor Week 9: Timer and CounterArkhom Jodtang
 
Solution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidiSolution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidiMuhammad Abdullah
 
Analog to digital converter
Analog to digital converterAnalog to digital converter
Analog to digital converterCorrado Santoro
 
I o ports and timers of 8051
I o ports and timers of 8051I o ports and timers of 8051
I o ports and timers of 8051SARITHA REDDY
 
STL PN-DP Slave Com Log
STL PN-DP Slave Com LogSTL PN-DP Slave Com Log
STL PN-DP Slave Com LogTony Bell
 

Similar to Code 8051 (20)

8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf
8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf
8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf
 
PWM wave generator using microcontroller
 PWM wave generator using microcontroller  PWM wave generator using microcontroller
PWM wave generator using microcontroller
 
Solutionmanual8051microcontrollerbymazidi
Solutionmanual8051microcontrollerbymazidi Solutionmanual8051microcontrollerbymazidi
Solutionmanual8051microcontrollerbymazidi
 
Solutionmanual8051microcontrollerbymazidi 131215070701-phpapp02
Solutionmanual8051microcontrollerbymazidi 131215070701-phpapp02Solutionmanual8051microcontrollerbymazidi 131215070701-phpapp02
Solutionmanual8051microcontrollerbymazidi 131215070701-phpapp02
 
Applications of microcontroller(8051)
Applications of microcontroller(8051) Applications of microcontroller(8051)
Applications of microcontroller(8051)
 
4.Timer_1.ppt
4.Timer_1.ppt4.Timer_1.ppt
4.Timer_1.ppt
 
Microcontrollers-MODULE4.pptx
Microcontrollers-MODULE4.pptxMicrocontrollers-MODULE4.pptx
Microcontrollers-MODULE4.pptx
 
Microcontroller (8051) general and simple alp n cprograms
Microcontroller (8051) general and simple alp n cprogramsMicrocontroller (8051) general and simple alp n cprograms
Microcontroller (8051) general and simple alp n cprograms
 
WINSEM2023-24_BECE204L_TH_VL2023240505625_2024-01-29_Reference-Material-I.pptx
WINSEM2023-24_BECE204L_TH_VL2023240505625_2024-01-29_Reference-Material-I.pptxWINSEM2023-24_BECE204L_TH_VL2023240505625_2024-01-29_Reference-Material-I.pptx
WINSEM2023-24_BECE204L_TH_VL2023240505625_2024-01-29_Reference-Material-I.pptx
 
8051 FINIAL
8051 FINIAL8051 FINIAL
8051 FINIAL
 
Microcontroller 8051- soft.ppt
Microcontroller 8051- soft.pptMicrocontroller 8051- soft.ppt
Microcontroller 8051- soft.ppt
 
8155 GPPI
8155 GPPI8155 GPPI
8155 GPPI
 
1203 Ppi 8155
1203 Ppi 81551203 Ppi 8155
1203 Ppi 8155
 
Microprocessor Week 9: Timer and Counter
Microprocessor Week 9: Timer and CounterMicroprocessor Week 9: Timer and Counter
Microprocessor Week 9: Timer and Counter
 
Solution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidiSolution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidi
 
6.pptx
6.pptx6.pptx
6.pptx
 
Analog to digital converter
Analog to digital converterAnalog to digital converter
Analog to digital converter
 
I o ports and timers of 8051
I o ports and timers of 8051I o ports and timers of 8051
I o ports and timers of 8051
 
STL PN-DP Slave Com Log
STL PN-DP Slave Com LogSTL PN-DP Slave Com Log
STL PN-DP Slave Com Log
 
UNIT-5.ppt
UNIT-5.pptUNIT-5.ppt
UNIT-5.ppt
 

Recently uploaded

Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoordharasingh5698
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 

Recently uploaded (20)

Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 

Code 8051

  • 1. ORG 00H // origin MOV DPTR,#LUT // moves the address of LUT to DPTR MOV P1,#00000000B // sets P1 as output port MOV P0,#00000000B // sets P0 as output port CLR P3.0 // sets P3.0 as output for sending trigger SETB P3.1 // sets P3.1 as input for receiving echo MOV TMOD,#00100000B // sets timer1 as mode 2 auto reload timer MAIN: MOV TL1,#207D // loads the initial value to start counting from MOV TH1,#207D // loads the reload value MOV A,#00000000B // clears accumulator SETB P3.0 // starts the trigger pulse ACALL DELAY1 // gives 10uS width for the trigger pulse CLR P3.0 // ends the trigger pulse HERE: JNB P3.1,HERE // loops here until echo is received BACK: SETB TR1 // starts the timer1 HERE1: JNB TF1,HERE1 // loops here until timer overflows (ie;48 count) CLR TR1 // stops the timer CLR TF1 // clears timer flag 1 INC A // increments A for every timer1 overflow
  • 2. JB P3.1,BACK // jumps to BACK if echo is still available MOV R4,A // saves the value of A to R4 ACALL DLOOP // calls the display loop SJMP MAIN // jumps to MAIN loop DELAY1: MOV R6,#2D // 10uS delay LABEL1: DJNZ R6,LABEL1 RET DLOOP: MOV R5,#100D // loads R5 with 100D BACK1: MOV A,R4 // loads the value in R4 to A MOV B,#100D // loads B with 100D DIV AB // isolates the first digit SETB P1.0 // activates LED display unit D1 ACALL DISPLAY // calls DISPLAY subroutine MOV P0,A // moves digit drive pattern for 1st digit to P0 ACALL DELAY // 1mS delay ACALL DELAY MOV A,B // moves the remainder of 1st division to A
  • 3. MOV B,#10D // loads B with 10D DIV AB // isolates the second digit CLR P1.0 // deactivates LED display unit D1 SETB P1.1 // activates LED display unit D2 ACALL DISPLAY MOV P0,A // moves digit drive pattern for 2nd digit to P0 ACALL DELAY ACALL DELAY MOV A,B // moves the remainder of 2nd division to A CLR P1.1 // deactivates LED display unit D2 SETB P1.2 // activates LED display unit D3 ACALL DISPLAY MOV P0,A // moves the digit drive pattern for 3rd digit to P0 ACALL DELAY ACALL DELAY CLR P1.2 // deactivates LED display unit D3 DJNZ R5,BACK1 // repeats the display loop 100 times RET
  • 4. DELAY: MOV R7,#250D // 1mS delay LABEL2: DJNZ R7,LABEL2 RET DISPLAY: MOVC A,@A+DPTR // gets the digit drive pattern for the content in A CPL A // complements the digit drive pattern (see Note 1) RET LUT: DB 3FH // look up table (LUT) starts here DB 06H DB 5BH DB 4FH DB 66H DB 6DH DB 7DH DB 07H DB 7FH DB 6FH END