SlideShare ist ein Scribd-Unternehmen logo
1 von 2
Downloaden Sie, um offline zu lesen
Lab 9: 20 points
EE 337: Microprocessors Laboratory (Spring 2023)
Indian Institute of Technology Bombay
Date: March 15, 2023
In this lab, you will be learning about Serial Peripheral Interface (SPI), which is a serial
communication protocol. Refer to Prof. Dinesh Sharma’s slides and notes on SPI given here-
https://ee337.github.io/dks.html#serial-io
Use the given main.c, spi.c, mcp3008.h and lcd.h in the https://ee337.github.io/
2023/downloads/lab9_spi.zip zip file to complete this lab. Make sure that all the DIP
switches are OFF.
1. [10 points] In the first part, you need to 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. Use this setup to measure the input given from a potentiometer.
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 micro-controller is the master and the ADC is the slave.
ii) 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 Figure 1. By
varying the point at which the output is taken, voltages ranging from 0 to 3.3 V can
be obtained as output.
iii) 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
Figure 1: Pt51 interfacing with Potentiometer and ADC
2. [10 points] In the second part, you will use the same setup to measure the input given from
arbitrary function generator (AFG).
i) Configure the function generator to provide a sinusoidal waveform of some frequency
less than 5 Hz and amplitude 0 V to 3 V .
ii) Make the connections as shown in Figure 2. Note that the output of the AFG is
connected to CH4 of the ADC.
iii) 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 same format.
Observe that the displayed voltages represent a sinusoidal signal. You can see values
ranging from 0 mV to 3003 mV continuously varying.
Figure 2: Pt51 interfacing with AFG and ADC
TA Checkpoints
1. Verify that the student can demonstrate the SPI setup to measure the voltage across the
potentiometer and display it on the LCD.
2. Verify that the student can demonstrate the SPI setup to measure the sine wave generated
by the AFG and display it on the LCD.
3. Make sure that the content on LCD is displayed in the specified format.

Weitere ähnliche Inhalte

Ähnlich wie EE337 2023 Labsheet 9

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
YASHU40
 
108EN Electrical and Electronic scienceDesign, Simulation .docx
108EN Electrical and Electronic scienceDesign, Simulation .docx108EN Electrical and Electronic scienceDesign, Simulation .docx
108EN Electrical and Electronic scienceDesign, Simulation .docx
paynetawnya
 
Embedded processor system for controllable period-width multichannel pulse wi...
Embedded processor system for controllable period-width multichannel pulse wi...Embedded processor system for controllable period-width multichannel pulse wi...
Embedded processor system for controllable period-width multichannel pulse wi...
TELKOMNIKA JOURNAL
 
Implementation of sign board dot matrix display with 8051
Implementation of sign board dot matrix display with 8051Implementation of sign board dot matrix display with 8051
Implementation of sign board dot matrix display with 8051
Aminu Bugaje
 

Ähnlich wie EE337 2023 Labsheet 9 (20)

Bidirect visitor counter
Bidirect visitor counterBidirect visitor counter
Bidirect visitor counter
 
Analog to Digital Converter
Analog to Digital ConverterAnalog to Digital Converter
Analog to Digital Converter
 
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
 
Ijetae 0312 24
Ijetae 0312 24Ijetae 0312 24
Ijetae 0312 24
 
Picmico
PicmicoPicmico
Picmico
 
project 3 full report
project 3 full reportproject 3 full report
project 3 full report
 
DSP_Assign_1
DSP_Assign_1DSP_Assign_1
DSP_Assign_1
 
108EN Electrical and Electronic scienceDesign, Simulation .docx
108EN Electrical and Electronic scienceDesign, Simulation .docx108EN Electrical and Electronic scienceDesign, Simulation .docx
108EN Electrical and Electronic scienceDesign, Simulation .docx
 
Digital Testing Kit For Three Phase Distribution Transformer
Digital Testing Kit For Three Phase Distribution TransformerDigital Testing Kit For Three Phase Distribution Transformer
Digital Testing Kit For Three Phase Distribution Transformer
 
Embedded processor system for controllable period-width multichannel pulse wi...
Embedded processor system for controllable period-width multichannel pulse wi...Embedded processor system for controllable period-width multichannel pulse wi...
Embedded processor system for controllable period-width multichannel pulse wi...
 
A Computer Based Artificial Neural Network Controller with Interactive Audito...
A Computer Based Artificial Neural Network Controller with Interactive Audito...A Computer Based Artificial Neural Network Controller with Interactive Audito...
A Computer Based Artificial Neural Network Controller with Interactive Audito...
 
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...
 
Microcontroller based Integrated Circuit Tester
Microcontroller based Integrated Circuit TesterMicrocontroller based Integrated Circuit Tester
Microcontroller based Integrated Circuit Tester
 
TRANSFORMER FAULT DETECTION AND MONITORING
TRANSFORMER FAULT DETECTION AND MONITORINGTRANSFORMER FAULT DETECTION AND MONITORING
TRANSFORMER FAULT DETECTION AND MONITORING
 
Ecet 340 Your world/newtonhelp.com
Ecet 340 Your world/newtonhelp.comEcet 340 Your world/newtonhelp.com
Ecet 340 Your world/newtonhelp.com
 
Ecet 340 Motivated Minds/newtonhelp.com
Ecet 340 Motivated Minds/newtonhelp.comEcet 340 Motivated Minds/newtonhelp.com
Ecet 340 Motivated Minds/newtonhelp.com
 
Ecet 340 Extraordinary Success/newtonhelp.com
Ecet 340 Extraordinary Success/newtonhelp.comEcet 340 Extraordinary Success/newtonhelp.com
Ecet 340 Extraordinary Success/newtonhelp.com
 
Ecet 340 Education is Power/newtonhelp.com
Ecet 340 Education is Power/newtonhelp.comEcet 340 Education is Power/newtonhelp.com
Ecet 340 Education is Power/newtonhelp.com
 
Implementation of sign board dot matrix display with 8051
Implementation of sign board dot matrix display with 8051Implementation of sign board dot matrix display with 8051
Implementation of sign board dot matrix display with 8051
 
Anup2
Anup2Anup2
Anup2
 

Mehr von SaravananVijayakumar4

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

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Kürzlich hochgeladen (20)

HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
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
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 

EE337 2023 Labsheet 9

  • 1. Lab 9: 20 points EE 337: Microprocessors Laboratory (Spring 2023) Indian Institute of Technology Bombay Date: March 15, 2023 In this lab, you will be learning about Serial Peripheral Interface (SPI), which is a serial communication protocol. Refer to Prof. Dinesh Sharma’s slides and notes on SPI given here- https://ee337.github.io/dks.html#serial-io Use the given main.c, spi.c, mcp3008.h and lcd.h in the https://ee337.github.io/ 2023/downloads/lab9_spi.zip zip file to complete this lab. Make sure that all the DIP switches are OFF. 1. [10 points] In the first part, you need to 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. Use this setup to measure the input given from a potentiometer. 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 micro-controller is the master and the ADC is the slave. ii) 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 Figure 1. By varying the point at which the output is taken, voltages ranging from 0 to 3.3 V can be obtained as output. iii) 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 Figure 1: Pt51 interfacing with Potentiometer and ADC
  • 2. 2. [10 points] In the second part, you will use the same setup to measure the input given from arbitrary function generator (AFG). i) Configure the function generator to provide a sinusoidal waveform of some frequency less than 5 Hz and amplitude 0 V to 3 V . ii) Make the connections as shown in Figure 2. Note that the output of the AFG is connected to CH4 of the ADC. iii) 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 same format. Observe that the displayed voltages represent a sinusoidal signal. You can see values ranging from 0 mV to 3003 mV continuously varying. Figure 2: Pt51 interfacing with AFG and ADC TA Checkpoints 1. Verify that the student can demonstrate the SPI setup to measure the voltage across the potentiometer and display it on the LCD. 2. Verify that the student can demonstrate the SPI setup to measure the sine wave generated by the AFG and display it on the LCD. 3. Make sure that the content on LCD is displayed in the specified format.