Sign in

username:

password:



Not a member?

Search c54x



Search tips

Subscribe to c54x



c54x by Keywords

5409 | 5416 | AD5 | ADC | BIOS | Boot | Booting | Bootloader | C540 | C5402 | C5409 | C5416 | CCS | Codec | DMA | Dmad | DSK | DSKPlus | Dsplib | EVM | FFT | FIR | Flash | GPIO | HPI | Initialization | Interrupt | JTAG | LOG_printf | MCBSP | RFFT | RTDX | Sampling | STLM | UART | VC540

Discussion Groups

Discussion Groups | TMS320C54x | problem regarding conversion from float to Q15

Technical discussions about the TI C54x DSPs (including the c5401, c5402, c5402a, c5404, c5407, c5409, c5409a, c5410, c5410a, c5416, c5420, c5421, c5441, c549, c5470 and c5471).

  

Post a new Thread

problem regarding conversion from float to Q15 - megha daga - May 16 7:45:11 2006



   Hi
I am working on a code to convert float to Q15. I am working with just 4 samples. I have stored
the 4 coefficients in coeff[4]. the converted value is going to get stored in h[4]. I am using
the following command:
#pragma DATA_SECTION(h,".coeffs")
DATA h[NH];
and I am getting following warning:
warning: creating output section .coeffs without SECTIONS specification
The program is getting loaded but i wanted to know why its occuring and how to remove. I am
using .cdb to allocate memory. So I am not making the cmd file, its automatically generating
via .cdb
Another thing is when I ran my prog to convert float to Q15 (just 4 samples), Its not
converting and going into an infinite loop. I checked the disassembly code:
 0000:4313      _fltoq15
 0000:4313 4A06      PSHM  TC
 0000:4314 4A07      PSHM  OVM
 0000:4315 F4BA      RSBX  OVA
 0000:4316 F4B9      RSBX  OVB
 0000:4317 EEF3      FRAME -13
 0000:4318 F6B8      RSBX  SXM
 0000:4319 8812      STLM  A,AR2
 0000:431A 7110      MVDK  *SP(10h),13h
 0000:431C 1111      LD    *SP(11h),B
 0000:431D F310      SUB   #1h,0,B,B
 0000:431F 891A      STLM  B,BRC
 0000:4320 7605      ST    #7fh,*SP(5h)
 0000:4322 7606      ST    #0fh,*SP(6h)
 0000:4324 F162       LD    #8000h,16,B
 0000:4326 8307      STH   B,*SP(7h)
 0000:4327 F793      CMPL  B,B
 0000:4328 4F00      DST   B,*SP(0h)
 0000:4329 7607      ST    #8000h,*SP(7h)
 0000:432B 7608      ST    #1h,*SP(8h)
 0000:432D 7609      ST    #7fffh,*SP(9h)
 0000:432F F272      RPTBD 4360h
 0000:4331 5692      DLD   *AR2+,A
 0000:4332 F495      NOP   
 0000:4333      loop_start
 0000:4333 F163      AND   #8000h,16,A,B
 0000:4335 830B      STH   B,*SP(0bh)
 0000:4336 5700      DLD   *SP(0h),B
 0000:4337 F280      AND   B,0,A
 0000:4338 F845      BC    zero,AEQ
 0000:433A F163      AND   #7f80h,16,A,B
 0000:433C 6FF8      LD    *(0ch),-7,B
 0000:433F 0905      SUB   *SP(5h),B
 0000:4340 F84A      BC    too_large,BGEQ
 0000:4342 8103      STL   B,*SP(3h)
 0000:4343 F785      ABS   B,B
 0000:4344 0906      SUB   *SP(6h),B
 0000:4345 F84E      BC    too_small,BGT
 0000:4347 110B      LD    *SP(0bh),B
 0000:4348 F479      SFTA  A,-7,A
 0000:4349 6FF8      LD     *(A),-1,A
 0000:434C 3203      LD    *SP(3h),ASM
 0000:434D 1A07      OR    *SP(7h),A
 0000:434E F482      LD    A,ASM,A
 0000:434F FD4C      XC    1,BNEQ
 0000:4350 F484      NEG   A,A
 0000:4351 F073      B     store_result
 0000:4353      too_small
 0000:4353 760A      ST    #2h,*SP(0ah)
 0000:4355      zero
 0000:4355 F273      BD    store_result
 0000:4357 E800      LD    #0h,A
 0000:4358 F495      NOP   
 0000:4359      too_large
  0000:4359 110B      LD    *SP(0bh),B
 0000:435A 7604      ST    #1h,*SP(4h)
 0000:435C 1009      LD    *SP(9h),A
 0000:435D FD4E      XC    1,BGT
 0000:435E 0008      ADD   *SP(8h),A
 0000:435F      store_result
 0000:435F 8093       STL   A,*AR3+
 0000:4360 5692      DLD   *AR2+,A
 0000:4361      end_loop, Epilogue
 0000:4361 1004      LD    *SP(4h),A
 0000:4362 1A0A      OR    *SP(0ah),A
 0000:4363 EE0D      FRAME 13
 0000:4364 8A07      POPM  OVM
 0000:4365  8A06      POPM  TC
 0000:4366 FC00      RET   
 In this I saw that the loop is not ending. Its not going to end_loop after 4 counts. After 4
counts it continues inside the loop and  is jumping to _zero  in every loop. 
Kindly suggest something for that. I am checking the values, but am getting nothing.
Kindly reply.
Thanking You
Megha Daga
		


(You need to be a member of c54x -- send a blank email to c54x-subscribe@yahoogroups.com )