<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5 plus MathML//EN" "http://cnx.rice.edu/technology/cnxml/schema/dtd/0.5/cnxml_mathml.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" xmlns:m="http://www.w3.org/1998/Math/MathML" id="new">
  <name>Using the I/O Ports of the DSK 5510</name>
  <metadata>
  <md:version>1.2</md:version>
  <md:created>2007/04/12 14:48:12 GMT-5</md:created>
  <md:revised>2007/04/24 16:42:08.325 GMT-5</md:revised>
  <md:authorlist>
      <md:author id="tbshen">
      <md:firstname>Thomas</md:firstname>
      
      <md:surname>Shen</md:surname>
      <md:email>tbshen@uiuc.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="tbshen">
      <md:firstname>Thomas</md:firstname>
      
      <md:surname>Shen</md:surname>
      <md:email>tbshen@uiuc.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist>
    <md:keyword>Code Composer</md:keyword>
    <md:keyword>DSK 5510</md:keyword>
    <md:keyword>sampling rate</md:keyword>
  </md:keywordlist>

  <md:abstract>Provides information on the files to use when using the original input/output ports of the DSK 5510. Also provides information on how to change the sampling rate and input port.</md:abstract>
</metadata>
  <content>
<section id="sec1">
<name>Introduction</name>
    <para id="delete_me">The input/output ports of the DSK 5510 can be used when only two inputs and two outputs are needed. Unfortunately, it is currently impossible to utilize the four I/O ports provided by the daughtercard and the two I/O ports on the DSK at the same time. The advantages of the on-board I/O ports are higher signal-to-noise ratio and the ability to change the sampling rate. </para><para id="element-173">The files necessary to utilize the original I/O ports of the DSP board can be found in the V drive under <code>V:\ece420\55x\dsp_board</code>. Much of the functionality is provided in the <code>core.c</code> file. The code is similar to that used in <cnxn document="m13809">Lab 4</cnxn> of the <cnxn document="col10397">Digital Signal Processing Laboratory (ECE 420 55x)</cnxn>. Most changes will probably be made in the <code> dspboard_app.c</code> file. The processBuffer() function is called once every 1024 samples so add changes there. Input will be taken from the 'Line In' port. Both output ports are on by default and are designed to drive different impedances.</para><para id="element-112">As given, the code calls function echoInput() which echoes back input channels 1 and 2 on their respective output channels. The echoInput() function is defined in <code>asmfunctions.asm</code>. The input parameters of echoInput() are passed through registers T0, XAR0, and XAR1. To learn more about the passing convention when calling assembly functions from C, please view Section 6.4.1 of the <link src="http://focus.ti.com/lit/ug/spru281e/spru281e.pdf">TMS320C55x Optimizing C/C++ Compiler User’s Guide</link>. The code also stores the input into a block of memory located at memory address 0x28000h. This is done to show the DSP can access addresses greater than 16-bit in length.</para>
</section>
<section id="sec2">
<name>Changing I/O Parameters</name>

<para id="element-875">The codec is configured with the following lines of code in <code>core.c</code>:</para><code type="block">/* Codec configuration settings */
DSK5510_AIC23_Config config = {
    0x0017, // 0 DSK5510_AIC23_LEFTINVOL  Left line input channel volume
    0x0017, // 1 DSK5510_AIC23_RIGHTINVOL Right line input channel volume
    0x00d8, // 2 DSK5510_AIC23_LEFTHPVOL  Left channel headphone volume
    0x00d8, // 3 DSK5510_AIC23_RIGHTHPVOL Right channel headphone volume
    0x0010, // 4 DSK5510_AIC23_ANAPATH    Analog audio path control
    0x0000, // 5 DSK5510_AIC23_DIGPATH    Digital audio path control
    0x0000, // 6 DSK5510_AIC23_POWERDOWN  Power down control
    0x0043, // 7 DSK5510_AIC23_DIGIF      Digital audio interface format
    0x0081, // 8 DSK5510_AIC23_SAMPLERATE Sample rate control
    0x0001  // 9 DSK5510_AIC23_DIGACT     Digital interface activation
};</code><para id="element-862">The default sampling rate is 48kHz but this can be changed quickly by changing the value of one of the registers in <code>core.c</code>. For example, a 44.1 kHz sampling rate can be obtained by changing register 8 from 0x0081 to 0x00a3. The rate is actually 44.117 kHz as detailed in the <link src="http://focus.ti.com/lit/ds/slws106d/slws106d.pdf">TLV320AIC23 Data Manual</link>. A couple different sampling rates are available (e.g. 8kHz, 32kHz) and if necessary, the input and output rates can be different.</para><para id="element-550">The default input is the 'Line In' port. Microphones that have a small output signal need to be connected to a port that will boost its signal. The 'Mic In' port will be perfect for this task. To change input to the 'Mic In' port, change register 4 from 0x0010 to 0x0014. The gain can also be adjusted, but keep in mind that there will be clipping if the input signal is too high. Unfortunately, the microphones we have in lab need to be amplified before being connected to the DSP. Please refer to the <link src="http://focus.ti.com/lit/ds/slws106d/slws106d.pdf">TLV320AIC23 Data Manual</link> for further instructions. </para>   
</section>
  </content>
  
</document>
