SlideShare ist ein Scribd-Unternehmen logo
1 von 3
Downloaden Sie, um offline zu lesen
Lab 3: 20 points
EE 337: Microprocessors Laboratory (Spring 2023)
Indian Institute of Technology Bombay
Date: January 19, 2023
1. [8 points] In order to convert an analog signal to a digital signal, the 3 steps to be
followed are sampling, quantization and encoding. Assume that a sampled signal
(consisting of 8 samples in the range 0 to 40) is present. Write an assembly code to
quantize the signal into 4 discrete levels. Follow the below scheme.
if (sample >= 0 and sample < 10):
output 5
else if (sample >= 10 and sample < 20):
output 15
else if (sample >= 20 and sample < 30):
output 25
else:
output 35
(Note that these values are given in decimal. You need to use equivalent hexadecimal
values in your code)
// -- DO NOT CHANGE ANYTHING UNTIL THE **** LINE--//
ORG 0H
LJMP MAIN
ORG 100H
MAIN:
CALL QUANT
HERE: SJMP HERE
ORG 130H
// *****************
QUANT:
// ADD YOUR CODE HERE
RET
END
• The inputs samples should be present in locations 60H to 67H.
• The quantized output samples should be present in memory locations 70H to
77H.
• To reduce the effort involved in adding multiple items in memory locations, you
can use the command window in Keil. Refer to Lab-2 lab-sheet.
TA Checkpoint 1
Check the following cases:
• Input samples : 11H, 2AH, 01H, 3FH, 18H, 1CH, 0EH, 06H.
Output samples : 0FH, 23H, 05H, 23H, 19H, 19H, 0FH, 05H.
• Input samples : 00H, 09H, 0AH, 13H, 14H, 1DH, 1EH, FFH.
Output samples : 05H, 05H, 0FH, 0FH, 19H, 19H, 23H, 23H.
2. [8 points] Moving Average Filter is used in Signal Processing and Data Analysis to
smooth out high frequency noise and short-term fluctuations. Write an assembly
language program to implement a 4-point Moving Average Filter on an input signal
consisting of 8 samples.
The formula for output signal is provided-
y[n] =
x[n] + x[n − 1] + x[n − 2] + x[n − 3]
4
Assume that x[−1], x[−2] and x[−3] are equal to 0.
// -- DO NOT CHANGE ANYTHING UNTIL THE **** LINE--//
ORG 0H
LJMP MAIN
ORG 100H
MAIN:
CALL FILT
HERE: SJMP HERE
ORG 130H
// *****************
FILT:
// ADD YOUR CODE HERE
RET
END
• The input signal x[n] samples must be stored in memory locations 60H to 67H.
• The output signal y[n] samples must be stored in memory locations 70H to 77H.
• To reduce the effort involved in adding multiple items in memory locations, you
can use the command window in Keil. Refer to Lab-2 lab-sheet.
• You can assume that the addition result never crosses 8 bits (i.e there is no
overflow and each operation can be done in a single instruction).
TA Checkpoint 2
Check the following cases:
• Input samples : 04H, 24H, 38H, 11H, 3AH, 2BH, 0EH, 69H.
Output samples : 01H, 0AH, 18H, 1CH, 29H, 2BH, 21H, 37H.
• Input samples : 56H, 1AH, 33H, 4DH, 46H, 02H, 4EH, 56H.
Output samples : 15H, 1CH, 28H, 3CH, 38H, 32H, 38H, 3BH.
3. [4 points] This will be an in-lab experiment, you will be demonstrating that your
PT-51 kit works by running the test code for the kit. The test code also checks the
peripherals on the kit. Using this, you can also verify that all required software is
correctly installed. Before coming to the lab please install the softwares mentioned
below and go through the slide decks to get familiarize with the board.
• Get familiar with PT-51 kit by going through the slides here: User Manual
• Install FLIP (on Windows) or DFU Programmer (on Linux/Mac). This software
is used to load programs into the 8051 microcontroller on the PT-51 kit. The
steps are here: FLIP/DFU Installations
In the in-lab session, verify the following in front of your TAs.
• The procedure to load a hex file onto the PT-51 kit using Flip is shown in the
video given here: Running a Hex file on Pt-51
Follow the procedure and load the led.hex file to see that the LEDs on your
kit toggle.
• Download the file pt51 test.hex and load it on your PT-51 kit, as described
here: Testing the peripherals of Pt-51
• Follow the steps in the slide deck titled “PT-51 Test Program” to do the self-test
of the kit. Check if all tests run successfully. If there are failed tests, inform
your respective TA.
• Please use the installation given here JRE Installer if you are not able to find
JRE or the installation with JRE fails.
• Please put your board in boot mode before installing drivers and flashing code.
Detach → Press boot → Press Reset → Release Reset → Release Boot → Attach

Weitere ähnliche Inhalte

Ähnlich wie EE337 Spring 2023 Lab3

Ecet 330 Enthusiastic Study / snaptutorial.com
Ecet 330 Enthusiastic Study / snaptutorial.comEcet 330 Enthusiastic Study / snaptutorial.com
Ecet 330 Enthusiastic Study / snaptutorial.comStephenson033
 
ECET 330 Technology levels--snaptutorial.com
ECET 330 Technology levels--snaptutorial.comECET 330 Technology levels--snaptutorial.com
ECET 330 Technology levels--snaptutorial.comsholingarjosh102
 
Lab 1 reference manual
Lab 1 reference manualLab 1 reference manual
Lab 1 reference manualtrayyoo
 
Labqazwsxedcrfvtgbyhnujmqazwsxedcrfvtgbyhnujmqazwsx.pptx
Labqazwsxedcrfvtgbyhnujmqazwsxedcrfvtgbyhnujmqazwsx.pptxLabqazwsxedcrfvtgbyhnujmqazwsxedcrfvtgbyhnujmqazwsx.pptx
Labqazwsxedcrfvtgbyhnujmqazwsxedcrfvtgbyhnujmqazwsx.pptxMostafaKhaled78
 
NIE2206 Electronic LogbookNamexxxStudent IDUxxxTe.docx
NIE2206 Electronic LogbookNamexxxStudent IDUxxxTe.docxNIE2206 Electronic LogbookNamexxxStudent IDUxxxTe.docx
NIE2206 Electronic LogbookNamexxxStudent IDUxxxTe.docxcurwenmichaela
 
Debugger & Profiler in NetBeans
Debugger & Profiler in NetBeansDebugger & Profiler in NetBeans
Debugger & Profiler in NetBeansHuu Bang Le Phan
 
Unit 2 Unit level testing.ppt
Unit 2 Unit level testing.pptUnit 2 Unit level testing.ppt
Unit 2 Unit level testing.pptPerfectMe2
 
Instructions 3-5 pages double space research paper about Eric Sc.docx
Instructions 3-5 pages double space research paper about Eric Sc.docxInstructions 3-5 pages double space research paper about Eric Sc.docx
Instructions 3-5 pages double space research paper about Eric Sc.docxnormanibarber20063
 
AdaCore Paris Tech Day 2016: Eric Perlade - Verification Solutions
AdaCore Paris Tech Day 2016: Eric Perlade - Verification SolutionsAdaCore Paris Tech Day 2016: Eric Perlade - Verification Solutions
AdaCore Paris Tech Day 2016: Eric Perlade - Verification Solutionsjamieayre
 
Understand and Harness the Capabilities of Intel® Xeon Phi™ Processors
Understand and Harness the Capabilities of Intel® Xeon Phi™ ProcessorsUnderstand and Harness the Capabilities of Intel® Xeon Phi™ Processors
Understand and Harness the Capabilities of Intel® Xeon Phi™ ProcessorsIntel® Software
 

Ähnlich wie EE337 Spring 2023 Lab3 (20)

Ecet 330 Enthusiastic Study / snaptutorial.com
Ecet 330 Enthusiastic Study / snaptutorial.comEcet 330 Enthusiastic Study / snaptutorial.com
Ecet 330 Enthusiastic Study / snaptutorial.com
 
ECET 330 Technology levels--snaptutorial.com
ECET 330 Technology levels--snaptutorial.comECET 330 Technology levels--snaptutorial.com
ECET 330 Technology levels--snaptutorial.com
 
Lab 1 reference manual
Lab 1 reference manualLab 1 reference manual
Lab 1 reference manual
 
Introduction to Microcontrollers
Introduction to MicrocontrollersIntroduction to Microcontrollers
Introduction to Microcontrollers
 
embedded system and AVR
embedded system and AVRembedded system and AVR
embedded system and AVR
 
Labqazwsxedcrfvtgbyhnujmqazwsxedcrfvtgbyhnujmqazwsx.pptx
Labqazwsxedcrfvtgbyhnujmqazwsxedcrfvtgbyhnujmqazwsx.pptxLabqazwsxedcrfvtgbyhnujmqazwsxedcrfvtgbyhnujmqazwsx.pptx
Labqazwsxedcrfvtgbyhnujmqazwsxedcrfvtgbyhnujmqazwsx.pptx
 
Microprocessor lab manual
Microprocessor lab manualMicroprocessor lab manual
Microprocessor lab manual
 
Timers and Endge-aligned PWM
Timers and Endge-aligned PWMTimers and Endge-aligned PWM
Timers and Endge-aligned PWM
 
NIE2206 Electronic LogbookNamexxxStudent IDUxxxTe.docx
NIE2206 Electronic LogbookNamexxxStudent IDUxxxTe.docxNIE2206 Electronic LogbookNamexxxStudent IDUxxxTe.docx
NIE2206 Electronic LogbookNamexxxStudent IDUxxxTe.docx
 
Debugger & Profiler in NetBeans
Debugger & Profiler in NetBeansDebugger & Profiler in NetBeans
Debugger & Profiler in NetBeans
 
Unit 2 Unit level testing.ppt
Unit 2 Unit level testing.pptUnit 2 Unit level testing.ppt
Unit 2 Unit level testing.ppt
 
Instructions 3-5 pages double space research paper about Eric Sc.docx
Instructions 3-5 pages double space research paper about Eric Sc.docxInstructions 3-5 pages double space research paper about Eric Sc.docx
Instructions 3-5 pages double space research paper about Eric Sc.docx
 
Lab Manual.pdf
Lab Manual.pdfLab Manual.pdf
Lab Manual.pdf
 
Allen Bradley- Micrologix PLC Instructions
Allen Bradley- Micrologix PLC InstructionsAllen Bradley- Micrologix PLC Instructions
Allen Bradley- Micrologix PLC Instructions
 
AdaCore Paris Tech Day 2016: Eric Perlade - Verification Solutions
AdaCore Paris Tech Day 2016: Eric Perlade - Verification SolutionsAdaCore Paris Tech Day 2016: Eric Perlade - Verification Solutions
AdaCore Paris Tech Day 2016: Eric Perlade - Verification Solutions
 
Understand and Harness the Capabilities of Intel® Xeon Phi™ Processors
Understand and Harness the Capabilities of Intel® Xeon Phi™ ProcessorsUnderstand and Harness the Capabilities of Intel® Xeon Phi™ Processors
Understand and Harness the Capabilities of Intel® Xeon Phi™ Processors
 
Switch Control and Time Delay - Keypad
Switch Control and Time Delay - KeypadSwitch Control and Time Delay - Keypad
Switch Control and Time Delay - Keypad
 
L1
L1L1
L1
 
Dsp lab manual 15 11-2016
Dsp lab manual 15 11-2016Dsp lab manual 15 11-2016
Dsp lab manual 15 11-2016
 
DSP_Assign_1
DSP_Assign_1DSP_Assign_1
DSP_Assign_1
 

Mehr von SaravananVijayakumar4

EE337 Microprocessors Lab Labsheet 5
EE337 Microprocessors Lab Labsheet 5EE337 Microprocessors Lab Labsheet 5
EE337 Microprocessors Lab Labsheet 5SaravananVijayakumar4
 
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
 
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
 
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
 
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
 

Mehr von SaravananVijayakumar4 (20)

EE337 Microprocessors Lab Labsheet 5
EE337 Microprocessors Lab Labsheet 5EE337 Microprocessors Lab Labsheet 5
EE337 Microprocessors Lab Labsheet 5
 
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 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)
 
Intel Hex Format
Intel Hex FormatIntel Hex Format
Intel Hex Format
 
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
 
Serial IO for 8051
Serial IO for 8051Serial IO for 8051
Serial IO for 8051
 
8051 Timers
8051 Timers8051 Timers
8051 Timers
 
8051 Interrupts
8051 Interrupts8051 Interrupts
8051 Interrupts
 
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

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
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
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
 
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
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
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
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 

Kürzlich hochgeladen (20)

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 ...
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
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
 
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
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
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
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 

EE337 Spring 2023 Lab3

  • 1. Lab 3: 20 points EE 337: Microprocessors Laboratory (Spring 2023) Indian Institute of Technology Bombay Date: January 19, 2023 1. [8 points] In order to convert an analog signal to a digital signal, the 3 steps to be followed are sampling, quantization and encoding. Assume that a sampled signal (consisting of 8 samples in the range 0 to 40) is present. Write an assembly code to quantize the signal into 4 discrete levels. Follow the below scheme. if (sample >= 0 and sample < 10): output 5 else if (sample >= 10 and sample < 20): output 15 else if (sample >= 20 and sample < 30): output 25 else: output 35 (Note that these values are given in decimal. You need to use equivalent hexadecimal values in your code) // -- DO NOT CHANGE ANYTHING UNTIL THE **** LINE--// ORG 0H LJMP MAIN ORG 100H MAIN: CALL QUANT HERE: SJMP HERE ORG 130H // ***************** QUANT: // ADD YOUR CODE HERE RET END • The inputs samples should be present in locations 60H to 67H. • The quantized output samples should be present in memory locations 70H to 77H. • To reduce the effort involved in adding multiple items in memory locations, you can use the command window in Keil. Refer to Lab-2 lab-sheet. TA Checkpoint 1 Check the following cases: • Input samples : 11H, 2AH, 01H, 3FH, 18H, 1CH, 0EH, 06H. Output samples : 0FH, 23H, 05H, 23H, 19H, 19H, 0FH, 05H. • Input samples : 00H, 09H, 0AH, 13H, 14H, 1DH, 1EH, FFH. Output samples : 05H, 05H, 0FH, 0FH, 19H, 19H, 23H, 23H.
  • 2. 2. [8 points] Moving Average Filter is used in Signal Processing and Data Analysis to smooth out high frequency noise and short-term fluctuations. Write an assembly language program to implement a 4-point Moving Average Filter on an input signal consisting of 8 samples. The formula for output signal is provided- y[n] = x[n] + x[n − 1] + x[n − 2] + x[n − 3] 4 Assume that x[−1], x[−2] and x[−3] are equal to 0. // -- DO NOT CHANGE ANYTHING UNTIL THE **** LINE--// ORG 0H LJMP MAIN ORG 100H MAIN: CALL FILT HERE: SJMP HERE ORG 130H // ***************** FILT: // ADD YOUR CODE HERE RET END • The input signal x[n] samples must be stored in memory locations 60H to 67H. • The output signal y[n] samples must be stored in memory locations 70H to 77H. • To reduce the effort involved in adding multiple items in memory locations, you can use the command window in Keil. Refer to Lab-2 lab-sheet. • You can assume that the addition result never crosses 8 bits (i.e there is no overflow and each operation can be done in a single instruction). TA Checkpoint 2 Check the following cases: • Input samples : 04H, 24H, 38H, 11H, 3AH, 2BH, 0EH, 69H. Output samples : 01H, 0AH, 18H, 1CH, 29H, 2BH, 21H, 37H. • Input samples : 56H, 1AH, 33H, 4DH, 46H, 02H, 4EH, 56H. Output samples : 15H, 1CH, 28H, 3CH, 38H, 32H, 38H, 3BH.
  • 3. 3. [4 points] This will be an in-lab experiment, you will be demonstrating that your PT-51 kit works by running the test code for the kit. The test code also checks the peripherals on the kit. Using this, you can also verify that all required software is correctly installed. Before coming to the lab please install the softwares mentioned below and go through the slide decks to get familiarize with the board. • Get familiar with PT-51 kit by going through the slides here: User Manual • Install FLIP (on Windows) or DFU Programmer (on Linux/Mac). This software is used to load programs into the 8051 microcontroller on the PT-51 kit. The steps are here: FLIP/DFU Installations In the in-lab session, verify the following in front of your TAs. • The procedure to load a hex file onto the PT-51 kit using Flip is shown in the video given here: Running a Hex file on Pt-51 Follow the procedure and load the led.hex file to see that the LEDs on your kit toggle. • Download the file pt51 test.hex and load it on your PT-51 kit, as described here: Testing the peripherals of Pt-51 • Follow the steps in the slide deck titled “PT-51 Test Program” to do the self-test of the kit. Check if all tests run successfully. If there are failed tests, inform your respective TA. • Please use the installation given here JRE Installer if you are not able to find JRE or the installation with JRE fails. • Please put your board in boot mode before installing drivers and flashing code. Detach → Press boot → Press Reset → Release Reset → Release Boot → Attach