Beruflich Dokumente
Kultur Dokumente
0-1
Chapter 2 - Slide 2
Introduction
The code in MyFirstProject had:
Chapter 2 - Slide 3
Objectives
To design an Improved Audio Template with: Sampling rate adjustable between 8000 samples per second and 48000 samples per second Adjustable gain suitable for:
Chapter 2 - Slide 4
How to read TI datasheets and use the values to configure registers. How to change the sampling rate and audio gain of the coder-decoder (CODEC) How to use decibels.
Chapter 2 - Slide 5
Chapter 2 - Slide 6
Chapter 2 - Slide 7
Chapter 2 - Slide 8
Codec Adjustments
The following can be adjusted on the codec: Sampling rate Input ADC gain Output DAC gain.
Chapter 2 - Slide 9
Chapter 2 - Slide 10
Registers
All the fields PLLP, PLLR etc refer to specific registers inside the Codec. This phase lock loop (PLL) has: a fixed oscillator on the outside (12 MHz)
Chapter 2 - Slide 11
Chapter 2 - Slide 12
Chapter 2 - Slide 13
Chapter 2 - Slide 14
Microphones and guitars have low electrical output. Additional gain is required for these devices.
Chapter 2 - Slide 15
Chapter 2 - Slide 16
This also solves the problem of expressing 0.5 dB using fixed-point maths.
Chapter 2 - Slide 17
Gain in Decibels
The gain is expressed in terms of decibels (dB). A decibel is a ratio.
Gain in dB 20 log (
Input 10 Reference
Chapter 2 - Slide 18
Useful Decibels
The following are decibel values and their ratio equivalents:
0 dB => 1:1
6 dB => 2:1
20 dB => 10:1
40 dB => 100:1
60 dB => 1000:1
2010 Texas Instruments Inc
Chapter 2 - Slide 19
C Code Implementation
Chapter 2 - Slide 20
New Function
The following C code function has been added to AIC3204_init.c
set_sampling_frequency_and_gain();
Chapter 2 - Slide 21
Sampling Frequencies
The sampling frequency can be any of the following:
48000 24000 16000 12000 9600 8000 6857
Chapter 2 - Slide 22
ADC Gain
The ADCgain takes a value between 0 and 48. 0 => 0 dB e.g. line input 30 => 30 dB e.g. microphone input 48 => 48 dB e.g. low output microphone input.
Chapter 2 - Slide 23
New #define
Chapter 2 - Slide 24
Electret Microphone
The TMS320C5505 USB Stick supports electret microphones.
Chapter 2 - Slide 25
Configuration Example
To configure the codec with: Sampling frequency 48000 Hz Gain 0dB Use following #defines in main.c: #define SAMPLES_PER_SECOND 48000 #define GAIN_IN_dB 0
Chapter 2 - Slide 26
Chapter 2 - Slide 27
Chapter 2 - Slide 28
Introduction to Laboratory
Chapter 2 - Slide 29
Chapter 2 - Slide 30
Chapter 2 - Slide 31
Chapter 2 - Slide 32
USB to PC
CD Player or MP3 Player Headphones
Chapter 2 - Slide 33
Chapter 2 - Slide 34
Chapter 2 - Slide 35
Chapter 2 - Slide 36
Chapter 2 - Slide 37
Experiments
Chapter 2 - Slide 38
Chapter 2 - Slide 39
Change Gain
Try different values of gain by changing the number in main.c: #define GAIN_IN_dB 25
Chapter 2 - Slide 40
Programming Challenge
Add code for Step 4 in main.c
Chapter 2 - Slide 41
Using TI Datasheets
Chapter 2 - Slide 42
Using TI Datasheets
The datasheet for the TLV320AIC3204 Codec has the TI literature number SLOS62A. The last letter A is the revision number, which may change. Therefore, when searching for the latest version of the above document on the TI website, just enter SLOS62.
Chapter 2 - Slide 43
References
Chapter 2 - Slide 44