SlideShare ist ein Scribd-Unternehmen logo
1 von 2
Downloaden Sie, um offline zu lesen
Lab 7: 20 points + 5 bonus points
EE 337: Microprocessors Laboratory (Spring 2022)
Indian Institute of Technology Bombay
Date: March 08, 2022
1. [10 points] Reaction time is the delay between the onset of a stimulus and an individual’s response.
For example, in a 100-metre dash a race official fires a pistol to signal the beginning of the race. The
sound of the pistol firing is the stimulus and the time it takes for a runner to react is their reaction
time.
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 should show the number of times the timer has overflown
‱ The next 2 digits should show the TH0 value
‱ The next 2 digits should show TL0 value
‱ All values need to be shown in hexadecimal format.
‱ This message should be displayed for 5 seconds.
Bonus 5 points: Optionally, you can display the reaction time in milliseconds. That is, instead
of displaying “Count is XX XXXX”, you can display “TTTT milliseconds”. The TTTT should
be in decimal format.
v) Go back to Step (i) and repeat the process continuously.
2. [10 points] Write code to play some music corresponding to the note frequencies mentioned in Table 1
on the left hand side. The order and duration of the notes are given on the right hand side. The
musical notes can be generated as square waveforms of specific frequencies. To generate silence,
write the zero bit to the port pin P0.7. These can be generated and output using the speaker with
appropriate interfacing.
Table 1: Note frequencies, sequence and durations.
S. No. Note
Frequency
(in Hertz)
1 N1 220
2 N2 247
3 N3 294
4 N4 370
5 N5 330
Order Note
Duration
(ms)
1 N1 750
2 N2 750
3 N3 750
4 N2 750
5 N4 1000
6 Silence 500
7 N4 1000
8 N5 1000
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 pin P0.7.
Generate the notes shown on the right hand side in Table 1 using the durations mentioned. 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. During this
period, the text “ROLLING TIME” must be displayed on the LCD.
3. Shoot a 30 second video of your kit playing the notes. Make sure your face appears
at the beginning of the video. The video needs to be uploaded using the Video upload
link for lab 7 assignment in the course team on MS Teams (it has an option to attach files).
The file size cannot exceed 200 MB.
(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.
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. Keep the long reaction time to below 30 seconds to avoid wrap around.
2. For question 2, check the appropriate waveforms on the logic analyzer (Keil). Also ask them to
play out the notes on the speaker.

Weitere Àhnliche Inhalte

Was ist angesagt?

Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...Sivaranjan Goswami
 
Interrupt
InterruptInterrupt
Interruptanishgoel
 
L13 interrupts-in-atmega328 p
L13 interrupts-in-atmega328 pL13 interrupts-in-atmega328 p
L13 interrupts-in-atmega328 prsamurti
 
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
 
8 interrupt 8051
8 interrupt 80518 interrupt 8051
8 interrupt 8051daniemol
 
Mp &mc programs
Mp &mc programsMp &mc programs
Mp &mc programsHaritha Hary
 
Aihro-1
Aihro-1Aihro-1
Aihro-1AKHIL JOY
 
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
 
Delay routine
Delay routineDelay routine
Delay routineYash Gandhi
 

Was ist angesagt? (19)

8051 Timers
8051 Timers8051 Timers
8051 Timers
 
Lab7 s1
Lab7 s1Lab7 s1
Lab7 s1
 
Lab4 s2
Lab4 s2Lab4 s2
Lab4 s2
 
Lab6 s2
Lab6 s2Lab6 s2
Lab6 s2
 
Lab7 s2
Lab7 s2Lab7 s2
Lab7 s2
 
Intel Hex Format
Intel Hex FormatIntel Hex Format
Intel Hex Format
 
Lab3 s1
Lab3 s1Lab3 s1
Lab3 s1
 
Lab3 s2
Lab3 s2Lab3 s2
Lab3 s2
 
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
Introduction to Embedded C for 8051 and Implementation of Timer and Interrupt...
 
Interrupt
InterruptInterrupt
Interrupt
 
L13 interrupts-in-atmega328 p
L13 interrupts-in-atmega328 pL13 interrupts-in-atmega328 p
L13 interrupts-in-atmega328 p
 
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
 
8 interrupt 8051
8 interrupt 80518 interrupt 8051
8 interrupt 8051
 
Mp &mc programs
Mp &mc programsMp &mc programs
Mp &mc programs
 
Aihro-1
Aihro-1Aihro-1
Aihro-1
 
Mp lab manual
Mp lab manualMp lab manual
Mp lab manual
 
Jp
Jp Jp
Jp
 
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)
 
Delay routine
Delay routineDelay routine
Delay routine
 

Ähnlich wie Lab7 of EE337 Microprocessors Lab, 2022, IIT Bombay

EE337 Microprocessors Lab Labsheet 5
EE337 Microprocessors Lab Labsheet 5EE337 Microprocessors Lab Labsheet 5
EE337 Microprocessors Lab Labsheet 5SaravananVijayakumar4
 
Frequency Spectrum Displayer
Frequency Spectrum DisplayerFrequency Spectrum Displayer
Frequency Spectrum DisplayerHaowei Jiang
 
Switch Control and Time Delay - Keypad
Switch Control and Time Delay - KeypadSwitch Control and Time Delay - Keypad
Switch Control and Time Delay - KeypadAriel Tonatiuh Espindola
 
The Doppler EffectWhat is the Doppler effect, and why is it impo.docx
The Doppler EffectWhat is the Doppler effect, and why is it impo.docxThe Doppler EffectWhat is the Doppler effect, and why is it impo.docx
The Doppler EffectWhat is the Doppler effect, and why is it impo.docxcherry686017
 
Lab burner
Lab burnerLab burner
Lab burnerAsif Ilyas
 
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
 
Digital Alarm Clock 446 project report
Digital Alarm Clock 446 project reportDigital Alarm Clock 446 project report
Digital Alarm Clock 446 project reportAkash Mhankale
 
DTMF based home automation with ADRUINO
DTMF based home automation with ADRUINODTMF based home automation with ADRUINO
DTMF based home automation with ADRUINOFucck
 
Laboratory exercise 5
Laboratory exercise 5Laboratory exercise 5
Laboratory exercise 5swapnilswap11
 
ECET 105 Technology levels--snaptutorial.com
ECET 105 Technology levels--snaptutorial.comECET 105 Technology levels--snaptutorial.com
ECET 105 Technology levels--snaptutorial.comsholingarjosh101
 
Ecet 105 Success Begins / snaptutorial.com
Ecet 105 Success Begins / snaptutorial.comEcet 105 Success Begins / snaptutorial.com
Ecet 105 Success Begins / snaptutorial.comWilliamswarzzk
 
ECET 105 Massive Success--snaptutorial.com
ECET 105 Massive Success--snaptutorial.comECET 105 Massive Success--snaptutorial.com
ECET 105 Massive Success--snaptutorial.comsantricksapiens70
 
Ecet 105 Enthusiastic Study / snaptutorial.com
Ecet 105 Enthusiastic Study / snaptutorial.comEcet 105 Enthusiastic Study / snaptutorial.com
Ecet 105 Enthusiastic Study / snaptutorial.comStephenson38
 
BE Project Fortnight Reports on IVRS
BE Project Fortnight Reports on IVRSBE Project Fortnight Reports on IVRS
BE Project Fortnight Reports on IVRSAbhishek Nadkarni
 
ECET 105 help A Guide to career/Snaptutorial
ECET 105 help A Guide to career/SnaptutorialECET 105 help A Guide to career/Snaptutorial
ECET 105 help A Guide to career/Snaptutorialpinck199
 
ECET 105 help A Guide to career/Snaptutorial
 ECET 105 help A Guide to career/Snaptutorial ECET 105 help A Guide to career/Snaptutorial
ECET 105 help A Guide to career/Snaptutorialpinck243
 

Ähnlich wie Lab7 of EE337 Microprocessors Lab, 2022, IIT Bombay (20)

Lab5 s1
Lab5 s1Lab5 s1
Lab5 s1
 
EE337 Microprocessors Lab Labsheet 5
EE337 Microprocessors Lab Labsheet 5EE337 Microprocessors Lab Labsheet 5
EE337 Microprocessors Lab Labsheet 5
 
Lab4 s1
Lab4 s1Lab4 s1
Lab4 s1
 
Frequency Spectrum Displayer
Frequency Spectrum DisplayerFrequency Spectrum Displayer
Frequency Spectrum Displayer
 
Switch Control and Time Delay - Keypad
Switch Control and Time Delay - KeypadSwitch Control and Time Delay - Keypad
Switch Control and Time Delay - Keypad
 
PrĂĄctica 1 a 7 m bot ingles
PrĂĄctica 1 a 7 m bot inglesPrĂĄctica 1 a 7 m bot ingles
PrĂĄctica 1 a 7 m bot ingles
 
The Doppler EffectWhat is the Doppler effect, and why is it impo.docx
The Doppler EffectWhat is the Doppler effect, and why is it impo.docxThe Doppler EffectWhat is the Doppler effect, and why is it impo.docx
The Doppler EffectWhat is the Doppler effect, and why is it impo.docx
 
Lab burner
Lab burnerLab burner
Lab burner
 
ECET 105 Success Begins /newtonhelp.com 
ECET 105 Success Begins /newtonhelp.com ECET 105 Success Begins /newtonhelp.com 
ECET 105 Success Begins /newtonhelp.com 
 
Digital Alarm Clock 446 project report
Digital Alarm Clock 446 project reportDigital Alarm Clock 446 project report
Digital Alarm Clock 446 project report
 
DTMF based home automation with ADRUINO
DTMF based home automation with ADRUINODTMF based home automation with ADRUINO
DTMF based home automation with ADRUINO
 
Laboratory exercise 5
Laboratory exercise 5Laboratory exercise 5
Laboratory exercise 5
 
Timers and Endge-aligned PWM
Timers and Endge-aligned PWMTimers and Endge-aligned PWM
Timers and Endge-aligned PWM
 
ECET 105 Technology levels--snaptutorial.com
ECET 105 Technology levels--snaptutorial.comECET 105 Technology levels--snaptutorial.com
ECET 105 Technology levels--snaptutorial.com
 
Ecet 105 Success Begins / snaptutorial.com
Ecet 105 Success Begins / snaptutorial.comEcet 105 Success Begins / snaptutorial.com
Ecet 105 Success Begins / snaptutorial.com
 
ECET 105 Massive Success--snaptutorial.com
ECET 105 Massive Success--snaptutorial.comECET 105 Massive Success--snaptutorial.com
ECET 105 Massive Success--snaptutorial.com
 
Ecet 105 Enthusiastic Study / snaptutorial.com
Ecet 105 Enthusiastic Study / snaptutorial.comEcet 105 Enthusiastic Study / snaptutorial.com
Ecet 105 Enthusiastic Study / snaptutorial.com
 
BE Project Fortnight Reports on IVRS
BE Project Fortnight Reports on IVRSBE Project Fortnight Reports on IVRS
BE Project Fortnight Reports on IVRS
 
ECET 105 help A Guide to career/Snaptutorial
ECET 105 help A Guide to career/SnaptutorialECET 105 help A Guide to career/Snaptutorial
ECET 105 help A Guide to career/Snaptutorial
 
ECET 105 help A Guide to career/Snaptutorial
 ECET 105 help A Guide to career/Snaptutorial ECET 105 help A Guide to career/Snaptutorial
ECET 105 help A Guide to career/Snaptutorial
 

Mehr von SaravananVijayakumar4

EE337 Microprocessor Lab, Course Outline, Spring 2023
EE337 Microprocessor Lab, Course Outline, Spring 2023EE337 Microprocessor Lab, Course Outline, Spring 2023
EE337 Microprocessor Lab, Course Outline, Spring 2023SaravananVijayakumar4
 
EE337 Course introduction 2021
EE337 Course introduction 2021EE337 Course introduction 2021
EE337 Course introduction 2021SaravananVijayakumar4
 
EE 337 Lab 1 for Section 2 (3rd year UG)
EE 337 Lab 1 for Section 2 (3rd year UG)EE 337 Lab 1 for Section 2 (3rd year UG)
EE 337 Lab 1 for Section 2 (3rd year UG)SaravananVijayakumar4
 
Getting started with Keil uVision 2020
Getting started with Keil uVision 2020Getting started with Keil uVision 2020
Getting started with Keil uVision 2020SaravananVijayakumar4
 
EE337 Course introduction 2021
EE337 Course introduction 2021EE337 Course introduction 2021
EE337 Course introduction 2021SaravananVijayakumar4
 
Hex file creation using Keil uVision
Hex file creation using Keil uVisionHex file creation using Keil uVision
Hex file creation using Keil uVisionSaravananVijayakumar4
 
Debugging programs with Keil uVision
Debugging programs with Keil uVisionDebugging programs with Keil uVision
Debugging programs with Keil uVisionSaravananVijayakumar4
 
Introduction to Microcontrollers
Introduction to MicrocontrollersIntroduction to Microcontrollers
Introduction to MicrocontrollersSaravananVijayakumar4
 
EE337 Course introduction 2018
EE337 Course introduction 2018EE337 Course introduction 2018
EE337 Course introduction 2018SaravananVijayakumar4
 

Mehr von SaravananVijayakumar4 (14)

EE337 Spring 2023 Lab1
EE337 Spring 2023 Lab1EE337 Spring 2023 Lab1
EE337 Spring 2023 Lab1
 
EE337 Microprocessor Lab, Course Outline, Spring 2023
EE337 Microprocessor Lab, Course Outline, Spring 2023EE337 Microprocessor Lab, Course Outline, Spring 2023
EE337 Microprocessor Lab, Course Outline, Spring 2023
 
EE337 Course introduction 2021
EE337 Course introduction 2021EE337 Course introduction 2021
EE337 Course introduction 2021
 
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
 
EE 337 Lab 1 for Section 2 (3rd year UG)
EE 337 Lab 1 for Section 2 (3rd year UG)EE 337 Lab 1 for Section 2 (3rd year UG)
EE 337 Lab 1 for Section 2 (3rd year UG)
 
Getting started with Keil uVision 2020
Getting started with Keil uVision 2020Getting started with Keil uVision 2020
Getting started with Keil uVision 2020
 
EE337 Course introduction 2021
EE337 Course introduction 2021EE337 Course introduction 2021
EE337 Course introduction 2021
 
Hex file creation using Keil uVision
Hex file creation using Keil uVisionHex file creation using Keil uVision
Hex file creation using Keil uVision
 
Debugging programs with Keil uVision
Debugging programs with Keil uVisionDebugging programs with Keil uVision
Debugging programs with Keil uVision
 
Introduction to Microcontrollers
Introduction to MicrocontrollersIntroduction to Microcontrollers
Introduction to Microcontrollers
 
8051 instruction set
8051 instruction set8051 instruction set
8051 instruction set
 
89c5131datasheet
89c5131datasheet89c5131datasheet
89c5131datasheet
 
Pt-51 User Manual
Pt-51 User ManualPt-51 User Manual
Pt-51 User Manual
 
EE337 Course introduction 2018
EE337 Course introduction 2018EE337 Course introduction 2018
EE337 Course introduction 2018
 

KĂŒrzlich hochgeladen

HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
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.pdfNirmal Dwivedi
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
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.docxRamakrishna Reddy Bijjam
 
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 POSCeline George
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
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 PractiseAnaAcapella
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
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.pdfAdmir Softic
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 

KĂŒrzlich hochgeladen (20)

HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
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
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
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
 
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
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
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
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
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
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 

Lab7 of EE337 Microprocessors Lab, 2022, IIT Bombay

  • 1. Lab 7: 20 points + 5 bonus points EE 337: Microprocessors Laboratory (Spring 2022) Indian Institute of Technology Bombay Date: March 08, 2022 1. [10 points] Reaction time is the delay between the onset of a stimulus and an individual’s response. For example, in a 100-metre dash a race official fires a pistol to signal the beginning of the race. The sound of the pistol firing is the stimulus and the time it takes for a runner to react is their reaction time. 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 should show the number of times the timer has overflown ‱ The next 2 digits should show the TH0 value ‱ The next 2 digits should show TL0 value ‱ All values need to be shown in hexadecimal format. ‱ This message should be displayed for 5 seconds. Bonus 5 points: Optionally, you can display the reaction time in milliseconds. That is, instead of displaying “Count is XX XXXX”, you can display “TTTT milliseconds”. The TTTT should be in decimal format. v) Go back to Step (i) and repeat the process continuously. 2. [10 points] Write code to play some music corresponding to the note frequencies mentioned in Table 1 on the left hand side. The order and duration of the notes are given on the right hand side. The musical notes can be generated as square waveforms of specific frequencies. To generate silence, write the zero bit to the port pin P0.7. These can be generated and output using the speaker with appropriate interfacing. Table 1: Note frequencies, sequence and durations. S. No. Note Frequency (in Hertz) 1 N1 220 2 N2 247 3 N3 294 4 N4 370 5 N5 330 Order Note Duration (ms) 1 N1 750 2 N2 750 3 N3 750 4 N2 750 5 N4 1000 6 Silence 500 7 N4 1000 8 N5 1000 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 pin P0.7. Generate the notes shown on the right hand side in Table 1 using the durations mentioned. 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. During this period, the text “ROLLING TIME” must be displayed on the LCD. 3. Shoot a 30 second video of your kit playing the notes. Make sure your face appears at the beginning of the video. The video needs to be uploaded using the Video upload link for lab 7 assignment in the course team on MS Teams (it has an option to attach files). The file size cannot exceed 200 MB.
  • 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. 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. Keep the long reaction time to below 30 seconds to avoid wrap around. 2. For question 2, check the appropriate waveforms on the logic analyzer (Keil). Also ask them to play out the notes on the speaker.