SlideShare ist ein Scribd-Unternehmen logo
1 von 2
It is desired to create a 2 Hz pulse on PORTB.5.
A nested loop was produced to create the delay.
Why were the numbers 250 and 39 chosen?
What frequency does the author assume?
How is the number 25.6 microseconds determined?
In this problem, calculate what percentage overhead the author assumes?
Solution
for the frequnecy of 2Hz(period of 0.5s) on PORTB, we need to toggle the pin every 0.25s.
0.25s = 250 * 1ms
250 is the largest number using an unsigned char which is rounded.
8-bit timer is used with prescaler of 64. The timer value loaded is 255 i.e., a only 1 tick for the
timer to overflow.
as mentioned in the calculation the delay is 1(ticks) * 64(prescaler) * 0.4us(the period of CLKO)
= 25.6us
This indicates the clock used is of period (0.4/4) = 0.1us. and frequency of 10MHz.
The overhead in the delay routine is that the instruction to configure the timer0 also consumes
some time and should be considered as it gets accumulated over the for loops.
to accommodate the overhead the internal for loop count is reduced to 35 from 39. So the actual
delay of for loop will be 1ms/35 = 28.57us instead of 25.6.
so the percentage of overhead = (28.57 - 25.6)/25.6 = 0.116 = 11.6%
It is desired to create a 2 Hz pulse on PORTB-5- A nested loop was pro.docx

Weitere ähnliche Inhalte

Ähnlich wie It is desired to create a 2 Hz pulse on PORTB-5- A nested loop was pro.docx

Ähnlich wie It is desired to create a 2 Hz pulse on PORTB-5- A nested loop was pro.docx (20)

Chapter 08
Chapter 08Chapter 08
Chapter 08
 
Real 2nd order LC PLL loop analysis.pptx
Real 2nd order LC PLL loop analysis.pptxReal 2nd order LC PLL loop analysis.pptx
Real 2nd order LC PLL loop analysis.pptx
 
Switching and signalling ovt, Winter training .bsnl .swesome knowledge ,tele...
Switching and signalling ovt, Winter training .bsnl .swesome  knowledge ,tele...Switching and signalling ovt, Winter training .bsnl .swesome  knowledge ,tele...
Switching and signalling ovt, Winter training .bsnl .swesome knowledge ,tele...
 
EC8691 - UNIT 5.pdf
EC8691 - UNIT 5.pdfEC8691 - UNIT 5.pdf
EC8691 - UNIT 5.pdf
 
Vlsi interview questions compilation
Vlsi interview questions compilationVlsi interview questions compilation
Vlsi interview questions compilation
 
PIC-Chapter_10.pptx
PIC-Chapter_10.pptxPIC-Chapter_10.pptx
PIC-Chapter_10.pptx
 
Del oral question
Del oral questionDel oral question
Del oral question
 
8051 Timers and Counters
8051 Timers and Counters8051 Timers and Counters
8051 Timers and Counters
 
AVRTIMER.pptx
AVRTIMER.pptxAVRTIMER.pptx
AVRTIMER.pptx
 
Time delays & counter.ppt
Time delays & counter.pptTime delays & counter.ppt
Time delays & counter.ppt
 
PIC timer programming
PIC timer programmingPIC timer programming
PIC timer programming
 
AVR_Course_Day7 timers counters and interrupt programming
AVR_Course_Day7 timers counters and  interrupt programmingAVR_Course_Day7 timers counters and  interrupt programming
AVR_Course_Day7 timers counters and interrupt programming
 
Channelconfih s9
Channelconfih s9Channelconfih s9
Channelconfih s9
 
Chapter 8
Chapter 8Chapter 8
Chapter 8
 
Lpc 1768 timers
Lpc 1768 timersLpc 1768 timers
Lpc 1768 timers
 
ADC and its Circuit design
ADC and its Circuit designADC and its Circuit design
ADC and its Circuit design
 
Advanced Comuter Architecture Ch6 Problem Solutions
Advanced Comuter Architecture Ch6 Problem SolutionsAdvanced Comuter Architecture Ch6 Problem Solutions
Advanced Comuter Architecture Ch6 Problem Solutions
 
Kai hwang solution
Kai hwang solutionKai hwang solution
Kai hwang solution
 
Ece4760 hw4
Ece4760 hw4Ece4760 hw4
Ece4760 hw4
 
timer counter (1).pptx
timer counter (1).pptxtimer counter (1).pptx
timer counter (1).pptx
 

Mehr von michael1810

John Corporation has three investments that are classified as noncontr.docx
John Corporation has three investments that are classified as noncontr.docxJohn Corporation has three investments that are classified as noncontr.docx
John Corporation has three investments that are classified as noncontr.docx
michael1810
 
Joe Frecaso was recently hired as the controller for Larson Cement Com.docx
Joe Frecaso was recently hired as the controller for Larson Cement Com.docxJoe Frecaso was recently hired as the controller for Larson Cement Com.docx
Joe Frecaso was recently hired as the controller for Larson Cement Com.docx
michael1810
 
For each of the abstract data types (ADTs) that we have analyzed in th.docx
For each of the abstract data types (ADTs) that we have analyzed in th.docxFor each of the abstract data types (ADTs) that we have analyzed in th.docx
For each of the abstract data types (ADTs) that we have analyzed in th.docx
michael1810
 
For each form of transport plot the value of overall benefits against.docx
For each form of transport plot the value of overall benefits against.docxFor each form of transport plot the value of overall benefits against.docx
For each form of transport plot the value of overall benefits against.docx
michael1810
 

Mehr von michael1810 (18)

Judging from their relative positions in the Periodic Table- which ato.docx
Judging from their relative positions in the Periodic Table- which ato.docxJudging from their relative positions in the Periodic Table- which ato.docx
Judging from their relative positions in the Periodic Table- which ato.docx
 
John Corporation has three investments that are classified as noncontr.docx
John Corporation has three investments that are classified as noncontr.docxJohn Corporation has three investments that are classified as noncontr.docx
John Corporation has three investments that are classified as noncontr.docx
 
John Smith worked in the stockyard of a large building supply company-.docx
John Smith worked in the stockyard of a large building supply company-.docxJohn Smith worked in the stockyard of a large building supply company-.docx
John Smith worked in the stockyard of a large building supply company-.docx
 
John has tremendous technical skills and frequently comes up with valu.docx
John has tremendous technical skills and frequently comes up with valu.docxJohn has tremendous technical skills and frequently comes up with valu.docx
John has tremendous technical skills and frequently comes up with valu.docx
 
Joe Frecaso was recently hired as the controller for Larson Cement Com.docx
Joe Frecaso was recently hired as the controller for Larson Cement Com.docxJoe Frecaso was recently hired as the controller for Larson Cement Com.docx
Joe Frecaso was recently hired as the controller for Larson Cement Com.docx
 
Java Write a method that takes as a parameter a one dimensional array.docx
Java Write a method that takes as a parameter a one dimensional array.docxJava Write a method that takes as a parameter a one dimensional array.docx
Java Write a method that takes as a parameter a one dimensional array.docx
 
Java Programming- 1) Write a recursive method that finds and returns t.docx
Java Programming- 1) Write a recursive method that finds and returns t.docxJava Programming- 1) Write a recursive method that finds and returns t.docx
Java Programming- 1) Write a recursive method that finds and returns t.docx
 
JAVA Q2- Write a program that reads strings from the user and writes t.docx
JAVA Q2- Write a program that reads strings from the user and writes t.docxJAVA Q2- Write a program that reads strings from the user and writes t.docx
JAVA Q2- Write a program that reads strings from the user and writes t.docx
 
Java Language Which of the following statements is true- Select all th.docx
Java Language Which of the following statements is true- Select all th.docxJava Language Which of the following statements is true- Select all th.docx
Java Language Which of the following statements is true- Select all th.docx
 
It-'s virtualization topic Would anyone please expalin what is the di.docx
It-'s virtualization topic  Would anyone please expalin what is the di.docxIt-'s virtualization topic  Would anyone please expalin what is the di.docx
It-'s virtualization topic Would anyone please expalin what is the di.docx
 
For each pair of substance identify the substance that is likely to ha.docx
For each pair of substance identify the substance that is likely to ha.docxFor each pair of substance identify the substance that is likely to ha.docx
For each pair of substance identify the substance that is likely to ha.docx
 
For each of the requirements listed in the table below- 1- Please iden.docx
For each of the requirements listed in the table below- 1- Please iden.docxFor each of the requirements listed in the table below- 1- Please iden.docx
For each of the requirements listed in the table below- 1- Please iden.docx
 
For Contingent Liability- When do you disclose it- When do you record.docx
For Contingent Liability- When do you disclose it- When do you record.docxFor Contingent Liability- When do you disclose it- When do you record.docx
For Contingent Liability- When do you disclose it- When do you record.docx
 
For each of the abstract data types (ADTs) that we have analyzed in th.docx
For each of the abstract data types (ADTs) that we have analyzed in th.docxFor each of the abstract data types (ADTs) that we have analyzed in th.docx
For each of the abstract data types (ADTs) that we have analyzed in th.docx
 
For each form of transport plot the value of overall benefits against.docx
For each form of transport plot the value of overall benefits against.docxFor each form of transport plot the value of overall benefits against.docx
For each form of transport plot the value of overall benefits against.docx
 
Fluid Mechanics The water surface is at the position shown at t - 0 se.docx
Fluid Mechanics The water surface is at the position shown at t - 0 se.docxFluid Mechanics The water surface is at the position shown at t - 0 se.docx
Fluid Mechanics The water surface is at the position shown at t - 0 se.docx
 
Fluctuation in inflation can occur in the short or long term- For exam.docx
Fluctuation in inflation can occur in the short or long term- For exam.docxFluctuation in inflation can occur in the short or long term- For exam.docx
Fluctuation in inflation can occur in the short or long term- For exam.docx
 
First National Bank charges 11-2 percent compounded monthly on its bus (1).docx
First National Bank charges 11-2 percent compounded monthly on its bus (1).docxFirst National Bank charges 11-2 percent compounded monthly on its bus (1).docx
First National Bank charges 11-2 percent compounded monthly on its bus (1).docx
 

Kürzlich hochgeladen

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 

Kürzlich hochgeladen (20)

Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 

It is desired to create a 2 Hz pulse on PORTB-5- A nested loop was pro.docx

  • 1. It is desired to create a 2 Hz pulse on PORTB.5. A nested loop was produced to create the delay. Why were the numbers 250 and 39 chosen? What frequency does the author assume? How is the number 25.6 microseconds determined? In this problem, calculate what percentage overhead the author assumes? Solution for the frequnecy of 2Hz(period of 0.5s) on PORTB, we need to toggle the pin every 0.25s. 0.25s = 250 * 1ms 250 is the largest number using an unsigned char which is rounded. 8-bit timer is used with prescaler of 64. The timer value loaded is 255 i.e., a only 1 tick for the timer to overflow. as mentioned in the calculation the delay is 1(ticks) * 64(prescaler) * 0.4us(the period of CLKO) = 25.6us This indicates the clock used is of period (0.4/4) = 0.1us. and frequency of 10MHz. The overhead in the delay routine is that the instruction to configure the timer0 also consumes some time and should be considered as it gets accumulated over the for loops. to accommodate the overhead the internal for loop count is reduced to 35 from 39. So the actual delay of for loop will be 1ms/35 = 28.57us instead of 25.6. so the percentage of overhead = (28.57 - 25.6)/25.6 = 0.116 = 11.6%