SlideShare a Scribd company logo
1 of 2
Download to read offline
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.

More Related Content

What's hot (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
 

Similar to 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
 
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
 
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/Snaptutorial ECET 105 help A Guide to career/Snaptutorial
ECET 105 help A Guide to career/Snaptutorialpinck243
 
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
 

Similar to 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/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/SnaptutorialECET 105 help A Guide to career/Snaptutorial
ECET 105 help A Guide to career/Snaptutorial
 

More from SaravananVijayakumar4

More from 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
 

Recently uploaded

Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
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
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
“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
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
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
 

Recently uploaded (20)

Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
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
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
“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...
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
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
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 

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.