SlideShare a Scribd company logo
1 of 3
Download to read offline
EE5381/7381

Lab 3 Fun With Real Audio

Introduction:
Analog to digital converters (ADCs) make it possible to digitize an analog voltage. By sampling an analog
voltage at a constant rate a digital representation of an analog signal can be created. In this lab we will
use an ADC to sample an analog signal from an audio source and send the digitized signal to a PC for
playback. This will take the next two lab sessions to complete.
Some Quick Sampling Theory:
To digitize an analog signal you must sample at least twice as fast as the highest frequency you’re trying
to capture (Nyquest) or there will be aliasing. For this lab a suitable sampling frequency would be 16k
samples per second. Sampling at 16k times per second with an 8 bit wide sample produces PCM quality
audio, which sounds pretty good.
Since you can’t guarantee that the input to the ADC will be in the range of frequencies that prevent
aliasing (0 Hz – 8,000 Hz) there must be an anti‐aliasing filter in series with the ADC. The anti‐aliasing
filter for our lab will be a simple low pass filter, frequencies from 0 Hz – 8,000 Hz will pass through filter
relatively unaffected and frequencies greater than 8,000 Hz will be attenuated.
Procedure:
1. Hook up the ADC and sample some voltages to make sure it’s working, and send samples out of
the Coldfire’s serial port using the “printf” command. Use HyperTerminal to monitor the
Coldfire’s serial port output.
2. Use a periodic interrupt timer to sample the ADC 16,000 times per second and test it out by
connecting a signal generator to the ADC’s input. Try sending samples from the ADC to MATLAB
over the Coldfire’s serial port and plot the results.
3. Build the anti‐aliasing filter circuit, sample some music, and play it back using MATLAB
Details:
Connecting the ADC
We’re using a Microchip MCP3001 ADC. The MCP3001 is a 10 bit, 200ksps ADC. This means that the
MCP3001 can convert an input voltage into a 10 bit number 200k times per second. The MCP3001 uses
SPI communications to transmit and receive data. What is SPI you ask? SPI stands for Serial Peripheral
Interface and is an easy to use method for communicating between electronic devices.
SPI is all about shifting bits. Here’s how SPI works in general: A master device, the Coldfire board, will be
connected to a slave device, the ADC. The master device controls all of the communications transactions
and slave does as it’s told. Four signals connect the master and slave: a chip select, data input, data
output, and a clock. As data is clocked out of the master’s SPI shift register to the slave device’s SPI shift
register, the slave device clocks data from its SPI shift register back to master’s SPI shift register.
EE5381/7381

Lab 3 Fun With Real Audio

The MCP3001 is a simple SPI device in that it only outputs data (this means it has no inputs). In order to
initiate a SPI transfer on the Coldfire data must be sent though. The solution is simple; the Coldfire just
sends some junk data out of its unconnected data output to initiate a SPI transfer
Figure 1, MCP3001 timing diagram

The ADC will be connected to the Coldfire with 3 pins, the clock (QSPICLK), data input (QSPIDIN), and
chip select pins (QSPICS0). When a transfer is initiated on the Coldfire the Chip select will be brought
low. Then the Coldfire will output 13 clock transitions. During the last 10 clock transitions the ADC will
output its 10 bits of data back to the Coldfire.
The SPI hardware on the Coldfire is called the QSPI module, the ‘Q’ stands for queued, and here’s how it
needs to be setup to work with the ADC:
1. The QSPI_PAR register needs to be configured so that the QSPI pins aren’t GPIO
2. The QMR register needs the following set: Master mode, the length of the transfer (13 bits), and
baud rate (0x0032 will work), and the CPHA bit needs clearing
3. In the QWR register the CSIV bit needs setting
4. Set the QAR register to point to Command RAM
5. Write a 0x7E00 to the QDR register
6. Set the SPE bit in the ODLYR register to initiate a transfer
7. Wait until the SPIF bit in the QIR register is set
8. Set the QAR register to point to the Receive RAM
9. Read the QDR register to retrieve the reading from the ADC
10. Repeat steps 5 to 9 to get more readings
Periodic Interrupt Timers
The mcf5235 has 4 periodic interrupt timers (PITs). These timers allow the user to create interrupts at
specific rates. These interrupts cause the processor to halt what it’s doing and execute a specific chunk
of code at a constant rate. Setting up the PITs isn’t hard, but due to time constraints code will be
provided to setup and use the PITs.
Anti‐aliasing filter and scaling circuit ???????
Appendix A
EE5381/7381

Schematic for connecting MCP3001 to Coldfire board

Lab 3 Fun With Real Audio

More Related Content

What's hot

Analog to Digital Converters
Analog to Digital ConvertersAnalog to Digital Converters
Analog to Digital ConvertersAmitabh Shukla
 
ADC Interfacing with pic Microcontrollert
ADC Interfacing with pic MicrocontrollertADC Interfacing with pic Microcontrollert
ADC Interfacing with pic Microcontrollertleapshare007
 
The IoT Academy IoT training Arduino Part 5 Arduino peripherals
The IoT Academy IoT training Arduino Part 5 Arduino peripheralsThe IoT Academy IoT training Arduino Part 5 Arduino peripherals
The IoT Academy IoT training Arduino Part 5 Arduino peripheralsThe IOT Academy
 
Physical prototyping lab1-input_output (2)
Physical prototyping lab1-input_output (2)Physical prototyping lab1-input_output (2)
Physical prototyping lab1-input_output (2)Tony Olsson.
 
Temperature sensor with raspberry pi
Temperature sensor with raspberry piTemperature sensor with raspberry pi
Temperature sensor with raspberry piSantosh Kumar Kar
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalTony Olsson.
 
Amvdd Data Converter Fundamentals
Amvdd Data Converter FundamentalsAmvdd Data Converter Fundamentals
Amvdd Data Converter FundamentalsNiket Chandrashekar
 
Digital to Analog conversion
Digital to Analog conversionDigital to Analog conversion
Digital to Analog conversionMariam Butt
 
Nrf24l01 tutorial 0
Nrf24l01 tutorial 0Nrf24l01 tutorial 0
Nrf24l01 tutorial 0Khanh Le
 
07 Analogue to Digital Converter(ADC).2016
07 Analogue to Digital Converter(ADC).201607 Analogue to Digital Converter(ADC).2016
07 Analogue to Digital Converter(ADC).2016Mohamed Fawzy
 
Digital clock
Digital clockDigital clock
Digital clockAbi Malik
 
Physical prototyping lab6-motors
Physical prototyping lab6-motorsPhysical prototyping lab6-motors
Physical prototyping lab6-motorsTony Olsson.
 
(D/A) and (A/D)conversion
(D/A) and (A/D)conversion(D/A) and (A/D)conversion
(D/A) and (A/D)conversionPraveen Kumar
 
Interfacing technique with 8085- ADC[0808]
Interfacing technique with 8085- ADC[0808]Interfacing technique with 8085- ADC[0808]
Interfacing technique with 8085- ADC[0808]Guhan k
 
Digital Alarm Clock 446 project report
Digital Alarm Clock 446 project reportDigital Alarm Clock 446 project report
Digital Alarm Clock 446 project reportAkash Mhankale
 
Digital To Analog Conversion
Digital To Analog ConversionDigital To Analog Conversion
Digital To Analog ConversionSialkot
 
Mc module5 lcd_interface_ppt_msj
Mc module5 lcd_interface_ppt_msjMc module5 lcd_interface_ppt_msj
Mc module5 lcd_interface_ppt_msjmangala jolad
 

What's hot (20)

Bayas
BayasBayas
Bayas
 
Analog to Digital Converters
Analog to Digital ConvertersAnalog to Digital Converters
Analog to Digital Converters
 
ADC Interfacing with pic Microcontrollert
ADC Interfacing with pic MicrocontrollertADC Interfacing with pic Microcontrollert
ADC Interfacing with pic Microcontrollert
 
The IoT Academy IoT training Arduino Part 5 Arduino peripherals
The IoT Academy IoT training Arduino Part 5 Arduino peripheralsThe IoT Academy IoT training Arduino Part 5 Arduino peripherals
The IoT Academy IoT training Arduino Part 5 Arduino peripherals
 
Physical prototyping lab1-input_output (2)
Physical prototyping lab1-input_output (2)Physical prototyping lab1-input_output (2)
Physical prototyping lab1-input_output (2)
 
Temperature sensor with raspberry pi
Temperature sensor with raspberry piTemperature sensor with raspberry pi
Temperature sensor with raspberry pi
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digital
 
Amvdd Data Converter Fundamentals
Amvdd Data Converter FundamentalsAmvdd Data Converter Fundamentals
Amvdd Data Converter Fundamentals
 
Digital to Analog conversion
Digital to Analog conversionDigital to Analog conversion
Digital to Analog conversion
 
Nrf24l01 tutorial 0
Nrf24l01 tutorial 0Nrf24l01 tutorial 0
Nrf24l01 tutorial 0
 
07 Analogue to Digital Converter(ADC).2016
07 Analogue to Digital Converter(ADC).201607 Analogue to Digital Converter(ADC).2016
07 Analogue to Digital Converter(ADC).2016
 
Digital clock
Digital clockDigital clock
Digital clock
 
ADC and DAC Best Ever Pers
ADC and DAC Best Ever PersADC and DAC Best Ever Pers
ADC and DAC Best Ever Pers
 
Physical prototyping lab6-motors
Physical prototyping lab6-motorsPhysical prototyping lab6-motors
Physical prototyping lab6-motors
 
(D/A) and (A/D)conversion
(D/A) and (A/D)conversion(D/A) and (A/D)conversion
(D/A) and (A/D)conversion
 
Interfacing technique with 8085- ADC[0808]
Interfacing technique with 8085- ADC[0808]Interfacing technique with 8085- ADC[0808]
Interfacing technique with 8085- ADC[0808]
 
Ditial to Analog Converter
Ditial to Analog ConverterDitial to Analog Converter
Ditial to Analog Converter
 
Digital Alarm Clock 446 project report
Digital Alarm Clock 446 project reportDigital Alarm Clock 446 project report
Digital Alarm Clock 446 project report
 
Digital To Analog Conversion
Digital To Analog ConversionDigital To Analog Conversion
Digital To Analog Conversion
 
Mc module5 lcd_interface_ppt_msj
Mc module5 lcd_interface_ppt_msjMc module5 lcd_interface_ppt_msj
Mc module5 lcd_interface_ppt_msj
 

Viewers also liked

Happening at the wall
Happening at the wallHappening at the wall
Happening at the wallr_hennessey
 
5 Rules to Follow While Growing your Startup’s Brand
5 Rules to Follow While Growing your Startup’s Brand5 Rules to Follow While Growing your Startup’s Brand
5 Rules to Follow While Growing your Startup’s Brandbooncon oy
 
B'Ramping Family
B'Ramping FamilyB'Ramping Family
B'Ramping Familybrampingbc
 
Bootstrapping your brand
Bootstrapping your brandBootstrapping your brand
Bootstrapping your brandbooncon oy
 
Police appreciation
Police appreciationPolice appreciation
Police appreciationvandling
 
AfED_1-08-abkhazia_book_eng
AfED_1-08-abkhazia_book_engAfED_1-08-abkhazia_book_eng
AfED_1-08-abkhazia_book_engNatalya Luneva
 
Musical instruments
Musical instrumentsMusical instruments
Musical instrumentstinkerbell_3
 
Pravda analytics technical monthly review for december 2016
Pravda analytics technical monthly review for december 2016Pravda analytics technical monthly review for december 2016
Pravda analytics technical monthly review for december 2016Alex Vlasov
 
Chemistry : Deret Volta (Laporan Praktikum Kimia)
Chemistry : Deret Volta (Laporan Praktikum Kimia)Chemistry : Deret Volta (Laporan Praktikum Kimia)
Chemistry : Deret Volta (Laporan Praktikum Kimia)SMA XAVERIUS 1 JAMBI
 
Restaurants & Mobile Apps
Restaurants & Mobile AppsRestaurants & Mobile Apps
Restaurants & Mobile AppsClarkonline
 
Dr. Abhin Chandra Homoeopathy Medical College & Hospital (Bhubaneswar, India)...
Dr. Abhin Chandra Homoeopathy Medical College & Hospital (Bhubaneswar, India)...Dr. Abhin Chandra Homoeopathy Medical College & Hospital (Bhubaneswar, India)...
Dr. Abhin Chandra Homoeopathy Medical College & Hospital (Bhubaneswar, India)...Dr. Kabita Mishra
 
28 states:discrimination against the girl child
28 states:discrimination against the girl child28 states:discrimination against the girl child
28 states:discrimination against the girl childAnapurna Monga
 

Viewers also liked (14)

AfED
AfEDAfED
AfED
 
Happening at the wall
Happening at the wallHappening at the wall
Happening at the wall
 
5 Rules to Follow While Growing your Startup’s Brand
5 Rules to Follow While Growing your Startup’s Brand5 Rules to Follow While Growing your Startup’s Brand
5 Rules to Follow While Growing your Startup’s Brand
 
B'Ramping Family
B'Ramping FamilyB'Ramping Family
B'Ramping Family
 
Elektrolisis dan electroplating 2
Elektrolisis dan electroplating 2Elektrolisis dan electroplating 2
Elektrolisis dan electroplating 2
 
Bootstrapping your brand
Bootstrapping your brandBootstrapping your brand
Bootstrapping your brand
 
Police appreciation
Police appreciationPolice appreciation
Police appreciation
 
AfED_1-08-abkhazia_book_eng
AfED_1-08-abkhazia_book_engAfED_1-08-abkhazia_book_eng
AfED_1-08-abkhazia_book_eng
 
Musical instruments
Musical instrumentsMusical instruments
Musical instruments
 
Pravda analytics technical monthly review for december 2016
Pravda analytics technical monthly review for december 2016Pravda analytics technical monthly review for december 2016
Pravda analytics technical monthly review for december 2016
 
Chemistry : Deret Volta (Laporan Praktikum Kimia)
Chemistry : Deret Volta (Laporan Praktikum Kimia)Chemistry : Deret Volta (Laporan Praktikum Kimia)
Chemistry : Deret Volta (Laporan Praktikum Kimia)
 
Restaurants & Mobile Apps
Restaurants & Mobile AppsRestaurants & Mobile Apps
Restaurants & Mobile Apps
 
Dr. Abhin Chandra Homoeopathy Medical College & Hospital (Bhubaneswar, India)...
Dr. Abhin Chandra Homoeopathy Medical College & Hospital (Bhubaneswar, India)...Dr. Abhin Chandra Homoeopathy Medical College & Hospital (Bhubaneswar, India)...
Dr. Abhin Chandra Homoeopathy Medical College & Hospital (Bhubaneswar, India)...
 
28 states:discrimination against the girl child
28 states:discrimination against the girl child28 states:discrimination against the girl child
28 states:discrimination against the girl child
 

Similar to Lab3

Using Ready-for-PIC and SDR Libraries
Using Ready-for-PIC and SDR LibrariesUsing Ready-for-PIC and SDR Libraries
Using Ready-for-PIC and SDR LibrariesCorrado Santoro
 
Embedded systems and robotics by scmandota
Embedded systems and robotics by scmandotaEmbedded systems and robotics by scmandota
Embedded systems and robotics by scmandotascmandota
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)IJERD Editor
 
Industrial training report of embedded system and robotics
Industrial training report of embedded system and roboticsIndustrial training report of embedded system and robotics
Industrial training report of embedded system and roboticsPallavi Bharti
 
Training Report on embedded Systems and Robotics
Training Report on embedded  Systems and RoboticsTraining Report on embedded  Systems and Robotics
Training Report on embedded Systems and RoboticsNIT Raipur
 
Peripherals and interfacing
Peripherals  and interfacingPeripherals  and interfacing
Peripherals and interfacingRAMPRAKASHT1
 
Part-2: Mastering microcontroller with embedded driver development
Part-2: Mastering microcontroller with embedded driver developmentPart-2: Mastering microcontroller with embedded driver development
Part-2: Mastering microcontroller with embedded driver developmentFastBit Embedded Brain Academy
 
Scaling Down Instrumentation Deploying Analog Mixed Signal Technology
Scaling Down Instrumentation Deploying Analog Mixed Signal TechnologyScaling Down Instrumentation Deploying Analog Mixed Signal Technology
Scaling Down Instrumentation Deploying Analog Mixed Signal TechnologyShivaprasad Tilekar
 
ATmegaMicrocontrollerArchitecturenotes.pptx
ATmegaMicrocontrollerArchitecturenotes.pptxATmegaMicrocontrollerArchitecturenotes.pptx
ATmegaMicrocontrollerArchitecturenotes.pptxaartis110
 
ELECTRICAL ENGINEERING PROJECT
ELECTRICAL ENGINEERING PROJECTELECTRICAL ENGINEERING PROJECT
ELECTRICAL ENGINEERING PROJECTvasav2204
 
electrical engineering project
electrical engineering projectelectrical engineering project
electrical engineering projectvasav2204
 
ARDUINO AND ITS PIN CONFIGURATION
 ARDUINO AND ITS PIN  CONFIGURATION ARDUINO AND ITS PIN  CONFIGURATION
ARDUINO AND ITS PIN CONFIGURATIONsoma saikiran
 

Similar to Lab3 (20)

Assembler4
Assembler4Assembler4
Assembler4
 
Using Ready-for-PIC and SDR Libraries
Using Ready-for-PIC and SDR LibrariesUsing Ready-for-PIC and SDR Libraries
Using Ready-for-PIC and SDR Libraries
 
Embedded systems and robotics by scmandota
Embedded systems and robotics by scmandotaEmbedded systems and robotics by scmandota
Embedded systems and robotics by scmandota
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)
 
Industrial training report of embedded system and robotics
Industrial training report of embedded system and roboticsIndustrial training report of embedded system and robotics
Industrial training report of embedded system and robotics
 
Gas sensor
Gas sensorGas sensor
Gas sensor
 
Training Report on embedded Systems and Robotics
Training Report on embedded  Systems and RoboticsTraining Report on embedded  Systems and Robotics
Training Report on embedded Systems and Robotics
 
digital clock atmega16
digital clock atmega16digital clock atmega16
digital clock atmega16
 
Peripherals and interfacing
Peripherals  and interfacingPeripherals  and interfacing
Peripherals and interfacing
 
JamesEndl
JamesEndlJamesEndl
JamesEndl
 
A 1.2V 10-bit 165MSPS Video ADC
A 1.2V 10-bit 165MSPS Video ADCA 1.2V 10-bit 165MSPS Video ADC
A 1.2V 10-bit 165MSPS Video ADC
 
Part-2: Mastering microcontroller with embedded driver development
Part-2: Mastering microcontroller with embedded driver developmentPart-2: Mastering microcontroller with embedded driver development
Part-2: Mastering microcontroller with embedded driver development
 
PC based oscilloscope
PC based oscilloscopePC based oscilloscope
PC based oscilloscope
 
Wds
WdsWds
Wds
 
Introduction to PIC.pptx
Introduction to PIC.pptxIntroduction to PIC.pptx
Introduction to PIC.pptx
 
Scaling Down Instrumentation Deploying Analog Mixed Signal Technology
Scaling Down Instrumentation Deploying Analog Mixed Signal TechnologyScaling Down Instrumentation Deploying Analog Mixed Signal Technology
Scaling Down Instrumentation Deploying Analog Mixed Signal Technology
 
ATmegaMicrocontrollerArchitecturenotes.pptx
ATmegaMicrocontrollerArchitecturenotes.pptxATmegaMicrocontrollerArchitecturenotes.pptx
ATmegaMicrocontrollerArchitecturenotes.pptx
 
ELECTRICAL ENGINEERING PROJECT
ELECTRICAL ENGINEERING PROJECTELECTRICAL ENGINEERING PROJECT
ELECTRICAL ENGINEERING PROJECT
 
electrical engineering project
electrical engineering projectelectrical engineering project
electrical engineering project
 
ARDUINO AND ITS PIN CONFIGURATION
 ARDUINO AND ITS PIN  CONFIGURATION ARDUINO AND ITS PIN  CONFIGURATION
ARDUINO AND ITS PIN CONFIGURATION
 

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
 
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
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
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
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
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
 
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
 
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
 
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
 
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
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
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
 
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
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.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
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
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
 
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
 
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
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
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
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 

Lab3

  • 1. EE5381/7381 Lab 3 Fun With Real Audio Introduction: Analog to digital converters (ADCs) make it possible to digitize an analog voltage. By sampling an analog voltage at a constant rate a digital representation of an analog signal can be created. In this lab we will use an ADC to sample an analog signal from an audio source and send the digitized signal to a PC for playback. This will take the next two lab sessions to complete. Some Quick Sampling Theory: To digitize an analog signal you must sample at least twice as fast as the highest frequency you’re trying to capture (Nyquest) or there will be aliasing. For this lab a suitable sampling frequency would be 16k samples per second. Sampling at 16k times per second with an 8 bit wide sample produces PCM quality audio, which sounds pretty good. Since you can’t guarantee that the input to the ADC will be in the range of frequencies that prevent aliasing (0 Hz – 8,000 Hz) there must be an anti‐aliasing filter in series with the ADC. The anti‐aliasing filter for our lab will be a simple low pass filter, frequencies from 0 Hz – 8,000 Hz will pass through filter relatively unaffected and frequencies greater than 8,000 Hz will be attenuated. Procedure: 1. Hook up the ADC and sample some voltages to make sure it’s working, and send samples out of the Coldfire’s serial port using the “printf” command. Use HyperTerminal to monitor the Coldfire’s serial port output. 2. Use a periodic interrupt timer to sample the ADC 16,000 times per second and test it out by connecting a signal generator to the ADC’s input. Try sending samples from the ADC to MATLAB over the Coldfire’s serial port and plot the results. 3. Build the anti‐aliasing filter circuit, sample some music, and play it back using MATLAB Details: Connecting the ADC We’re using a Microchip MCP3001 ADC. The MCP3001 is a 10 bit, 200ksps ADC. This means that the MCP3001 can convert an input voltage into a 10 bit number 200k times per second. The MCP3001 uses SPI communications to transmit and receive data. What is SPI you ask? SPI stands for Serial Peripheral Interface and is an easy to use method for communicating between electronic devices. SPI is all about shifting bits. Here’s how SPI works in general: A master device, the Coldfire board, will be connected to a slave device, the ADC. The master device controls all of the communications transactions and slave does as it’s told. Four signals connect the master and slave: a chip select, data input, data output, and a clock. As data is clocked out of the master’s SPI shift register to the slave device’s SPI shift register, the slave device clocks data from its SPI shift register back to master’s SPI shift register.
  • 2. EE5381/7381 Lab 3 Fun With Real Audio The MCP3001 is a simple SPI device in that it only outputs data (this means it has no inputs). In order to initiate a SPI transfer on the Coldfire data must be sent though. The solution is simple; the Coldfire just sends some junk data out of its unconnected data output to initiate a SPI transfer Figure 1, MCP3001 timing diagram The ADC will be connected to the Coldfire with 3 pins, the clock (QSPICLK), data input (QSPIDIN), and chip select pins (QSPICS0). When a transfer is initiated on the Coldfire the Chip select will be brought low. Then the Coldfire will output 13 clock transitions. During the last 10 clock transitions the ADC will output its 10 bits of data back to the Coldfire. The SPI hardware on the Coldfire is called the QSPI module, the ‘Q’ stands for queued, and here’s how it needs to be setup to work with the ADC: 1. The QSPI_PAR register needs to be configured so that the QSPI pins aren’t GPIO 2. The QMR register needs the following set: Master mode, the length of the transfer (13 bits), and baud rate (0x0032 will work), and the CPHA bit needs clearing 3. In the QWR register the CSIV bit needs setting 4. Set the QAR register to point to Command RAM 5. Write a 0x7E00 to the QDR register 6. Set the SPE bit in the ODLYR register to initiate a transfer 7. Wait until the SPIF bit in the QIR register is set 8. Set the QAR register to point to the Receive RAM 9. Read the QDR register to retrieve the reading from the ADC 10. Repeat steps 5 to 9 to get more readings Periodic Interrupt Timers The mcf5235 has 4 periodic interrupt timers (PITs). These timers allow the user to create interrupts at specific rates. These interrupts cause the processor to halt what it’s doing and execute a specific chunk of code at a constant rate. Setting up the PITs isn’t hard, but due to time constraints code will be provided to setup and use the PITs. Anti‐aliasing filter and scaling circuit ??????? Appendix A
  • 3. EE5381/7381 Schematic for connecting MCP3001 to Coldfire board Lab 3 Fun With Real Audio