____________________________________________________________________________________________ Talkthrough for the ADSP-BF537 EZ-KIT Lite with Audio EZ-Extender Date Created: 08/25/2005 Updated : 5/2007 ____________________________________________________________________________________________ This directory contains an example ADSP-BF537 program that demonstrates the communication between the AD1938 codec and the ADSP-BF537 processor using the system service library and device driver model. The AD1938 codec resides on the Audio EZ-Extender card that attaches to the ADSP-BF537 EZ-Kit. The SPI port provides the control link, and SPORT1 is used for audio transmission. Files contained in this directory: readme.txt this file main.c C file containing the main loop and audio handling function talkthrough.c C file containing routines for audio data processing talkthrough.h C header file for talkthrough.c AudioDriver.c C file containing the initialization and termination functions for the device drivers AudioDriver.h C header file for AudioDriver.c adi_AudioEzExtender.c C file of the virtual device driver for the Audio EZ-Extender adi_AudioEzExtender.h C header file for the Audio EZ-Extender driver Talkthrough_BF537_AudioEZExtender.dpj VisualDSP++ project file ____________________________________________________________________________________________ CONTENTS I. FUNCTIONAL DESCRIPTION II. IMPLEMENTATION DESCRIPTION III. HARDWARE/SOFTWARE CONFIGURATION IV. OPERATION DESCRIPTION -------------------------------------------------------------------------------------------- I. FUNCTIONAL DESCRIPTION The Talkthru example demonstrates the initialization of the device drivers to configure the AD1938 codec and establish a link between the ADSP-BF537 and the codec. The audio EZ-Extender device driver is a virtual driver that resides on top of the AD1938 driver to allow the user to easily configure the EZ-Extender with various audio modes. Currently this driver only supports the analog codec AD1938. The digital codec ADAV801 is not supported and should use the default configuration. The Audio EZ-Extender driver uses the AD1938 driver to simply set up the SPI port to configure both the AD1938 codec A and the AD1938 codec B in TDM 16 channel mode (8 channels for each SPORT primary/secondary). SPORT1 is then setup to receive and transmit audio samples from the codec. Input audio samples from the AD1938 are stored in the processor's receive buffer, using DMA. The samples are processed by the ADSP-BF537 and placed into the transmit buffer. In turn, the transmit buffer is used to transmit data to the AD1938. This results in a simple talk-through where data is moved in and out of the processor without performing any computations on the data. This example has also a framework that can be used to easily process the data in non-interleaved sequential format. Talkthrough.c contains a conversion function for each input/output audio channel. The existing configuration sets the codec at 48khz sampling rate. Audio samples are received from the L1, R1, L2, R2, L3, R3, L4, R4 input channels of the ADC RCA jack on the EZ-Extender, and transmitted through the L1, R1, L2, R2, L3, R3, L4, R4 output jacks. ---------------------------------------------------------------------------------------------- II. IMPLEMENTATION DESCRIPTION The Initialization module does the following. 1. Initializes the system service libraries and the device manager. 2. Initializes the audio EZ-Extender driver which configures AD1938 driver accordingly, and then sets up the SPI and SPORT drivers. 3. Based on the audio mode index, it calls AD1938 driver's control API to configure the AD1938 codec and ADAV801. 4. Configures SPORT1 in TDM mode and sets up DMA circular buffers for the SPORT through the AD1938 driver. 5. Intializes the callback function for the DMA interrupt handler to process audio data. This example uses an older version of the SPI driver. The driver, spi.c, is an older version of adi_spi.c that comes with VDSP 4.5++. ---------------------------------------------------------------------------------------------- III. HARDWARE/SOFTWARE CONFIGURATION ----------------------------------------------------- HARDWARE ----------------------------------------------------- ADSP-BF537 EZ-KIT LITE REV 2.1 BLACKFIN Audio EZ-EXTENDER REV 1.2 Audio source (e.g: CD-player) with RCA jack cable Speaker/Headphone with RCA jack input ----------------------------------------------------- AUDIO EZ-EXTENDER POPULATED JUMPERS ----------------------------------------------------- JP1.7/8 (SPORT_SEL) unpopulate JP1.1/2 (BF537_SEL) populate JP1.5/6 (SPORT1_EN) populate JP2.SCLK3 selected SW1~SW4 all OFF ----------------------------------------------------- ADSP-BF537 EZ-KIT LITE SETTINGS: ----------------------------------------------------- OFF = SW1, SW2, SW3, SW4, SW5, SW7, SW8, OFF = JP6, JP8, JP12 ON = SW6, JP1, JP4, JP5, JP3.1/2 install JP5 install JP9 install ----------------------------------------------------- SOFTWARE: ----------------------------------------------------- PC with the following specification - 166 MHz or higher Intel Pentium¢ē or compatible processor - Minimum of 32 megabytes of RAM - Windows 98, Windows 2000, or Windows XP - One available USB slot VisualDSP++ - Session for BlackFin ADSP-BF537 through emulator or debug agent ------------------------------------------------------------------------------------------- IV. OPERATION DESCRIPTION - Plug the Audio EZ-Extender card onto the ADSP-BF537 EZ-Kit lite's expansion slot - Configure hardware as described above - Connect an input source (such as a CD-player) to the Audio input jack(AIN1-AIN4) and an output source (such as a speaker) to the Audio output jack(AOUT1-AOUT4). See the Audio EZ-Extender User's Manual for more information on input/output jack layout. Audio input and output channels are set up as follows. input output L1 ---> L1 R1 ---> R1 L2 ---> L2 R2 ---> R2 L3 ---> L3 R3 ---> R3 L4 ---> L4 R4 ---> R4 - Open the project "Talkthrough_BF537_AudioEZExtender.dpj" in an ADSP-BF537 EZ-KIT Lite session in the VisualDSP Integrated Development Environment (IDDE). - Under the "Project" tab, select "Build Project" (program is then loaded automatically onto the processor). - Select "Run" from the "Debug" tab on the menu bar of VisualDSP. - Listen to the operation of the talkthrough.