SlideShare a Scribd company logo
1 of 2
Download to read offline
Lab 6: 20 points
EE 337: Microprocessors Laboratory (Spring 2021)
Section: S1 (Second year UG)
Indian Institute of Technology Bombay
Date: March 15, 2021
1. [10 points] Write code to implement a simple reaction timer that works as follows and uses
interrupts.
i) Set the switch SW1 in Off position. The program starts with a message on LCD as
“Toggle SW1” on the first line and “if LED glows” on the second line. After displaying
this message for 2 seconds, turn on the LED P1.4.
ii) The user toggles SW1 because of the displayed message. The LED should be turned
Off as soon as the switch is toggled.
iii) The program is expected to measure time between the instant the LED starts glowing
and the instant the switch toggle is identified.
iv) Next, the display on the LCD shows “Reaction Time” on the first line and the “Count
is XX XXXX” on the second line. Assuming T0 is used, display of count should be
of 6 digits. First 2 digits show the number of times the timer has overflown, next 2
digits show the TH0 value, next 2 digits show TL0 value, each value in hexadecimal.
This message is displayed for 5 seconds. Note: Optionally, you can display the time
in msec.
v) Go back to Step (i) and repeat the process continuously.
2. [10 points] Write code to generate two musical notes corresponding to the frequencies shown
in Table 1. The musical notes can be generated as square waveform of specific frequencies.
These can be generated and output using the speaker with appropriate interfacing.
1. Use timer T0 to generate the note (waveform) of appropriate frequency. Use timer
T1 to control the duration of the note. The output has to be written to port P0.0.
Generate the two notes shown in Table 1 and let the duration of the notes be 2 s each.
Do this continuously and verify the output using the debugger.
2. Connect the speaker to the Pt-51 kit using the SL100 transistor and interfacing circuit
shown in Figure 1. You should be able to hear the notes being played out on the
speaker.
Table 1: Note frequencies.
S. No. Note Frequency
1 Re 270
2 Ga 300
TA Checkpoints
1. For question 1, ask the students to show the working of the reaction timer. Do this with
short and long reaction times.
2. For question 2, check the appropriate waveforms on the logic analyzer (Keil). Also ask
them to play out the notes.
(a) SL100 pinout
+5V
SPEAKER
C
B
E
470 ohms
1K ohms
High Volume
Low Volume
Audio Signal from Board
RED
BLACK
SL/CL 100
(b) Speaker driver circuit.
Figure 1: Circuit for interfacing Pt-51 with speaker.

More Related Content

What's hot

EE 337 Lab 1 for Section 1 (2nd year UG)
 EE 337 Lab 1 for Section 1 (2nd year UG) EE 337 Lab 1 for Section 1 (2nd year UG)
EE 337 Lab 1 for Section 1 (2nd year UG)SaravananVijayakumar4
 
SE PAI Unit 5_IO programming in 8051
SE PAI Unit 5_IO programming in 8051SE PAI Unit 5_IO programming in 8051
SE PAI Unit 5_IO programming in 8051KanchanPatil34
 
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 2KanchanPatil34
 
SE PAI Unit 5_Serial Port Programming in 8051 micro controller_Part 3
SE PAI Unit 5_Serial Port Programming in 8051 micro controller_Part 3SE PAI Unit 5_Serial Port Programming in 8051 micro controller_Part 3
SE PAI Unit 5_Serial Port Programming in 8051 micro controller_Part 3KanchanPatil34
 
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 1
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 1SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 1
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 1KanchanPatil34
 
8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED C8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED CAman Sharma
 
Node finder presentation
Node finder presentationNode finder presentation
Node finder presentationVarun Varshney
 

What's hot (18)

Lab3 s2
Lab3 s2Lab3 s2
Lab3 s2
 
Lab3 s1
Lab3 s1Lab3 s1
Lab3 s1
 
8051 Interrupts
8051 Interrupts8051 Interrupts
8051 Interrupts
 
Lab7 s2
Lab7 s2Lab7 s2
Lab7 s2
 
EE 337 Lab 1 for Section 1 (2nd year UG)
 EE 337 Lab 1 for Section 1 (2nd year UG) EE 337 Lab 1 for Section 1 (2nd year UG)
EE 337 Lab 1 for Section 1 (2nd year UG)
 
Lab5 s1
Lab5 s1Lab5 s1
Lab5 s1
 
Pt 51 ver-1.3_user_manual
Pt 51 ver-1.3_user_manualPt 51 ver-1.3_user_manual
Pt 51 ver-1.3_user_manual
 
Serial IO for 8051
Serial IO for 8051Serial IO for 8051
Serial IO for 8051
 
SE PAI Unit 5_IO programming in 8051
SE PAI Unit 5_IO programming in 8051SE PAI Unit 5_IO programming in 8051
SE PAI Unit 5_IO programming in 8051
 
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
 
SE PAI Unit 5_Serial Port Programming in 8051 micro controller_Part 3
SE PAI Unit 5_Serial Port Programming in 8051 micro controller_Part 3SE PAI Unit 5_Serial Port Programming in 8051 micro controller_Part 3
SE PAI Unit 5_Serial Port Programming in 8051 micro controller_Part 3
 
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 1
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 1SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 1
SE PAI Unit 5_Timer Programming in 8051 microcontroller_Part 1
 
8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED C8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED C
 
Intel Hex Format
Intel Hex FormatIntel Hex Format
Intel Hex Format
 
Node finder presentation
Node finder presentationNode finder presentation
Node finder presentation
 
Lpc 1768 timers
Lpc 1768 timersLpc 1768 timers
Lpc 1768 timers
 
Switch Control and Time Delay - Keypad
Switch Control and Time Delay - KeypadSwitch Control and Time Delay - Keypad
Switch Control and Time Delay - Keypad
 
8051 timers--2
   8051 timers--2   8051 timers--2
8051 timers--2
 

Similar to Lab6 s1

EE337 Microprocessors Lab Labsheet 5
EE337 Microprocessors Lab Labsheet 5EE337 Microprocessors Lab Labsheet 5
EE337 Microprocessors Lab Labsheet 5SaravananVijayakumar4
 
Lecture 1 - Introduction to Signals.pdf
Lecture 1 - Introduction to Signals.pdfLecture 1 - Introduction to Signals.pdf
Lecture 1 - Introduction to Signals.pdfssuser7218f0
 
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 programmingMohamed Ali
 
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/50Ruthvik Vaila
 
VlSI course project report : Keypad Scanner
VlSI course project report : Keypad Scanner VlSI course project report : Keypad Scanner
VlSI course project report : Keypad Scanner Omkar Rane
 
Freescale Microcontroller programming
Freescale Microcontroller programmingFreescale Microcontroller programming
Freescale Microcontroller programmingShih Cheng Tung
 
Microcontroladores: El microcontrolador 8051 con LCD 16x2
Microcontroladores: El microcontrolador 8051 con LCD 16x2Microcontroladores: El microcontrolador 8051 con LCD 16x2
Microcontroladores: El microcontrolador 8051 con LCD 16x2SANTIAGO PABLO ALBERTO
 
Electric Circuits Lab Inductors in DC CircuitsI. .docx
Electric Circuits Lab Inductors in DC CircuitsI.          .docxElectric Circuits Lab Inductors in DC CircuitsI.          .docx
Electric Circuits Lab Inductors in DC CircuitsI. .docxpauline234567
 
Digital Logic Counter.ppt
Digital Logic Counter.pptDigital Logic Counter.ppt
Digital Logic Counter.pptRaziyaSultana30
 
Counters & time delay
Counters & time delayCounters & time delay
Counters & time delayHemant Chetwani
 
ECET 105 Success Begins /newtonhelp.com 
ECET 105 Success Begins /newtonhelp.com ECET 105 Success Begins /newtonhelp.com 
ECET 105 Success Begins /newtonhelp.com myblue133
 
Micro c lab7(timers)
Micro c lab7(timers)Micro c lab7(timers)
Micro c lab7(timers)Mashood
 
Frequency Spectrum Displayer
Frequency Spectrum DisplayerFrequency Spectrum Displayer
Frequency Spectrum DisplayerHaowei Jiang
 

Similar to Lab6 s1 (20)

EE337 Microprocessors Lab Labsheet 5
EE337 Microprocessors Lab Labsheet 5EE337 Microprocessors Lab Labsheet 5
EE337 Microprocessors Lab Labsheet 5
 
Lecture 1 - Introduction to Signals.pdf
Lecture 1 - Introduction to Signals.pdfLecture 1 - Introduction to Signals.pdf
Lecture 1 - Introduction to Signals.pdf
 
Mc module5 ppt_msj
Mc module5 ppt_msjMc module5 ppt_msj
Mc module5 ppt_msj
 
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
 
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
 
Nitu projrct elec
Nitu projrct elecNitu projrct elec
Nitu projrct elec
 
8 remote control
8 remote control8 remote control
8 remote control
 
VlSI course project report : Keypad Scanner
VlSI course project report : Keypad Scanner VlSI course project report : Keypad Scanner
VlSI course project report : Keypad Scanner
 
Freescale Microcontroller programming
Freescale Microcontroller programmingFreescale Microcontroller programming
Freescale Microcontroller programming
 
Microcontroladores: El microcontrolador 8051 con LCD 16x2
Microcontroladores: El microcontrolador 8051 con LCD 16x2Microcontroladores: El microcontrolador 8051 con LCD 16x2
Microcontroladores: El microcontrolador 8051 con LCD 16x2
 
E04834649
E04834649E04834649
E04834649
 
Electric Circuits Lab Inductors in DC CircuitsI. .docx
Electric Circuits Lab Inductors in DC CircuitsI.          .docxElectric Circuits Lab Inductors in DC CircuitsI.          .docx
Electric Circuits Lab Inductors in DC CircuitsI. .docx
 
Digital Clock
Digital ClockDigital Clock
Digital Clock
 
K010316571
K010316571K010316571
K010316571
 
exp 15.docx
exp 15.docxexp 15.docx
exp 15.docx
 
Digital Logic Counter.ppt
Digital Logic Counter.pptDigital Logic Counter.ppt
Digital Logic Counter.ppt
 
Counters & time delay
Counters & time delayCounters & time delay
Counters & time delay
 
ECET 105 Success Begins /newtonhelp.com 
ECET 105 Success Begins /newtonhelp.com ECET 105 Success Begins /newtonhelp.com 
ECET 105 Success Begins /newtonhelp.com 
 
Micro c lab7(timers)
Micro c lab7(timers)Micro c lab7(timers)
Micro c lab7(timers)
 
Frequency Spectrum Displayer
Frequency Spectrum DisplayerFrequency Spectrum Displayer
Frequency Spectrum Displayer
 

More from rajbabureliance

More from rajbabureliance (8)

Lab7 s1
Lab7 s1Lab7 s1
Lab7 s1
 
Lab7 s1
Lab7 s1Lab7 s1
Lab7 s1
 
Lab3 s2
Lab3 s2Lab3 s2
Lab3 s2
 
Pt 51 kit - Peripheral self-test
Pt 51 kit - Peripheral self-testPt 51 kit - Peripheral self-test
Pt 51 kit - Peripheral self-test
 
Lab2 s1
Lab2 s1Lab2 s1
Lab2 s1
 
Lab2 s2
Lab2 s2Lab2 s2
Lab2 s2
 
EE337 Course Introduction
EE337 Course IntroductionEE337 Course Introduction
EE337 Course Introduction
 
EE337 Course Introduction
EE337 Course IntroductionEE337 Course Introduction
EE337 Course Introduction
 

Recently uploaded

_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Recently uploaded (20)

_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

Lab6 s1

  • 1. Lab 6: 20 points EE 337: Microprocessors Laboratory (Spring 2021) Section: S1 (Second year UG) Indian Institute of Technology Bombay Date: March 15, 2021 1. [10 points] Write code to implement a simple reaction timer that works as follows and uses interrupts. i) Set the switch SW1 in Off position. The program starts with a message on LCD as “Toggle SW1” on the first line and “if LED glows” on the second line. After displaying this message for 2 seconds, turn on the LED P1.4. ii) The user toggles SW1 because of the displayed message. The LED should be turned Off as soon as the switch is toggled. iii) The program is expected to measure time between the instant the LED starts glowing and the instant the switch toggle is identified. iv) Next, the display on the LCD shows “Reaction Time” on the first line and the “Count is XX XXXX” on the second line. Assuming T0 is used, display of count should be of 6 digits. First 2 digits show the number of times the timer has overflown, next 2 digits show the TH0 value, next 2 digits show TL0 value, each value in hexadecimal. This message is displayed for 5 seconds. Note: Optionally, you can display the time in msec. v) Go back to Step (i) and repeat the process continuously. 2. [10 points] Write code to generate two musical notes corresponding to the frequencies shown in Table 1. The musical notes can be generated as square waveform of specific frequencies. These can be generated and output using the speaker with appropriate interfacing. 1. Use timer T0 to generate the note (waveform) of appropriate frequency. Use timer T1 to control the duration of the note. The output has to be written to port P0.0. Generate the two notes shown in Table 1 and let the duration of the notes be 2 s each. Do this continuously and verify the output using the debugger. 2. Connect the speaker to the Pt-51 kit using the SL100 transistor and interfacing circuit shown in Figure 1. You should be able to hear the notes being played out on the speaker. Table 1: Note frequencies. S. No. Note Frequency 1 Re 270 2 Ga 300 TA Checkpoints 1. For question 1, ask the students to show the working of the reaction timer. Do this with short and long reaction times. 2. For question 2, check the appropriate waveforms on the logic analyzer (Keil). Also ask them to play out the notes.
  • 2. (a) SL100 pinout +5V SPEAKER C B E 470 ohms 1K ohms High Volume Low Volume Audio Signal from Board RED BLACK SL/CL 100 (b) Speaker driver circuit. Figure 1: Circuit for interfacing Pt-51 with speaker.