Greetings all!
First post here. total noob... Excited to be here! I have a DSK6713, and CC Studio Version: 5.2.1.00018 . Wouldn't post if I had not already struggled for hours. Any help/suggestions would be most appreciated!
I'm trying to work through Rulph Chassaing's book, Digital Signal Processing and Applications with the C6713 and C6416 DSK . ( http://www.amazon.com/Digital-Signal-Processing-Applications-Topics/dp/0471690074/ref=la_B001IXMEOI_1_3?ie=UTF8&qid=1348296203&sr=1-3 ).
The book was really set up to to use CC3.0--it came with the board. However, I have Windows 7, and after much trial-and-error, CC3.0 will not work with Windows 7.
Following the book, using CC5 instead--that shouldn't be a factor, I don't think-- for the first program, sine8_LED. It seems I'm having some trouble compiling the c6713dskinit.c file. The errors seem to be coming from the chip support library. I did get the precompiled Sine8_LED.out to load on the board. That part works ok, so I know the board works.
I started with a blank project, included all the required files spelled out in the book:
- Sine8_LED.c (from Chassaing's book -- current project)
- c6713dsk.cmd (from Chassaing's book -- support folder)
- Vectors_poll.asm (from Chassaing's book --support folder)
- csl6713.lib (fresh download from http://c6000.spectrumdigital.com/dsk6713/... only existed in the bios folder). D:\CCStudio_v5.2\ccsv5\tools\compiler\DSK6713(latest)\c6000\bios\lib
- dsk6713bsl.lib (also fresh download from http://support.spectrumdigital.com)
- rts6700.lib (CCS5 C6000 compiler folder version 7.3.4) D:\CCStudio_v5.2\ccsv5\tools\compiler\c6000_7.3.4\lib . Did not find this library in the most recent compiler version 7.3.8, Also, reset build properties to use the 7.3.4 compiler.
- the dsk6713.gel file was NOT added automatically when the project was built. Had to add it manually. (also fresh download from spectrumdigital.com) D:\CCStudio_v5.2\ccsv5\tools\compiler\DSK6713(latest)\cc\gel
Set all the compiler options per the book (spelled out build printout below):
**** Build of configuration Debug for project my_sine8LED ****
D:\CCStudio_v5.2\ccsv5\utils\bin\gmake -k all
'Building file: ../Sine8_LED.c'
'Invoking: C6000 Compiler'
"D:/CCStudio_v5.2/ccsv5/tools/compiler/c6000_7.3.4/bin/cl6x" -mvc671x{-mv6710} -g -O0 -ms0 --define=CHIP_6713 --include_path="D:/CCStudio_v5.2/ccsv5/tools/compiler/c6000_7.3.4/include" --include_path="D:/CodeComposerWork/Chassaing_6713/Support" --include_path="D:/CodeComposerWork/Chassaing_6713/sine8_LED" --include_path="D:/CCStudio_v5.2/ccsv5/tools/compiler/c6000_7.3.4/include" --include_path="D:/CCStudio_v5.2/ccsv5/tools/compiler/DSK6713(latest)/c6000/bios/include" --include_path="D:/CCStudio_v5.2/ccsv5/tools/compiler/DSK6713(latest)/c6000/dsk6713/include" --display_error_number --diag_warning=225 --abi=coffabi --preproc_with_compile --preproc_dependency="Sine8_LED.pp" "../Sine8_LED.c"
>> WARNING: invalid version 0, defaulting to 6200
"D:/CCStudio_v5.2/ccsv5/tools/compiler/DSK6713(latest)/c6000/bios/include/csl_chiphal.h", line 1041: error #838: unrecognized cregister name 'FADCR'
>> Compilation failure
"D:/CCStudio_v5.2/ccsv5/tools/compiler/DSK6713(latest)/c6000/bios/include/csl_chiphal.h", line 1041: error #658-D: the modifier "cregister" is not allowed on this declaration
"D:/CCStudio_v5.2/ccsv5/tools/compiler/DSK6713(latest)/c6000/bios/include/csl_chiphal.h", line 1240: error #838: unrecognized cregister name 'FAUCR'
"D:/CCStudio_v5.2/ccsv5/tools/compiler/DSK6713(latest)/c6000/bios/include/csl_chiphal.h", line 1240: error #658-D: the modifier "cregister" is not allowed on this declaration
"D:/CCStudio_v5.2/ccsv5/tools/compiler/DSK6713(latest)/c6000/bios/include/csl_chiphal.h", line 1451: error #838: unrecognized cregister name 'FMCR'
"D:/CCStudio_v5.2/ccsv5/tools/compiler/DSK6713(latest)/c6000/bios/include/csl_chiphal.h", line 1451: error #658-D: the modifier "cregister" is not allowed on this declaration
"../Sine8_LED.c", line 15: warning #225-D: function declared implicitly
'Building file: ../Vectors_poll.asm'
"../Sine8_LED.c", line 16: warning #225-D: function declared implicitly
"../Sine8_LED.c", line 17: warning #225-D: function declared implicitly
"../Sine8_LED.c", line 20: warning #225-D: function declared implicitly
"../Sine8_LED.c", line 22: warning #225-D: function declared implicitly
"../Sine8_LED.c", line 23: warning #225-D: function declared implicitly
"../Sine8_LED.c", line 26: warning #225-D: function declared implicitly
6 errors detected in the compilation of "../Sine8_LED.c".
gmake: *** [Sine8_LED.obj] Error 1
'Invoking: C6000 Compiler'
"D:/CCStudio_v5.2/ccsv5/tools/compiler/c6000_7.3.4/bin/cl6x" -mvc671x{-mv6710} -g -O0 -ms0 --define=CHIP_6713 --include_path="D:/CCStudio_v5.2/ccsv5/tools/compiler/c6000_7.3.4/include" --include_path="D:/CodeComposerWork/Chassaing_6713/Support" --include_path="D:/CodeComposerWork/Chassaing_6713/sine8_LED" --include_path="D:/CCStudio_v5.2/ccsv5/tools/compiler/c6000_7.3.4/include" --include_path="D:/CCStudio_v5.2/ccsv5/tools/compiler/DSK6713(latest)/c6000/bios/include" --include_path="D:/CCStudio_v5.2/ccsv5/tools/compiler/DSK6713(latest)/c6000/dsk6713/include" --display_error_number --diag_warning=225 --abi=coffabi --preproc_with_compile --preproc_dependency="Vectors_poll.pp" "../Vectors_poll.asm"
>> WARNING: invalid version 0, defaulting to 6200
'Finished building: ../Vectors_poll.asm'
' '
'Building file: ../c6713dskinit.c'
'Invoking: C6000 Compiler'
"D:/CCStudio_v5.2/ccsv5/tools/compiler/c6000_7.3.4/bin/cl6x" -mvc671x{-mv6710} -g -O0 -ms0 --define=CHIP_6713 --include_path="D:/CCStudio_v5.2/ccsv5/tools/compiler/c6000_7.3.4/include" --include_path="D:/CodeComposerWork/Chassaing_6713/Support" --include_path="D:/CodeComposerWork/Chassaing_6713/sine8_LED" --include_path="D:/CCStudio_v5.2/ccsv5/tools/compiler/c6000_7.3.4/include" --include_path="D:/CCStudio_v5.2/ccsv5/tools/compiler/DSK6713(latest)/c6000/bios/include" --include_path="D:/CCStudio_v5.2/ccsv5/tools/compiler/DSK6713(latest)/c6000/dsk6713/include" --display_error_number --diag_warning=225 --abi=coffabi --preproc_with_compile --preproc_dependency="c6713dskinit.pp" "../c6713dskinit.c"
>> WARNING: invalid version 0, defaulting to 6200
"D:/CCStudio_v5.2/ccsv5/tools/compiler/DSK6713(latest)/c6000/bios/include/csl_chiphal.h", line 1041: error #838: unrecognized cregister name 'FADCR'
"D:/CCStudio_v5.2/ccsv5/tools/compiler/DSK6713(latest)/c6000/bios/include/csl_chiphal.h", line 1041: error #658-D: the modifier "cregister" is not allowed on this declaration
>> Compilation failure
"D:/CCStudio_v5.2/ccsv5/tools/compiler/DSK6713(latest)/c6000/bios/include/csl_chiphal.h", line 1240: error #838: unrecognized cregister name 'FAUCR'
"D:/CCStudio_v5.2/ccsv5/tools/compiler/DSK6713(latest)/c6000/bios/include/csl_chiphal.h", line 1240: error #658-D: the modifier "cregister" is not allowed on this declaration
"D:/CCStudio_v5.2/ccsv5/tools/compiler/DSK6713(latest)/c6000/bios/include/csl_chiphal.h", line 1451: error #838: unrecognized cregister name 'FMCR'
"D:/CCStudio_v5.2/ccsv5/tools/compiler/DSK6713(latest)/c6000/bios/include/csl_chiphal.h", line 1451: error #658-D: the modifier "cregister" is not allowed on this declaration
6 errors detected in the compilation of "../c6713dskinit.c".
gmake: *** [c6713dskinit.obj] Error 1
gmake: Target `all' not remade because of errors.
**** Build Finished ******** Build of configuration Debug for project my_sine8LED ****
It has to be something simple, but I'm just not seeing it. The two .c programs are listed below as well...
//sine8_LED.c sine generation with DIP switch control
#include "dsk6713_aic23.h" //codec support
Uint32 fs = DSK6713_AIC23_FREQ_8KHZ; //set sampling rate
#define DSK6713_AIC23_INPUT_MIC 0x0015
#define DSK6713_AIC23_INPUT_LINE 0x0011
Uint16 inputsource=DSK6713_AIC23_INPUT_MIC; //select input
#define LOOPLENGTH 8
short loopindex = 0; //table index
short gain = 10; //gain factor
short sine_table[LOOPLENGTH]={0,707,1000,707,0,-707,-1000,-707}; //sine values
void main()
{
comm_poll(); //init DSK,codec,McBSP
DSK6713_LED_init(); //init LED from BSL
DSK6713_DIP_init(); //init DIP from BSL
while(1) //infinite loop
{
if(DSK6713_DIP_get(0)==0) //=0 if DIP switch #0 pressed
{
DSK6713_LED_on(); //turn LED #0 ON
output_left_sample(sine_table[loopindex++]*gain); //output sample
if (loopindex >= LOOPLENGTH) loopindex = 0; //reset table index
}
else DSK6713_LED_off(0); //turn LED off if not pressed
} //end of while(1) infinite loop
} //end of main
//C6713dskinit.c Includes functions from TI in the C6713 CSL and C6713DSK BSL
#include "C6713dskinit.h"
#define using_bios //if BIOS don't use top of vector table
extern Uint32 fs; //for sampling frequency
extern Uint16 inputsource;
void c6713_dsk_init() //dsp-peripheral initialization
{
DSK6713_init(); //call BSL to init DSK-EMIF,PLL)
hAIC23_handle=DSK6713_AIC23_openCodec(0, &config); //handle(pointer) to codec
DSK6713_AIC23_setFreq(hAIC23_handle, fs); //set sample rate
DSK6713_AIC23_rset(hAIC23_handle, 0x0004, inputsource); // choose mic or line in
MCBSP_config(DSK6713_AIC23_DATAHANDLE,&AIC23CfgData); //interface 32 bits toAIC23
MCBSP_start(DSK6713_AIC23_DATAHANDLE, MCBSP_XMIT_START | MCBSP_RCV_START |
MCBSP_SRGR_START | MCBSP_SRGR_FRAMESYNC, 220); //start data channel again
}
void comm_poll() //added for communication/init using polling
{
poll=1; //1 if using polling
c6713_dsk_init(); //init DSP and codec
}
void comm_intr() //for communication/init using interrupt
{
poll=0; //0 since not polling
IRQ_globalDisable(); //disable interrupts
c6713_dsk_init(); //init DSP and codec
CODECEventId=MCBSP_getXmtEventId(DSK6713_AIC23_codecdatahandle);//McBSP1 Xmit
#ifndef using_bios //do not need to point to vector table
IRQ_setVecs(vectors); //point to the IRQ vector table
#endif //since interrupt vector handles this
IRQ_map(CODECEventId, 11); //map McBSP1 Xmit to INT11
IRQ_reset(CODECEventId); //reset codec INT 11
IRQ_globalEnable(); //globally enable interrupts
IRQ_nmiEnable(); //enable NMI interrupt
IRQ_enable(CODECEventId); //enable CODEC eventXmit INT11
output_sample(0); //start McBSP interrupt outputting a sample
}
void output_sample(int out_data) //for out to Left and Right channels
{
short CHANNEL_data;
AIC_data.uint=0; //clear data structure
AIC_data.uint=out_data; //32-bit data -->data structure
//The existing interface defaults to right channel. To default instead to the
//left channel and use output_sample(short), left and right channels are swapped
//In main source program use LEFT 0 and RIGHT 1 (opposite of what is used here)
CHANNEL_data=AIC_data.channel[RIGHT]; //swap left and right channels
AIC_data.channel[RIGHT]=AIC_data.channel[LEFT];
AIC_data.channel[LEFT]=CHANNEL_data;
if (poll) while(!MCBSP_xrdy(DSK6713_AIC23_DATAHANDLE)); //if ready to transmit
MCBSP_write(DSK6713_AIC23_DATAHANDLE,AIC_data.uint); //write/output data
}
void output_left_sample(short out_data) //for output from left channel
{
AIC_data.uint=0; //clear data structure
AIC_data.channel[LEFT]=out_data; //data from Left channel -->data structure
if (poll) while(!MCBSP_xrdy(DSK6713_AIC23_DATAHANDLE)); //if ready to transmit
MCBSP_write(DSK6713_AIC23_DATAHANDLE,AIC_data.uint); //output left channel
}
void output_right_sample(short out_data) //for output from right channel
{
AIC_data.uint=0; //clear data structure
AIC_data.channel[RIGHT]=out_data; //data from Right channel -->data structure
if (poll) while(!MCBSP_xrdy(DSK6713_AIC23_DATAHANDLE)); //if ready to transmit
MCBSP_write(DSK6713_AIC23_DATAHANDLE,AIC_data.uint); //output right channel
}
Uint32 input_sample() //for 32-bit input
{
short CHANNEL_data;
if (poll) while(!MCBSP_rrdy(DSK6713_AIC23_DATAHANDLE)); //if ready to receive
AIC_data.uint=MCBSP_read(DSK6713_AIC23_DATAHANDLE); //read data
//Swapping left and right channels (see comments in output_sample())
CHANNEL_data=AIC_data.channel[RIGHT]; //swap left and right channel
AIC_data.channel[RIGHT]=AIC_data.channel[LEFT];
AIC_data.channel[LEFT]=CHANNEL_data;
return(AIC_data.uint);
}
short input_left_sample() //input to left channel
{
if (poll) while(!MCBSP_rrdy(DSK6713_AIC23_DATAHANDLE)); //if ready to receive
AIC_data.uint=MCBSP_read(DSK6713_AIC23_DATAHANDLE); //read into left channel
return(AIC_data.channel[LEFT]); //return left channel data
}
short input_right_sample() //input to right channel
{
if (poll) while(!MCBSP_rrdy(DSK6713_AIC23_DATAHANDLE)); //if ready to receive
AIC_data.uint=MCBSP_read(DSK6713_AIC23_DATAHANDLE); //read into right channel
return(AIC_data.channel[RIGHT]); //return right channel data
}