This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

  • Resolved

Compiler: Alternative for the FOR loop

Intellectual 295 points

Replies: 7

Views: 179

Tool/software: TI C/C++ Compiler

Hi,

I am running a FOR loop for 120 times and moving the data for every 1ms in [120] size array.  It is taking too much time while running from FLASH. I am not able to run it from RAM as I don't have enough space for it. Can you suggest any alternative for the FOR loop to reduce the running time to accomplish the above task?

  • Do you have optimization turned on?

    Your next step is probably assembler.

  • In reply to Keith Barkley:

    In your other posts, you show you are working with a C28x system.  Is that the case here?

    Thanks and regards,

    -George


    TI C/C++ Compiler Forum Moderator
    Please click This Resolved My Issue on the best reply to your question
    The CCS Youtube Channel
     has short how-to videos
    The 
    Compiler Wiki answers most common questions
    Track an issue with SDOWP. Enter your bug id in the Search box.

  • In reply to George Mock:

    Yes, i am working on C28x system.
    How assembler reduce time-consuming by the FOR loop from "C" ??
    I dont want do optimization turned on, as i am using boot loader if I use optimization which effects the boot loader.
  • In reply to harish boyina:

    harish boyina
    I dont want do optimization turned on

    The only other alternative is to manually write it in assembly code.

    Thanks and regards,

    -George


    TI C/C++ Compiler Forum Moderator
    Please click This Resolved My Issue on the best reply to your question
    The CCS Youtube Channel
     has short how-to videos
    The 
    Compiler Wiki answers most common questions
    Track an issue with SDOWP. Enter your bug id in the Search box.

  • In reply to George Mock:

    Hi Mock,
    I am not much familiar with assembly program, can you send piece of code for the FOR loop for C28x or can you refer any document?
  • In reply to harish boyina:

    Hi,

    Instruction Set for C28x you find here http://www.ti.com/lit/ug/spru430f/spru430f.pdf. It may be useful instructions like a LOOPNZ, LOOPZ, BANZ, etc.

    Jan


    Please click to "Verify Answer", if your question was answered.

  • In reply to harish boyina:

    harish boyina
    I am not much familiar with assembly program, can you send piece of code for the FOR loop for C28x or can you refer any document?

    Please consider installing C2000Ware.  It contains many examples of C28x assembly code.  Search for the files with the extension .asm.

    Thanks and regards,

    -George


    TI C/C++ Compiler Forum Moderator
    Please click This Resolved My Issue on the best reply to your question
    The CCS Youtube Channel
     has short how-to videos
    The 
    Compiler Wiki answers most common questions
    Track an issue with SDOWP. Enter your bug id in the Search box.

This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.