SlideShare a Scribd company logo
1 of 2
Download to read offline
Lab 9: 20 points
EE 337: Microprocessors Laboratory (Spring 2022)
Indian Institute of Technology Bombay
Date: March 22, 2022
Refer to Prof. Dinesh Sharma’s slides and notes on serial peripheral interface (SPI) to do
this lab. See https://ee337.github.io/dks.html#serial-io
1. [20 points] In this lab session, you will use the serial port interface (SPI) to interface an
analog-to-digital converter (ADC) MCP3008 with the 8051 micro-controller. The MCP3008
is part of the lab kit. You will use this setup to measure temperature using an LM35 sensor,
which is also part of the lab kit.
Use the given main.c, spi.c, mcp3008.h and lcd.h to complete this lab. Make sure that
all the DIP switches are OFF..
i) The micro-controller is to be configured for serial communication with the ADC
MCP3008. Complete the function spi init in spi.c to configure the SPI so that
the microcontroller is the master and the ADC is the slave.
ii) You will next test the ADC setup using a potential divider circuit (series of resistors
provided in the kit can be connected between supply and ground terminals) as shown
in Fig 1. By varying the point at which the output is taken, voltages ranging from 0 to
3.3 volts can be obtained as output. As shown this output is connected to CH4 of the
ADC. By compiling the project and running the code on the Pt-51 kit, the measured
output voltage will be displayed on the LCD in the format shown.
Volt.: 03229 mV
Verify that the displayed voltage corresponds to the potential divider circuit’s resistor
values.
Figure 1: Pt51 interfacing with ADC and potential divider.
iii) Once the ADC setup is verified using the potential divider circuit, it can be used for
sensing and displaying the temperature in ◦C. Connect the sensor output to CH3 of the
ADC as shown in Fig. 2. This setup measures the voltage output from the sensor and
displays the measured room temperature on the LCD. The output provided by the
sensor is 10mV/◦C . Uncomment and update the relevant sections in main.c, compile
the code and run it on the Pt51 kit. The room temperature will be displayed on the
second row of the LCD as shown. Verify that this value matches approximately your
room temperature. The first row will continue to display the voltage corresponding to
the potential divider circuit’s output.
Volt.: 03229 mV
Temp.: xxx.x oC
Figure 2: Pt51 interfacing with ADC and temperature sensor.
TA Checkpoints
1. Verify that the student can demonstrate the SPI setup to measure the output of the
potential divider circuit.
2. Verify that the student can demonstrate the SPI setup to measure the room temperature.

More Related Content

Similar to Lab9 of EE337 Microprocessors Lab, 2022, IIT Bombay

ENG3104 Engineering Simulations and Computations Semester 2, 2.docx
ENG3104 Engineering Simulations and Computations Semester 2, 2.docxENG3104 Engineering Simulations and Computations Semester 2, 2.docx
ENG3104 Engineering Simulations and Computations Semester 2, 2.docxYASHU40
 
IMPLEMENTING A DIGITAL MULTIMETER
IMPLEMENTING A DIGITAL MULTIMETERIMPLEMENTING A DIGITAL MULTIMETER
IMPLEMENTING A DIGITAL MULTIMETERVijay Elavunkal
 
Simulation of 3 bit Flash ADC in 0.18μmTechnology using NG SPICE Tool for Hig...
Simulation of 3 bit Flash ADC in 0.18μmTechnology using NG SPICE Tool for Hig...Simulation of 3 bit Flash ADC in 0.18μmTechnology using NG SPICE Tool for Hig...
Simulation of 3 bit Flash ADC in 0.18μmTechnology using NG SPICE Tool for Hig...ijsrd.com
 
Electical Power Subsystem _CDR.pptx
Electical Power Subsystem _CDR.pptxElectical Power Subsystem _CDR.pptx
Electical Power Subsystem _CDR.pptxAldi Walai
 
ELE2303 Assign 1 Page 1 ELE2303 Embedded Systems Design.docx
ELE2303 Assign 1  Page  1 ELE2303 Embedded Systems Design.docxELE2303 Assign 1  Page  1 ELE2303 Embedded Systems Design.docx
ELE2303 Assign 1 Page 1 ELE2303 Embedded Systems Design.docxjack60216
 
Aircraft master warning system with ftc prompting
Aircraft master warning system with ftc promptingAircraft master warning system with ftc prompting
Aircraft master warning system with ftc promptingSudhanshu Janwadkar
 
TRANSFORMER FAULT DETECTION AND MONITORING
TRANSFORMER FAULT DETECTION AND MONITORINGTRANSFORMER FAULT DETECTION AND MONITORING
TRANSFORMER FAULT DETECTION AND MONITORINGIRJET Journal
 
FPGA Implementation with Digital Devices
FPGA Implementation with Digital Devices FPGA Implementation with Digital Devices
FPGA Implementation with Digital Devices Sachin Mehta
 
HOME AUTOMATION SYSTEM DESIGN USING ROUND ROBIN SCHEDULING ALGORITHM
HOME AUTOMATION SYSTEM DESIGN USING ROUND ROBIN SCHEDULING ALGORITHMHOME AUTOMATION SYSTEM DESIGN USING ROUND ROBIN SCHEDULING ALGORITHM
HOME AUTOMATION SYSTEM DESIGN USING ROUND ROBIN SCHEDULING ALGORITHMIRJET Journal
 
NodeMCU-LabActivity1.pdf
NodeMCU-LabActivity1.pdfNodeMCU-LabActivity1.pdf
NodeMCU-LabActivity1.pdfAkshat958063
 
Study and Development of Temperature & Humidity monitoring system through Wir...
Study and Development of Temperature & Humidity monitoring system through Wir...Study and Development of Temperature & Humidity monitoring system through Wir...
Study and Development of Temperature & Humidity monitoring system through Wir...IJERA Editor
 
Automated Air Cooled Three Level Inverter system using Arduino
Automated Air Cooled Three Level Inverter system using ArduinoAutomated Air Cooled Three Level Inverter system using Arduino
Automated Air Cooled Three Level Inverter system using ArduinoIJEEE
 
Real-Time Monitoring and Control System for Industry
Real-Time Monitoring and Control System for IndustryReal-Time Monitoring and Control System for Industry
Real-Time Monitoring and Control System for Industryijsrd.com
 

Similar to Lab9 of EE337 Microprocessors Lab, 2022, IIT Bombay (20)

Lab8 s2
Lab8 s2Lab8 s2
Lab8 s2
 
Lab8 s1
Lab8 s1Lab8 s1
Lab8 s1
 
ENG3104 Engineering Simulations and Computations Semester 2, 2.docx
ENG3104 Engineering Simulations and Computations Semester 2, 2.docxENG3104 Engineering Simulations and Computations Semester 2, 2.docx
ENG3104 Engineering Simulations and Computations Semester 2, 2.docx
 
510 277-283
510 277-283510 277-283
510 277-283
 
Lab burner
Lab burnerLab burner
Lab burner
 
IMPLEMENTING A DIGITAL MULTIMETER
IMPLEMENTING A DIGITAL MULTIMETERIMPLEMENTING A DIGITAL MULTIMETER
IMPLEMENTING A DIGITAL MULTIMETER
 
Simulation of 3 bit Flash ADC in 0.18μmTechnology using NG SPICE Tool for Hig...
Simulation of 3 bit Flash ADC in 0.18μmTechnology using NG SPICE Tool for Hig...Simulation of 3 bit Flash ADC in 0.18μmTechnology using NG SPICE Tool for Hig...
Simulation of 3 bit Flash ADC in 0.18μmTechnology using NG SPICE Tool for Hig...
 
Electical Power Subsystem _CDR.pptx
Electical Power Subsystem _CDR.pptxElectical Power Subsystem _CDR.pptx
Electical Power Subsystem _CDR.pptx
 
ELE2303 Assign 1 Page 1 ELE2303 Embedded Systems Design.docx
ELE2303 Assign 1  Page  1 ELE2303 Embedded Systems Design.docxELE2303 Assign 1  Page  1 ELE2303 Embedded Systems Design.docx
ELE2303 Assign 1 Page 1 ELE2303 Embedded Systems Design.docx
 
Aircraft master warning system with ftc prompting
Aircraft master warning system with ftc promptingAircraft master warning system with ftc prompting
Aircraft master warning system with ftc prompting
 
TRANSFORMER FAULT DETECTION AND MONITORING
TRANSFORMER FAULT DETECTION AND MONITORINGTRANSFORMER FAULT DETECTION AND MONITORING
TRANSFORMER FAULT DETECTION AND MONITORING
 
FPGA Implementation with Digital Devices
FPGA Implementation with Digital Devices FPGA Implementation with Digital Devices
FPGA Implementation with Digital Devices
 
Nsac l2 r1-adc-servos_battery
Nsac l2 r1-adc-servos_batteryNsac l2 r1-adc-servos_battery
Nsac l2 r1-adc-servos_battery
 
HOME AUTOMATION SYSTEM DESIGN USING ROUND ROBIN SCHEDULING ALGORITHM
HOME AUTOMATION SYSTEM DESIGN USING ROUND ROBIN SCHEDULING ALGORITHMHOME AUTOMATION SYSTEM DESIGN USING ROUND ROBIN SCHEDULING ALGORITHM
HOME AUTOMATION SYSTEM DESIGN USING ROUND ROBIN SCHEDULING ALGORITHM
 
NodeMCU-LabActivity1.pdf
NodeMCU-LabActivity1.pdfNodeMCU-LabActivity1.pdf
NodeMCU-LabActivity1.pdf
 
Study and Development of Temperature & Humidity monitoring system through Wir...
Study and Development of Temperature & Humidity monitoring system through Wir...Study and Development of Temperature & Humidity monitoring system through Wir...
Study and Development of Temperature & Humidity monitoring system through Wir...
 
Automated Air Cooled Three Level Inverter system using Arduino
Automated Air Cooled Three Level Inverter system using ArduinoAutomated Air Cooled Three Level Inverter system using Arduino
Automated Air Cooled Three Level Inverter system using Arduino
 
Bds lab 4
Bds lab 4Bds lab 4
Bds lab 4
 
Real-Time Monitoring and Control System for Industry
Real-Time Monitoring and Control System for IndustryReal-Time Monitoring and Control System for Industry
Real-Time Monitoring and Control System for Industry
 
publish manual
publish manualpublish manual
publish manual
 

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

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

Recently uploaded

Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
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
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
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
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
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
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
“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
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
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
 

Recently uploaded (20)

Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
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
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
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
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
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
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
“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...
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
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🔝
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 

Lab9 of EE337 Microprocessors Lab, 2022, IIT Bombay

  • 1. Lab 9: 20 points EE 337: Microprocessors Laboratory (Spring 2022) Indian Institute of Technology Bombay Date: March 22, 2022 Refer to Prof. Dinesh Sharma’s slides and notes on serial peripheral interface (SPI) to do this lab. See https://ee337.github.io/dks.html#serial-io 1. [20 points] In this lab session, you will use the serial port interface (SPI) to interface an analog-to-digital converter (ADC) MCP3008 with the 8051 micro-controller. The MCP3008 is part of the lab kit. You will use this setup to measure temperature using an LM35 sensor, which is also part of the lab kit. Use the given main.c, spi.c, mcp3008.h and lcd.h to complete this lab. Make sure that all the DIP switches are OFF.. i) The micro-controller is to be configured for serial communication with the ADC MCP3008. Complete the function spi init in spi.c to configure the SPI so that the microcontroller is the master and the ADC is the slave. ii) You will next test the ADC setup using a potential divider circuit (series of resistors provided in the kit can be connected between supply and ground terminals) as shown in Fig 1. By varying the point at which the output is taken, voltages ranging from 0 to 3.3 volts can be obtained as output. As shown this output is connected to CH4 of the ADC. By compiling the project and running the code on the Pt-51 kit, the measured output voltage will be displayed on the LCD in the format shown. Volt.: 03229 mV Verify that the displayed voltage corresponds to the potential divider circuit’s resistor values. Figure 1: Pt51 interfacing with ADC and potential divider. iii) Once the ADC setup is verified using the potential divider circuit, it can be used for sensing and displaying the temperature in ◦C. Connect the sensor output to CH3 of the ADC as shown in Fig. 2. This setup measures the voltage output from the sensor and displays the measured room temperature on the LCD. The output provided by the sensor is 10mV/◦C . Uncomment and update the relevant sections in main.c, compile the code and run it on the Pt51 kit. The room temperature will be displayed on the second row of the LCD as shown. Verify that this value matches approximately your room temperature. The first row will continue to display the voltage corresponding to the potential divider circuit’s output.
  • 2. Volt.: 03229 mV Temp.: xxx.x oC Figure 2: Pt51 interfacing with ADC and temperature sensor. TA Checkpoints 1. Verify that the student can demonstrate the SPI setup to measure the output of the potential divider circuit. 2. Verify that the student can demonstrate the SPI setup to measure the room temperature.