Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Esquema
ndice
0. Objetivos
1. Modelado y simulacin mediante las herramientas software Matlab y Simulink: Caso Practico FPB
2. Arquitecturas de procesado
3. Herramientas software
4. Caso practico I: FPB ensamblador
5. Caso practico II: FPB lenguaje C
0.Objetivos
Ejemplos de Modelado y Simulacin
Arquitecturas DSP ( Familia Texas Instruments)
Herramientas de trabajo con DSP
Ejemplos en tiempo real
1. Caso Practico: Filtro Paso-bajo
1.1 Matlab
memulafpb1.m
1.2 Simulink
emulafpb1.mdl
Diapositiva 19
TMS320C3X
Punto flotante. Arquitectura 32 bits
Hasta 2 Kwords RAM (D+P) on chip
ALU 40 bits, 2 ARAU 24 bits (dir)
Multiplicador 32x32 (40)
Direccionamiento externo: 16M
Diapositiva 21
Diapositiva 22
TMS320C4X
Punto flotante. Arquitectura 32 bits
2 Kwords RAM (D+P) on chip, 128K cache
ALU 40 bits, 2 ARAU 24 bits (dir)
Multiplicador 32x32 (40)
Direccionamiento externo: 4G
6 Puerto serie (28 Mbyte/s), 6 DMA
80 MFLOPS ( 33ns - 40 ns)
Diapositiva 24
TMS320C5X
Punto fijo. Arquitectura 16 bits. JTAG
32 Kwords RAM (D+P) on chip
ALU 32 bits
Multiplicador 16x16
Direccionamiento externo: 192K
1 Puerto serie (12.5 Mbps)
(20-50 MIPS) ( 20ns-50ns)
Diapositiva 26
TMS320C54X (C5000)
Punto fijo. Arquitectura 16 bits. JTAG
32 Kwords RAM (D+P) on chip
ALU 40 bits, Acelerador viterbi
Multiplicador 17x17, 2 ARAU, 6 DMA
Direccionamiento externo: 4M
Diapositiva 31
C6701
Punto flotante. Arquitectura VLIW
1Mbit RAM (D+P) on chip
8 Unidades ( ALU 32/60 + MUL 64/64)
6 instrucciones por ciclo
Direccionamiento externo: 32 bit
2 Puerto serie con buffer, 4 DMA
(1 GFLOPS) ( 6ns).
Diapositiva 33
ltimos avances
C62
300Mhz
2400 MIPS
C64
600-1100 Mhz
4800- 8800 MIPS
2.5 TMS320C31 DSP Starter Kit (DSK)
TM320C31, 40ns, 50MFLOPS, Codec TLC32040 A/D y D/A 14 bits, 20 K (100K). Filtro antiaiasing
y de reconstruccin.
2Kwords (32 bit)
Puerto paralelo. Puerto JTAG (XDS510)
3. Herramientas Software
3.1 Arquitectura funcional
3.2 Compilacin/ enlazado
3.3 Emulacin Software
Code explorer
Code Composer
3.4 Emulacin Hardware (XDS510)
3.5 Simulacin Software
3.6 Code studio / Xexpress
3.1 Arquitectura funcional
3.2 Herramientas T.I.
3.2 Herramientas T.I.
Diapositiva 40
Diapositiva 41
4. Caso practico: FBP ensamblador
4.1 Generacin coeficientes (Matlab)
4.2 Programacin ensamblador
4.3 Ensamblado y enlazado (dsk3a)
4.4 Depuracin (dsk3d, Code explorer)
4.5 Ejecucin
4.1 Generacin de coeficientes
%fdsp.m
%Diseo de un filtro FIR y generacin de coeficientes
%para dsk tms320c31
clear;
N=16;
Wn=0.3;
fs=39062;
h = FIR1(N,Wn,boxcar(N+1));
[H,W] = FREQZ(h,1,1024);
Hlog=10*log10(abs(H)/max(abs(H)));
plot(W*fs/(2*pi),Hlog);
axis([ 0 fs/2 -50 2 ]);
grid;
title('Respuesta en frecuencia');
4.1 Generacin de coeficientes
!del cfir.asm
fid=fopen('cfir.asm','wt');
fprintf(fid,'%s\n\n','FIR_coef');
for i=1:length(h),
fprintf(fid,'%s','
.float ');
fprintf(fid,'%15.14e ;\n',h(i));
end;
fprintf(fid,'%s\n\n','END_coef');
fclose(fid);
.float 3.76947059814026e-002 ;
.float 1.39974313337898e-002 ;
.float -3.10621459899210e-002 ;
.float -6.34152950291409e-002 ;
.float 3.26606731121761e-002 ;
.float 1.50778823925610e-001 ;
.float 2.56520256909381e-001 ;
.float 2.98837537483168e-001 ;
.float 2.56520256909381e-001 ;
.float 1.50778823925610e-001 ;
.float 3.26606731121761e-002 ;
.float -4.65932189848815e-002 ;
.float -6.34152950291409e-002 ;
.float -3.10621459899210e-002 ;
.float 1.39974313337898e-002 ;
.float 3.76947059814026e-002 ;
.set
TB .set 20
RA
.set
RB .set 20
GIE
.set
0x2000
.include "C3XMMRS.ASM"
"AICTEST"
.set
32
;
; Up to N taps data/coef storage
;-----------------------------------------------------------------------ADC_recv .set
.loop
.float
$-2
N-2
0.0
.endloop
;- - - - - - - - - - - - - - - - - - - - - - - - -
.word SZ
; Size of filter
.word
ADC_recv
.word ADC_recv+SZ
ADC_last
.word
FIR_coefx .word
ADC_recv
;
;
FIR_coef
B_REG
C_REG
.word 00000011b
; control
;****************************************************
; Begin main code loop here
;****************************************************
main
or
GIE,ST
ldi 0xF4,IE
b
main
; Turn on INTS
; Enable XINT/RINT/INT2
; Do it again!
;------------------------------DAC2
push ST
push R0
pushf R0
push R2
pushf R2
push AR0
push AR1
mpyf3 *AR0++,*AR1++(1)%,R0
ldf 0.0,R2
ldi @SIZE,RC
subi 2,RC
rptb FIR2
mpyf3 *AR0++,*AR1++(1)%,R0
andn 3,R0
sti R0,@S0_xdata
pop AR1
pop AR0
popf R2
pop R2
popf R0
pop R0
pop ST
reti
push ST
push R3
pushf R3
push AR0
ash -16,R3
ldi @ADC_last,AR0 ;
float R3,R3
stf R3,*AR0++
cmpi @ADC_end,AR0
ldige @ADC_first,AR0 ;
sti AR0,@ADC_last ;
pop AR0
popf R3
pop R3
pop ST
;======================================================;
AIC_INIT LDI 0x10,IE
andn 0x34,IF
ldi 0,R0
sti R0,@S0_xdata
RPTS 0x040
LDI 2,IOF
rpts 0x40
LDI 6,IOF
;--------------------ldi @C_REG,R0
call prog_AIC
ldi 0xfffc ,R0
;
; Program the AIC to be real slow
call prog_AIC
ldi 0xfffc|2,R0
call prog_AIC
ldi @B_REG,R0
call prog_AIC
ldi @A_REG,R0
;
;
;
; Bump up the Fs to final rate
; (smallest divisor should be last)
;
call prog_AIC
b
main
idle
ldi @S0_xdata,R1
or
3,R1
sti R1,@S0_xdata
idle
sti R0,@S0_xdata
idle
andn 3,R1
sti R1,@S0_xdata
.word $
;****************************************************;
.start "SP0VECTS",0x809FC5
.sect
"SP0VECTS"
DAC2
; XINT0
ADC2
; RINT0
0x0080983c nocode
;****************************************************
0x0080983c nocode
0x0080983c nocode
;****************************************************
or
GIE,ST
; Turn on INTS
ldi 0xF4,IE
b
main
; Enable XINT/RINT/INT2
; Do it again!
;-------------------------------
push ST
0x00809840 0x0f200000
push R0
0x00809841 0x0fa00000
pushf R0
0x00809842 0x0f220000
push R2
0x00809843 0x0fa20000
pushf R2
0x00809844 0x0f280000
push AR0
0x00809845 0x0f290000
push AR1
0x00809846 0x08299834
0x00809847 0x08289835
ldi @FIR_coefx,AR0 ;
0x00809849 nocode
0x00809849 0x24e03120 FIR
mpyf3 *AR0++,*AR1++(1)%,R0
0x0080984a 0x07628000
ldf 0.0,R2
0x0080984b 0x083b9831
ldi @SIZE,RC
0x0080984c 0x187b0002
subi 2,RC
0x0080984d 0x6480984e
rptb FIR2
0x0080984e 0x80103120
mpyf3 *AR0++,*AR1++(1)%,R0
0x0080984e parcode
0x0080984f 0x01800002
addf R2,R0
0x00809850 nocode
0x00809850 0x05000000
fix R0,R0
h1=h(1:orden);
h2=h(orden+1);
fid=fopen('c:\dsk\ejemplos_c\fir1\coef1.c','wt');
fprintf(fid,'%s\n','float coef[17] = { ');
fprintf(fid,'%15.14e,\n',h1);
fprintf(fid,'%15.14e};\n\n',h2);
fclose(fid);
5.1 Modulo respuesta: fc=2500 Hz
5.2 Coef1.c
5.2 Filtro1_16.c (1)
5.2 Filtro1_16.c (2)
5.2 Filtro1_16.c (3)
5.2 Filtro1_16.c (4)
5.2 Filtro1_16.c (5)
5.2 Filtro1_16.c (6)
5.2 filtro1_16.c (7)
void main(void)
{
float f;
int i;
for(;;)
{
asm(" idle
");
f = Input();
*/
/* Output result
*/
*/
}
}
/* INTERNAL BLK 0 */
/* INTERNAL BLK 1 */
/* INTERNAL BLK 1 */
/* INTERNAL BLK 1 */
SECTIONS
{ .text : {} > RAM0
.cinit : {} > RAM1
.data : {} > RAM1
.bss
: {} > RAM1
Version 5.11
*********************************************************
origin
length
used
RAM1