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

More Related Content

Similar to 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.docxYASHU40
 
Ijetae 0312 24
Ijetae 0312 24Ijetae 0312 24
Ijetae 0312 24Memo Love
 
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 .docxpaynetawnya
 
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 TransformerIRJET Journal
 
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
 
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...theijes
 
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
 
Microcontroller based Integrated Circuit Tester
Microcontroller based Integrated Circuit TesterMicrocontroller based Integrated Circuit Tester
Microcontroller based Integrated Circuit TesterIJERA Editor
 
TRANSFORMER FAULT DETECTION AND MONITORING
TRANSFORMER FAULT DETECTION AND MONITORINGTRANSFORMER FAULT DETECTION AND MONITORING
TRANSFORMER FAULT DETECTION AND MONITORINGIRJET Journal
 
Ecet 340 Your world/newtonhelp.com
Ecet 340 Your world/newtonhelp.comEcet 340 Your world/newtonhelp.com
Ecet 340 Your world/newtonhelp.comamaranthbeg100
 
Ecet 340 Motivated Minds/newtonhelp.com
Ecet 340 Motivated Minds/newtonhelp.comEcet 340 Motivated Minds/newtonhelp.com
Ecet 340 Motivated Minds/newtonhelp.comamaranthbeg60
 
Ecet 340 Extraordinary Success/newtonhelp.com
Ecet 340 Extraordinary Success/newtonhelp.comEcet 340 Extraordinary Success/newtonhelp.com
Ecet 340 Extraordinary Success/newtonhelp.comamaranthbeg120
 
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.comamaranthbeg80
 
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 8051Aminu Bugaje
 

Similar to 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
 

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

Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
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
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
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
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
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
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
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
 

Recently uploaded (20)

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
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
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
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
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
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
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
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
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
 

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.