I am trying to run "example 1.1 Sine Generation with eight points"
written for TMS320C6711 DSK from Rulph Chassing's book DSP
Applications Using C and TMS320C6x DSK on TMS320C6713 DSP. Program
compiles OK and seems to be running but nothing happens when I
listen to signal using a head phone. The program supposed to
generate sine signal tone. As TMS320C6713 DSK has TLV320AIC23 codec,
I changed TLV320AD353_Init() to TLV320AIC23_Init(). What should I do
to solve this problem? Please help me. I have pasted the code below
Best regards,
Nabin
//sine8_intr.c Sine generation using 8 points, f=Fs/(# of points)
//Comm routines and support files included in C6xdskinit.c
short loop = 0;
short sin_table[8] = {0,707,1000,707,0,-707,-1000,-707}; //sine
values
short amplitude = 10; //gain factor
interrupt void c_int11() //interrupt service routine
{
output_sample(sin_table[loop]*amplitude); //output each sine value
if (loop < 7) ++loop; //increment index loop
else loop = 0; //reinit index @ end of buffer
return; //return from interrupt
}
void mcbsp0_init() //set up McBSP0
{
*(unsigned volatile int *)McBSP0_SPCR = 0; //reset serial port
*(unsigned volatile int *)McBSP0_PCR = 1; //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 mcbsp0_write(int out_data) //function for writing
{
int temp;
if (polling) //bypass if interrupt-driven
{
temp = *(unsigned volatile int *)McBSP0_SPCR & 0x20000;
while ( temp == 0)
temp = *(unsigned volatile int *)McBSP0_SPCR & 0x20000;
}
*(unsigned volatile int *)McBSP0_DXR = out_data;
}
int mcbsp0_read() //function for reading
{
int temp;
if (polling)
{
temp = *(unsigned volatile int *)McBSP0_SPCR & 0x2;
while ( temp == 0)
temp = *(unsigned volatile int *)McBSP0_SPCR & 0x2;
}
temp = *(unsigned volatile int *)McBSP0_DRR;
return temp;
}
void c6x_dsk_init() //dsp and
peripheral init
{
CSR=0x100; //disable all
interrupts
IER=1; //disable
interrupts except NMI
ICR=0xffff; //clear pending
interrupts
*(unsigned volatile int *)EMIF_GCR = 0x3300; //EMIF global
control
*(unsigned volatile int *)EMIF_CE0 = 0x30; //EMIF CE0
control
*(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
mcbsp0_init();
TLV320AIC23_Init();
}
void comm_poll() //for communication/init
using polling
{
polling = 1; //if polling
c6x_dsk_init(); //call init DSK function
}
void comm_intr() //for communication/init
using interrupt
{
polling = 0; //if interrupt-driven
c6x_dsk_init(); //call init DSK function
config_Interrupt_Selector(11, XINT0); //using transmit interrupt
INT11
enableSpecificINT(11); //for specific interrupt
enableNMI(); //enable NMI
enableGlobalINT(); //enable GIE for global
interrupt
mcbsp0_write(0); //write to SP0
}
void output_sample(int out_data) //added for output
{
mcbsp0_write(out_data & 0xfffe); //mask out LSB
}
int input_sample() //added for input
{
return mcbsp0_read(); //read from McBSP0
}
//C6xdskinit.h Function prototypes for routines in c6xdskinit.c
void mcbsp0_init();
void mcbsp0_write(int);
int mcbsp0_read();
void TLV320AIC23_Init();
void c6x_dsk_init();
void comm_poll();
void comm_intr();
int input_sample();
void output_sample(int);