hello..
i am using TMS320C6713 for my voice recognization system...
i have implement an programme which give input from line input to output at line out port through ADC and DAC with sampling rate 8 KHz....
here is the .cmd file for my project flash_sine.cmd
flash_sine.out
-a
-image
-zero
-memwidth 16
ROMS
{
PMEM: org=0x00000000, len=0xFFFF, romwidth=16
FLASH: org=0x90000000, len=0x40000, romwidth=16, files={flash_sine6.hex}
}
SECTIONS
{
.vecs: paddr=0x90004600
.text: paddr=0x90000300
.const: paddr=0x90004000
.cint: paddr=0x90005050
}
this programme works well with line input but not working with microphone input...but when i connect my function generator to mic in channel it gives me output satisfactorily.....what should be the problem.....with microphone input???? i have already checked microphone in audacity and it works well....
neccessary changes to select mic input has already done in file DSK6713_AIC23.h file
here it is
/*
* Copyright 2002 by Spectrum Digital Incorporated.
* All rights reserved. Property of Spectrum Digital Incorporated.
*/
/*
* ======== dsk6713_aic23.h ========
*
* Codec interface for AIC23 on the DSK6713 board
*/
#ifndef DSK6713_AIC23_
#define DSK6713_AIC23_
#ifdef __cplusplus
extern "C" {
#endif
#include <csl.h>
#include <csl_mcbsp.h>
/* AIC23 McBSP defines */
#define DSK6713_AIC23_CONTROLHANDLE DSK6713_AIC23_codeccontrolhandle
#define DSK6713_AIC23_DATAHANDLE DSK6713_AIC23_codecdatahandle
/* McBSP handles */
extern MCBSP_Handle DSK6713_AIC23_DATAHANDLE;
extern MCBSP_Handle DSK6713_AIC23_CONTROLHANDLE;
/* Codec module definitions */
#define DSK6713_AIC23_NUMREGS 10
#define DSK6713_AIC23_LEFTINVOL 0
#define DSK6713_AIC23_RIGHTINVOL 1
#define DSK6713_AIC23_LEFTHPVOL 2
#define DSK6713_AIC23_RIGHTHPVOL 3
#define DSK6713_AIC23_ANAPATH 4
#define DSK6713_AIC23_DIGPATH 5
#define DSK6713_AIC23_POWERDOWN 6
#define DSK6713_AIC23_DIGIF 7
#define DSK6713_AIC23_SAMPLERATE 8
#define DSK6713_AIC23_DIGACT 9
#define DSK6713_AIC23_RESET 15
/* Frequency Definitions */
#define DSK6713_AIC23_FREQ_8KHZ 1
#define DSK6713_AIC23_FREQ_16KHZ 2
#define DSK6713_AIC23_FREQ_24KHZ 3
#define DSK6713_AIC23_FREQ_32KHZ 4
#define DSK6713_AIC23_FREQ_44KHZ 5
#define DSK6713_AIC23_FREQ_48KHZ 6
#define DSK6713_AIC23_FREQ_96KHZ 7
/* Codec Handle */
typedef int DSK6713_AIC23_CodecHandle;
/* Parameter Structure for the DSK6713 AIC23 Codec */
typedef struct DSK6713_AIC23_Config {
int regs[DSK6713_AIC23_NUMREGS];
} DSK6713_AIC23_Config;
#define DSK6713_AIC23_DEFAULTCONFIG { \
0x0017, /* Set-Up Reg 0 Left line input channel volume control */ \
/* LRS 0 simultaneous left/right volume: disabled */\
/* LIM 0 left line input mute: disabled */ \
/* XX 00 reserved */ \
/* LIV 10111 left line input volume: 0 dB */ \
\
0x0017, /* Set-Up Reg 1 Right line input channel volume control */ \
/* RLS 0 simultaneous right/left volume: disabled */\
/* RIM 0 right line input mute: disabled */ \
/* XX 00 reserved */ \
/* RIV 10111 right line input volume: 0 dB */ \
\
0x00d8, /* Set-Up Reg 2 Left channel headphone volume control */ \
/* LRS 0 simultaneous left/right volume: enabled */ \
/* LZC 1 left channel zero-cross detect: enabled */ \
/* LHV 1011000 left headphone volume: 0 dB */ \
\
0x00d8, /* Set-Up Reg 3 Right channel headphone volume control */ \
/* RLS 0 simultaneous right/left volume: enabled */ \
/* RZC 1 right channel zero-cross detect: enabled */\
/* RHV 1011000 right headphone volume: 0 dB */ \
\
0x0015, /* Set-Up Reg 4 Analog audio path control */ \
/* X 0 reserved */ \
/* STA 00 sidetone attenuation: -6 dB */ \
/* STE 0 sidetone: disabled */ \
/* DAC 1 DAC: selected */ \
/* BYP 0 bypass: off */ \
/* INSEL 0 input select for ADC: line */ \
/* MICM 0 microphone mute: disabled */ \
/* MICB 1 microphone boost: enabled */ \
\
0x0000, /* Set-Up Reg 5 Digital audio path control */ \
/* XXXXX 00000 reserved */ \
/* DACM 0 DAC soft mute: disabled */ \
/* DEEMP 00 deemphasis control: disabled */ \
/* ADCHP 0 ADC high-pass filter: disabled */ \
\
0x0000, /* Set-Up Reg 6 Power down control */ \
/* X 0 reserved */ \
/* OFF 0 device power: on (i.e. not off) */ \
/* CLK 0 clock: on */ \
/* OSC 0 oscillator: on */ \
/* OUT 0 outputs: on */ \
/* DAC 0 DAC: on */ \
/* ADC 0 ADC: on */ \
/* MIC 0 microphone: on */ \
/* LINE 0 line input: on */ \
\
0x0043, /* Set-Up Reg 7 Digital audio interface format */ \
/* XX 00 reserved */ \
/* MS 1 master/slave mode: master */ \
/* LRSWAP 0 DAC left/right swap: disabled */ \
/* LRP 0 DAC lrp: MSB on 1st BCLK */ \
/* IWL 00 input bit length: 16 bit */ \
/* FOR 11 data format: DSP format */ \
\
0x0081, /* Set-Up Reg 8 Sample rate control */ \
/* X 0 reserved */ \
/* CLKOUT 1 clock output divider: 2 (MCLK/2) */ \
/* CLKIN 0 clock input divider: 2 (MCLK/2) */ \
/* SR,BOSR 00000 sampling rate: ADC 48 kHz DAC 48 kHz */ \
/* USB/N 1 clock mode select (USB/normal): USB */ \
\
0x0001 /* Set-Up Reg 9 Digital interface activation */ \
/* XX..X 00000000 reserved */ \
/* ACT 1 active */ \
}
/* Set codec register regnum to value regval */
void DSK6713_AIC23_rset(DSK6713_AIC23_CodecHandle hCodec, Uint16 regnum, Uint16 regval);
/* Return value of codec register regnum */
Uint16 DSK6713_AIC23_rget(DSK6713_AIC23_CodecHandle hCodec, Uint16 regnum);
/* Open the codec with id and return handle */
DSK6713_AIC23_CodecHandle DSK6713_AIC23_openCodec(int id, DSK6713_AIC23_Config *Config);
/* Close the codec */
void DSK6713_AIC23_closeCodec(DSK6713_AIC23_CodecHandle hCodec);
/* Configure the codec register values */
void DSK6713_AIC23_config(DSK6713_AIC23_CodecHandle hCodec, DSK6713_AIC23_Config *Config);
/* Write a 32-bit value to the codec */
Int16 DSK6713_AIC23_write(DSK6713_AIC23_CodecHandle hCodec, Uint32 val);
/* Read a 32-bit value from the codec */
Int16 DSK6713_AIC23_read(DSK6713_AIC23_CodecHandle hCodec, Uint32 *val);
/* Set the codec output gain */
void DSK6713_AIC23_outGain(DSK6713_AIC23_CodecHandle hCodec, Uint16 outGain);
/* Set the codec loopback mode */
void DSK6713_AIC23_loopback(DSK6713_AIC23_CodecHandle hCodec, Int16 mode);
/* Enable/disable codec mute mode */
void DSK6713_AIC23_mute(DSK6713_AIC23_CodecHandle hCodec, Int16 mode);
/* Enable/disable codec powerdown modes for DAC, ADC */
void DSK6713_AIC23_powerDown(DSK6713_AIC23_CodecHandle hCodec, Uint16 sect);
/* Set the codec sample rate frequency */
void DSK6713_AIC23_setFreq(DSK6713_AIC23_CodecHandle hCodec, Uint32 freq);
#ifdef __cplusplus
}
#endif
#endif
then i read on boot load cpu gets the 1 KBytes of data from flash memory and put it in L2 memory which is considered as internal memory.....
i have changed my cmd file to store programme directly on internal memory.....
here is .cmd file
flash_sine.out
-a
-image
-zero
-memwidth 16
ROMS
{
PMEM: org=0x00000000, len=0xFFFF, romwidth=16
FLASH: org=0x90000000, len=0x40000, romwidth=16, files={flash_sine6.hex}
}
SECTIONS
{
.vecs: paddr=0x00004600
.text: paddr=0x00000300
.const: paddr=0x00004000
.cint: paddr=0x00005050
}
i have also made some changes in dsk6713.cmd file....
here it is...
/**************************************************************/
/* File dsk6713.cmd */
/* This linker command file can be used as the starting */
/* point for linking programs for the TMS320C6713 DSK. */
/* CCS v5.1 does not support RTDX. */
/* */
/* This CMD file assumes everything fits into internal RAM. */
/* If that's not true, map some sections to the external */
/* SDRAM. */
/**************************************************************/
-c
-heap 0x1000
-stack 0x1000
-i c:\c6713dsk\dsk6713bsl32\lib
-i "c:\Program Files\C6xCSL\lib_3x"
/* -i C:\ti\bios_5_41_11_38\packages\ti\rtdx\lib\c6000 */
-lrts6700.lib
-ldsk6713bsl32.lib
-lcsl6713.lib
/* -lrtdx.lib
-lrtdxhs.lib */
_HWI_Cache_Control = 0;
/* RTDX Interrupt Mask
- This symbol defines those interrupts which are clients of RTDX
(ie - interrupts which call RTDX functions.
- RTDX will apply this mask to the IER before excuting code in
RTDX critical sections temporarily disabling those interrupts for
a few cycles.
- Any interrupt handlers which call RTDX_read/write functions should
be added to the mask to prevent corruption of the RTDX global state
variables by simulataneous access from multiple RTDX clients.
*/
_RTDX_interrupt_mask = ~0x000001808;
MEMORY
{
VECS: origin = 0x0, len = 0x00000260 /* interrupt vectors */
PMEM: origin = 0x00000260, len = 0x0000FE00 /* Internal RAM (L2) mem */
BMEM: origin = 0x80000000, len = 0x01000000 /* CE0, SDRAM, 16 MBytes */
FLASH: origin = 0x90000000, len = 0x40000 /* 256 Kbytes flash mem */
}
SECTIONS
{
.intvecs: load = 0x00000000 /* Interrupt vectors included */
/* by using intr_reset() */
.text: load = PMEM /* Executable code */
/* .rtdx_text: load = PMEM */
.const: load = PMEM /* Initialized constants */
.bss: load = PMEM /* Global and static variables*/
.data: load = PMEM /* Data from .asm programs */
/* .rtdx_data: load = PMEM */
.cinit: load = PMEM /* Tables for initializing */
/* variables and constants */
.pinit: load = PMEM
.stack: load = PMEM /* Stack for local variables */
.far: load = PMEM /* Global and static variables */
/* declared far */
.sysmem: load = PMEM /* Used by malloc, etc. (heap) */
.cio: load = PMEM /* Used for C I/O functions */
.csldata load = PMEM
.switch load = PMEM
}
i have verified that programme is not stored in flash memory by viewing option given on "flashburn DSK" to view flash memory...
still it is not taking any input from microphone......i have connected my line out line with Digital Storage Oscilloscope....to check input...
one more thing which is very astonishing to me is that i have switch off DSK power supply by mistake....but still it is giving me output....
i have changed input frequency from function generator to see change in output and output is absolutely perfect.....
i don't know how it is possible ????
later on i had burn POST power on self test on flash memory and erase previous one.....however i don't know flashburn dsk can erase progrmme from internal memory....but it can erase programme from flash....
new programme succesfully working and got four led on after test....
again i had connected line input and output and i m shocked that it is giving me same output for programme which i thought i have erased......so i come to a point that i might possible that i have not erased internal RAM........so how can i erase internal RAM?
is it necessary to run POST programme before any programme? because in two previous cases i have totaly erased it....
please see the behaviour of kit and give me solution so that i can take input from microphone....and can erase internal RAM.....
regards
jay sompura