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.

TMS320F280049C: Loading Program for Flash vs RAM

Part Number: TMS320F280049C

Hi, I am generating a sine wave using DACA of a certain frequency. Sine table consists of 10 samples. I am a little bit confused that when I program the code in flash i get a different frequency at output and when I program the same code in RAM I should get the same frequency because the code is same, instead, I get a different frequency for the same code. Please guide me why is this happening.

  • Qasim,

    Please note that RAM is 0-wait stated memory where as Flash accesses incur few wait-states - this can be the reason.

    Please see Table 5.9.4 Flash Parameters in datasheet www.ti.com/.../tms320f280049.pdf.

    Hope you configured the wait-states correctly (RWAIT bit field in FRDCNTL Register) as per the operating frequency. Please check.

    Make sure you enable prefetch (FRD_INTF_CTRL). This helps to balance the delay from wait-states for linear code.

    Thanks and regards,
    Vamsi
  • I would check into these. But as the frequency of the sine wave is the function of delay between two samples. Now the delay remains and I have confirmed it from the oscilloscope that if the timer is configured for 2us then it exactly triggers after 2us for both cases.

    This is the pseudo code

    while(1)
    { 
    
    while(!timerFlag);\\let say that timer rises an interrupts each 2us
    setDACshadowvalue
    
    }

  • Qasim,

    Ok, please check and let us know if you have further questions.

    As you know, you can execute ISR from RAM as needed.

    Thanks and regards,
    Vamsi