SlideShare a Scribd company logo
1 of 2
Download to read offline
Lab 8: 20 points
EE 337: Microprocessors Laboratory (Spring 2021)
Section: S1 (Second year UG)
Indian Institute of Technology Bombay
Date: March 23, 2021
Refer to Prof. Dinesh Sharma’s slides and notes on serial peripheral interface (SPI) to do
this lab.
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.
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 CH0 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 CH7 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

What's hot

Pt 51 kit - Peripheral self-test
Pt 51 kit - Peripheral self-testPt 51 kit - Peripheral self-test
Pt 51 kit - Peripheral self-testrajbabureliance
 
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
 
Node finder presentation
Node finder presentationNode finder presentation
Node finder presentationVarun Varshney
 
Temperature sensor with raspberry pi
Temperature sensor with raspberry piTemperature sensor with raspberry pi
Temperature sensor with raspberry piSantosh Kumar Kar
 
Pir motion sensor with raspberry pi
Pir motion sensor with raspberry piPir motion sensor with raspberry pi
Pir motion sensor with raspberry piSantosh Kumar Kar
 
Ecet 340 Teaching Effectively--tutorialrank.com
Ecet 340 Teaching Effectively--tutorialrank.comEcet 340 Teaching Effectively--tutorialrank.com
Ecet 340 Teaching Effectively--tutorialrank.comSoaps97
 
Csa ic
Csa icCsa ic
Csa icPCTE
 
ControlLogix Timers FA16
ControlLogix Timers FA16ControlLogix Timers FA16
ControlLogix Timers FA16John Todora
 
Certifying (RISC) Machine Code Safe from Aliasing (OpenCert 2013)
Certifying (RISC) Machine Code Safe from Aliasing  (OpenCert 2013)Certifying (RISC) Machine Code Safe from Aliasing  (OpenCert 2013)
Certifying (RISC) Machine Code Safe from Aliasing (OpenCert 2013)Peter Breuer
 
Digital clock (mod counters)using DSCH (DIGITAL SCHEMATIC) by Gaurav Raikar
Digital clock (mod counters)using DSCH (DIGITAL SCHEMATIC) by Gaurav RaikarDigital clock (mod counters)using DSCH (DIGITAL SCHEMATIC) by Gaurav Raikar
Digital clock (mod counters)using DSCH (DIGITAL SCHEMATIC) by Gaurav RaikarGauravRaikar3
 

What's hot (18)

Lab7 s2
Lab7 s2Lab7 s2
Lab7 s2
 
Lab3 s1
Lab3 s1Lab3 s1
Lab3 s1
 
Pt 51 kit - Peripheral self-test
Pt 51 kit - Peripheral self-testPt 51 kit - Peripheral self-test
Pt 51 kit - Peripheral self-test
 
8051 Interrupts
8051 Interrupts8051 Interrupts
8051 Interrupts
 
8051 Timers
8051 Timers8051 Timers
8051 Timers
 
Jp
Jp Jp
Jp
 
Lab5 s1
Lab5 s1Lab5 s1
Lab5 s1
 
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...
 
Serial IO for 8051
Serial IO for 8051Serial IO for 8051
Serial IO for 8051
 
Intel Hex Format
Intel Hex FormatIntel Hex Format
Intel Hex Format
 
Node finder presentation
Node finder presentationNode finder presentation
Node finder presentation
 
Temperature sensor with raspberry pi
Temperature sensor with raspberry piTemperature sensor with raspberry pi
Temperature sensor with raspberry pi
 
Pir motion sensor with raspberry pi
Pir motion sensor with raspberry piPir motion sensor with raspberry pi
Pir motion sensor with raspberry pi
 
Ecet 340 Teaching Effectively--tutorialrank.com
Ecet 340 Teaching Effectively--tutorialrank.comEcet 340 Teaching Effectively--tutorialrank.com
Ecet 340 Teaching Effectively--tutorialrank.com
 
Csa ic
Csa icCsa ic
Csa ic
 
ControlLogix Timers FA16
ControlLogix Timers FA16ControlLogix Timers FA16
ControlLogix Timers FA16
 
Certifying (RISC) Machine Code Safe from Aliasing (OpenCert 2013)
Certifying (RISC) Machine Code Safe from Aliasing  (OpenCert 2013)Certifying (RISC) Machine Code Safe from Aliasing  (OpenCert 2013)
Certifying (RISC) Machine Code Safe from Aliasing (OpenCert 2013)
 
Digital clock (mod counters)using DSCH (DIGITAL SCHEMATIC) by Gaurav Raikar
Digital clock (mod counters)using DSCH (DIGITAL SCHEMATIC) by Gaurav RaikarDigital clock (mod counters)using DSCH (DIGITAL SCHEMATIC) by Gaurav Raikar
Digital clock (mod counters)using DSCH (DIGITAL SCHEMATIC) by Gaurav Raikar
 

Similar to 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.docxYASHU40
 
IMPLEMENTING A DIGITAL MULTIMETER
IMPLEMENTING A DIGITAL MULTIMETERIMPLEMENTING A DIGITAL MULTIMETER
IMPLEMENTING A DIGITAL MULTIMETERVijay Elavunkal
 
Electical Power Subsystem _CDR.pptx
Electical Power Subsystem _CDR.pptxElectical Power Subsystem _CDR.pptx
Electical Power Subsystem _CDR.pptxAldi Walai
 
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
 
FPGA Implementation with Digital Devices
FPGA Implementation with Digital Devices FPGA Implementation with Digital Devices
FPGA Implementation with Digital Devices Sachin Mehta
 
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
 
IJSRED-V2I5P32
IJSRED-V2I5P32IJSRED-V2I5P32
IJSRED-V2I5P32IJSRED
 
TRANSFORMER FAULT DETECTION AND MONITORING
TRANSFORMER FAULT DETECTION AND MONITORINGTRANSFORMER FAULT DETECTION AND MONITORING
TRANSFORMER FAULT DETECTION AND MONITORINGIRJET Journal
 
Dynometer project data acquisition filtering
Dynometer project data acquisition filteringDynometer project data acquisition filtering
Dynometer project data acquisition filteringRa'uf Tailony
 
project - Copy
project - Copyproject - Copy
project - Copypiedaholic
 
Electric Circuits Lab Series RC Circuits Phase Angle, Phase Lag.docx
Electric Circuits Lab Series RC Circuits Phase Angle, Phase Lag.docxElectric Circuits Lab Series RC Circuits Phase Angle, Phase Lag.docx
Electric Circuits Lab Series RC Circuits Phase Angle, Phase Lag.docxpauline234567
 
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
 
Temperature Controlled Fan Report
Temperature Controlled Fan ReportTemperature Controlled Fan Report
Temperature Controlled Fan ReportPeeyush Pashine
 
Beme lab-manual new (3) (1)2323
Beme lab-manual new (3) (1)2323Beme lab-manual new (3) (1)2323
Beme lab-manual new (3) (1)2323ptv
 
PWM Step-down Converter(NJM2309)
PWM Step-down Converter(NJM2309)PWM Step-down Converter(NJM2309)
PWM Step-down Converter(NJM2309)Tsuyoshi Horigome
 

Similar to Lab8 s1 (20)

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
 
IMPLEMENTING A DIGITAL MULTIMETER
IMPLEMENTING A DIGITAL MULTIMETERIMPLEMENTING A DIGITAL MULTIMETER
IMPLEMENTING A DIGITAL MULTIMETER
 
Electical Power Subsystem _CDR.pptx
Electical Power Subsystem _CDR.pptxElectical Power Subsystem _CDR.pptx
Electical Power Subsystem _CDR.pptx
 
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...
 
510 277-283
510 277-283510 277-283
510 277-283
 
FPGA Implementation with Digital Devices
FPGA Implementation with Digital Devices FPGA Implementation with Digital Devices
FPGA Implementation with Digital Devices
 
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
 
506 267-276
506 267-276506 267-276
506 267-276
 
IJSRED-V2I5P32
IJSRED-V2I5P32IJSRED-V2I5P32
IJSRED-V2I5P32
 
lesson2.ppsx
lesson2.ppsxlesson2.ppsx
lesson2.ppsx
 
Lab burner
Lab burnerLab burner
Lab burner
 
TRANSFORMER FAULT DETECTION AND MONITORING
TRANSFORMER FAULT DETECTION AND MONITORINGTRANSFORMER FAULT DETECTION AND MONITORING
TRANSFORMER FAULT DETECTION AND MONITORING
 
Dynometer project data acquisition filtering
Dynometer project data acquisition filteringDynometer project data acquisition filtering
Dynometer project data acquisition filtering
 
project - Copy
project - Copyproject - Copy
project - Copy
 
Electric Circuits Lab Series RC Circuits Phase Angle, Phase Lag.docx
Electric Circuits Lab Series RC Circuits Phase Angle, Phase Lag.docxElectric Circuits Lab Series RC Circuits Phase Angle, Phase Lag.docx
Electric Circuits Lab Series RC Circuits Phase Angle, Phase Lag.docx
 
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...
 
Temperature Controlled Fan Report
Temperature Controlled Fan ReportTemperature Controlled Fan Report
Temperature Controlled Fan Report
 
Beme lab-manual new (3) (1)2323
Beme lab-manual new (3) (1)2323Beme lab-manual new (3) (1)2323
Beme lab-manual new (3) (1)2323
 
PWM Step-down Converter(NJM2309)
PWM Step-down Converter(NJM2309)PWM Step-down Converter(NJM2309)
PWM Step-down Converter(NJM2309)
 
Designing Of Time and Power Efficient Model for Controlling Of Critical Process
Designing Of Time and Power Efficient Model for Controlling Of Critical ProcessDesigning Of Time and Power Efficient Model for Controlling Of Critical Process
Designing Of Time and Power Efficient Model for Controlling Of Critical Process
 

More from rajbabureliance (8)

Lab7 s1
Lab7 s1Lab7 s1
Lab7 s1
 
Lab7 s1
Lab7 s1Lab7 s1
Lab7 s1
 
Lab3 s2
Lab3 s2Lab3 s2
Lab3 s2
 
Lab3 s2
Lab3 s2Lab3 s2
Lab3 s2
 
Lab2 s1
Lab2 s1Lab2 s1
Lab2 s1
 
Lab2 s2
Lab2 s2Lab2 s2
Lab2 s2
 
EE337 Course Introduction
EE337 Course IntroductionEE337 Course Introduction
EE337 Course Introduction
 
EE337 Course Introduction
EE337 Course IntroductionEE337 Course Introduction
EE337 Course Introduction
 

Recently uploaded

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
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
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
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxNikitaBankoti2
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesShubhangi Sonawane
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 

Recently uploaded (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 ...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
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...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 

Lab8 s1

  • 1. Lab 8: 20 points EE 337: Microprocessors Laboratory (Spring 2021) Section: S1 (Second year UG) Indian Institute of Technology Bombay Date: March 23, 2021 Refer to Prof. Dinesh Sharma’s slides and notes on serial peripheral interface (SPI) to do this lab. 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. 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 CH0 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 CH7 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
  • 2. 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.