DSPRelated.com
Forums

problem RTDX

Started by brutus_phil2003 October 13, 2003
DSKC6711 CCS2.1
I do one acquisition in real time with the audio
I transfer to the PC the sound by RTDX and i use
the RTDX.exe software for the host and visualise the data
the transfert is good but there is often of zeroes
in the data on rtdx.exe
thanks for the answers

#include <stdio.h>
#include <c6x.h>
#include <rtdx.h> /* RTDX_Data_Write... */
#include "c6xdsk.h"
#include "codec_edma.h"
#include "filter.h"
#include "bs2700.cof" //coefficient file BS @ 2700Hz
#define DATA_SIZE 2
#define BLOCK_SIZE 256
#define NUM_OF_BLOCKS 18
#define DELAY 5
const short BUFFERLENGTH = 256; //size of output buffer
/* change to TI code */
short dly[N];
int yn = 0;
int pcm_out,pcm_in,dma_index;
int src,dst;
short buff[BLOCK_SIZE];
short *in_ptr,*out_ptr;
short in[NUM_OF_BLOCKS*BLOCK_SIZE], out[NUM_OF_BLOCKS*BLOCK_SIZE];
RTDX_CreateOutputChannel(ochan);

int main()
{

int i;
/* dsp and periphiral initialization */
CSR=0x100; /* disable all interrupts */
IER=1; /* disable all interrupts except NMI */
ICR=0xffff; /* clear all pending interrupts */
*(unsigned volatile int *)EMIF_GCR = 0x3300; /* EMIF global
control */
*(unsigned volatile int *)EMIF_CE0 = 0x30; /* EMIF CE0control */
*(unsigned volatile int *)EMIF_CE1 = 0xffffff03; /* EMIF CE1
control, 8bit async */
*(unsigned volatile int *)EMIF_SDCTRL = 0x07117000; /* EMIF SDRAM
control */
*(unsigned volatile int *)EMIF_SDRP = 0x61a; /* EMIF SDRM refresh
period */
*(unsigned volatile int *)EMIF_SDEXT = 0x54519; /* EMIF SDRAM
extension */
*(unsigned volatile int *) TIMER1_CTRL = 0x000002e0;

for (i=0; i<NUM_OF_BLOCKS*BLOCK_SIZE; i++) /* clear all buffers */
{
in[i]=0;
out[i]=0;
}

out[0] = 0xaa;
out[1] = 0;
out[2] = 0x1;
out[3] = 0x0386; /* data for software reset */
out[4] = 0; out[5] = 0;
out[6] = 0x1;
out[7] = 0x0306; /* set reg 3 for mic input */
out[8] = 0;

out[9] = 0;
out[10] = 0x1;
out[11] = 0x0400; /* data for software reset */
out[12] = 0;

out[13] = 0;
out[14] = 0x1;
out[15] = 0x0502; /* data for software reset */
out[16] = 0;

ICR = 0x100;
IER |= 0x102; /* enable int 8 (EDMA) */
CSR |= 1;
//IER = IER | 0x00008002;/* valide le timer 1*/

edma_init();
mcbsp0_init();
//int_selector();
timer_initialization();
while (1) ;
}

int_selector()
{

(unsigned volatile int *) IML = 0x00000000;
(unsigned volatile int *) IMH = 0x08000000; }
timer_initialization()
{

(unsigned volatile int *) TIMER1_CTRL = 0x00000000;
(unsigned volatile int *) TIMER1_PRD = 0x000000A0;
(unsigned volatile int *) TIMER1_COUNT = 0x00000000;
(unsigned volatile int *) TIMER1_CTRL = 0x00000200; }
void mcbsp0_init()
{
/* set up McBSP0 */
*(unsigned volatile int *)McBSP0_SPCR = 0; /* reset serial port
*/
*(unsigned volatile int *)McBSP0_PCR = 0; /* set pin control
reg.; */
*(unsigned volatile int *)McBSP0_RCR = 0x10040; /* set rx
control reg. one 16 bit data/frame */
*(unsigned volatile int *)McBSP0_XCR = 0x10040; /* set tx
control reg. one 16 bit data/frame */
*(unsigned volatile int *)McBSP0_DXR = 0;
*(unsigned volatile int *)McBSP0_SPCR = 0x12001; /* setup SP
control reg.; */
}

void edma_init()
{
*(unsigned volatile int *)ECR = 0xffff; /* clear all pending edma
event */
*(unsigned volatile int *)EER = 0x3000; /* enable event 12 & 13 */

*(unsigned volatile int *)CIPR = 0xffff; /* clear all pending edma
interrupts */
*(unsigned volatile int *)CIER = 0x100; /* enable CCE8 */
pcm_in = (int)&in;
pcm_out = (int)