DSK 6713 and
TMS320C6713
STDS - Sistemas de Telecomunicações
Definidos por Software
PSTR – Processamento de Sinal em Tempo Real
Goals and Summary• Goals
• DSP TMS320C6713: main features and integrated development environment
• Summary
• The TMS320C6x processors family
• DSK- Developers Starter Kit C6713
• BSL – Board Support Library
• IDE – Integrated Development Environment
• Some software examples
Inverno 2017/2018 2
TMS320C67x processor family
• Floating-point DSP
• High performance DSP: several instructions on a single clock
• Audio, image, instrumentation and control applications
• Texas Instruments: “These devices are ideal forprofessional audio products, mixers, audio synthesis,instrument / amplifier modeling, audio conferencing andbroadcast; biometrics, medical, industrial, digital imaging,speech recognition and voice-over packet.”
Inverno 2017/2018 3
TMS320C6713 Processor
• Load Store Architecture (32 registers)
• VLIW – Very Long Instruction Word, several 32 bit instructions, on a single clock cycle (up to 8 instructions)
• 225 MHz clock frequency
• Each cycle lasts 4.4 ns
• Executes up to:
• 1800 MIPS (Million Integer Operations per Second)
• 1350 MFLOPS (Million Floating-Point Operations per Second)
Inverno 2017/2018 4
DSK 6713 – DSP Starter Kit
Inverno 2017/2018 5
Daughter CardDaughter Card
Roomfor
Expansion
Internal
Memory
(192 kB)CPU
ProgramCache
DataCache
EMIF
SDRAM(8/16 MB)
CE2
CE3
Flash ROM(256 kB)
I/O Port
CE1
CE0
DSK 6713 – DSP Starter Kit
Inverno 2017/2018 6
DSK 6713 – DSP Starter Kit
Inverno 2017/2018 7
DSK 6713 – DSP Starter Kit• Developed by both Texas Instruments and
Spectrum Digital
• Main building blocks:• TMS320C6713 processor at 225 MHz (192 Kb of
internal RAM) • CPLD – Complex Programmable Logic Device (CPLD)• SDRAM – Synchronous Dynamic RAM (8 MB / 16 MB)• Flash – 512 kB • AIC23 – ADC e DAC, two stereo analog channels, with
sampling frequency from 8 kHz up to 96 kHz• 4 DIP switch and 4 LED• JTAG Interface for Target-Host communication
Inverno 2017/2018 8
DSK 6713 – DSP Starter Kit
• Analog interface:
• 2 analog stereo channels – microphone and line
• Sampling frequency ranges from 8 kHz up to 96 kHz
• Input and output interfaces:
• Input - 4 DIP switch
• Output - 4 LED
Inverno 2017/2018 9
BSL – Board Support Library
• API written in ‘C’
• Interface with DSK peripherals
• It has five internal modules:• Board Setup – Main Board
• Codec – AIC23 (ADC and DAC) configuration
• DIP – DIP switches read
• LED - Write on the LED
• Flash - Flash Programming
Inverno 2017/2018 10
BSL – Board Support Library
• Board Setup – board initialization
• DSK6713_init() Initialize the 6713 DSK
• DSK6713_rget() Read a 16-bit value from a CPLD register
• DSK6713_rset() Write a 16-bit value to a CPLD register
• DSK6713_version() Get the DSK version
• DSK6713_wait() Spin in a software delay loop
• DSK6713_waitusec() Spin in a software delay loop (microseconds)
• Prototypes in file "dsk6713.h"
Inverno 2017/2018 11
AIC23 – Analog Interface Controler
Inverno 2017/2018 12
ADC and DAC on the same chip 2 analog stereo channels, with sampling frequencies from 8 kHz up to 96 kHz McBSP0 for command data and McBSP1 for user data
CODEC – AIC23 - Features
• Two analog stereo channels
• Pre-amplification stage for microphone input
• Loudspeaker direct connection
• Sampling frequencies in the set: 8, 16, 24, 32, 44, 48, and 96 kHz
• Quantization with 16, 20, 24, or 32 bit
Inverno 2017/2018 13
CODEC – AIC23 - Interface
• DSK6713_AIC23_openCodec() Get and handle to the CODEC• DSK6713_AIC23_closeCodec() Release an handle• DSK6713_AIC23_config() CODEC configuration (sampling rate)• DSK6713_AIC23_read() Read a 32 bit data word• DSK6713_AIC23_write() Write a 32 bit data word• DSK6713_AIC23_setFreq() Set the sampling frequency
• DSK6713_AIC23_rset() Write on a control register• DSK6713_AIC23_rget() Read a control register value• DSK6713_AIC23_outGain() Set the output gain• DSK6713_AIC23_loopback() Enable/disable the loop-back mode• DSK6713_AIC23_mute() Enable/disable the mute mode• DSK6713_AIC23_powerDown() Enable/disable the powerdown mode
Inverno 2017/2018 14
Prototypes in file "dsk6713_aic23.h"
DIP-Switch and LED - Interface
• DIP
• DSK6713_DIP_init() Initialize the DIP switch
• DSK6713_DIP_get() Read the DIP switch
• LED
• DSK6713_LED_init() LED initialization
• DSK6713_LED_off() Turn off a given LED
• DSK6713_LED_on() Turn on a given LED
• DSK6713_LED_toggle() Toggle a given LED state
Inverno 2017/2018 15
Prototypes in files "dsk6713_dip.h“ and "dsk6713_led.h“, respectively
Sample Programs/Projects
1. IdentityPolling• y[n]=x[n] operation, with polling
2. IdentityInterrupt• y[n]=x[n] operation, with an interrupt routine
3. Led DIP • Example of the use of the LED and DIP Switch
4. SinusoidalGenerator• Example of sinusoidal generator, with a 2 kHz sinusoid
Inverno 2017/2018 16
1 - IdentityPolling – main program
int main(){
DSK6713_AIC23_CodecHandle hCodec; // Handle para o AIC.Int16 xl, xr, yl, yr; // Amostra de entrada e de saída
DSK6713_init(); // Iniciar a BSL (Board Support Library). //hCodec = DSK6713_AIC23_openCodec(0, &config_LINE ); // Programar ADC e DAChCodec = DSK6713_AIC23_openCodec(0, &config_MIC ); //DSK6713_AIC23_setFreq( hCodec, DSK6713_AIC23_FREQ_32KHZ );
for ( ; ; ) { // Leitura do canal esquerdo e do canal direito.xl = (Int16) MCBSP_read(DSK6713_AIC23_DATAHANDLE);xr = (Int16) MCBSP_read(DSK6713_AIC23_DATAHANDLE); // Eco.yl = xl; yr = xr;// Escrita do canal esquerdo e do canal direito.MCBSP_write(DSK6713_AIC23_DATAHANDLE, yl);MCBSP_write(DSK6713_AIC23_DATAHANDLE, yr);
}// Fechar o codec.//DSK6713_AIC23_closeCodec(hCodec); //return 0;
}
Inverno 2017/2018 17
1 - IdentityPolling – setup the AIC23 codec#include "dsk6713.h"#include "dsk6713_aic23.h"
// Codec configuration settingsDSK6713_AIC23_Config config_LINE = { \
0x0017, /* 0 DSK6713_AIC23_LEFTINVOL Left line input channel volume */ \0x0017, /* 1 DSK6713_AIC23_RIGHTINVOL Right line input channel volume */ \0x00d8, /* 2 DSK6713_AIC23_LEFTHPVOL Left channel headphone volume */ \0x00d8, /* 3 DSK6713_AIC23_RIGHTHPVOL Right channel headphone volume */ \0x0012, /* 4 DSK6713_AIC23_ANAPATH Analog audio path control - LINE */ \0x0000, /* 5 DSK6713_AIC23_DIGPATH Digital audio path control */ \0x0000, /* 6 DSK6713_AIC23_POWERDOWN Power down control */ \0x0043, /* 7 DSK6713_AIC23_DIGIF Digital audio interface format */ \0x0081, /* 8 DSK6713_AIC23_SAMPLERATE Sample rate control */ \0x0001 /* 9 DSK6713_AIC23_DIGACT Digital interface activation */ \
};
int main(){
DSK6713_AIC23_CodecHandle hCodec; // Handle for AIC23.DSK6713_init(); // Initialize BSL (Board Support Library).
hCodec = DSK6713_AIC23_openCodec(0, &config_LINE ); // Setup AIC23....
Inverno 2017/2018 18
2 - IdentityInterrupt – main programinterrupt void serialPortRcvISR(void);float volumeGain;
void main(){
DSK6713_AIC23_CodecHandle hCodec;DSK6713_init(); // Initialize the board support library, must be called first
hCodec = DSK6713_AIC23_openCodec(0, &config_MIC);
MCBSP_FSETS(SPCR1, RINTM, FRM);MCBSP_FSETS(SPCR1, XINTM, FRM);MCBSP_FSETS(RCR1, RWDLEN1, 16BIT);MCBSP_FSETS(XCR1, XWDLEN1, 16BIT);
volumeGain = 0.5;
IRQ_globalDisable(); // Globally disables interruptsIRQ_nmiEnable(); // Enables the NMI interruptIRQ_map(IRQ_EVT_RINT1,15); // Maps an event to a physical interruptIRQ_enable(IRQ_EVT_RINT1); // Enables the eventIRQ_globalEnable(); // Globally enables interrupts
while(1) { }}
Inverno 2017/2018 19
2 – IdentityInterrupt – interrupt routine detailinterrupt void serialPortRcvISR(){
Int16 xl, xr, yl, yr;// Leitura do canal esquerdo e do canal direito.xl = (Int16) MCBSP_read(DSK6713_AIC23_DATAHANDLE);xr = (Int16) MCBSP_read(DSK6713_AIC23_DATAHANDLE);// Eco.yl = xl; yr = xr; // Escrita do canal esquerdo e do canal direito.MCBSP_write(DSK6713_AIC23_DATAHANDLE, yl);MCBSP_write(DSK6713_AIC23_DATAHANDLE, yr);
}
Inverno 2017/2018 20
.ref _c_int00
.ref _serialPortRcvISR ; refer the address of ISR defined in C
.sect "vectors"
……
INT15: MVKL .S2 _serialPortRcvISR, B0MVKH .S2 _serialPortRcvISR, B0B .S2 B05*NOP
Vectors.asm
Set the interrupt routine (written in ‘C’) to the entry number 15.
3 - DIP and LED usage#include "dsk6713.h"#include "dsk6713_led.h"#include "dsk6713_dip.h"
void main(){
DSK6713_init(); // Initialize the board support library, must be first BSL callDSK6713_LED_init(); // Initialize the LED and DIP switch modules of the BSLDSK6713_DIP_init();
while(1) {DSK6713_LED_toggle(0); // Toggle LED #0
// Check DIP switch #3 and light LED #3 accordingly, 0 = switch pressedif (DSK6713_DIP_get(3) == 0)
// Switch pressed, turn LED #3 onDSK6713_LED_on(3);
else// Switch not pressed, turn LED #3 off */DSK6713_LED_off(3);
// Spin in a software delay loop for about 200msDSK6713_waitusec(200000);
} }
Inverno 2017/2018 21
4 – Sinusoidal Generator
#include "dsk6713.h"…..
int main()
{
Int16 y[4] = { 10000, 0, -10000, 0 };
Int16 i=0;
DSK6713_AIC23_setFreq( hCodec, DSK6713_AIC23_FREQ_8KHZ );
…..
for ( ; ; ) {
while ( !DSK6713_AIC23_read(hCodec, &xl) );
while ( !DSK6713_AIC23_read(hCodec, &xr) );
while ( !DSK6713_AIC23_write(hCodec, y[i]) );
while ( !DSK6713_AIC23_write(hCodec, y[i]) );
if (++i==4)
i=0;
}
return 0;
}Inverno 2017/2018 22
Code Composer Studio V6
Inverno 2017/2018 23
Bibliography
• Technical data sheets:
• TMS320C6713C - Tms320c6713.pdf
• DSK6713 - Dsk6713_TechRef.pdf
• BSL - BSL API.pdf
• AIC23 - Tlv320aic23b manual.pdf
• Code Composer - CC_Manual.pdf
Inverno 2017/2018 24