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.

Flashed Program Slow

So we've been working with FFT Filter Demo for an audio-relate project we are working on and we loaded the built .out file as .bin through hex55.exe (v4.3.5) and Programmer_USBKit.out. 

For some reason, audio we are getting is choppy/slow and we tried adding GEL codes to our project and also tried specifying

#define PLL_100MHZ 1

Any comments or steps to have properly flash audio projects?

 

  • Hi Butters,

    You have discovered a small bug in the FFT filter Demo. I apologize and thank you for your patience.

    None of the PLL #defines are actually defined when the PLL_98MHz() and  InitSystem() functions are called.

    To fix this bug, define either PLL_98M or PLL_100M to 1 at the top of main.c

    At the top of main.c:

    #define PLL_98M 1

    OR

    #define PLL_100M 1


    I have tested both fixes booting from the SPI EEPROM on the C5505 EZDSP. Both fixes produces good results.

    I will upload a fixed version to the Open Source EZDSP website.

    Thanks,
    Mark

  • Thanks for the reply Mark

    Three questions:

    1. So what exactly is PLL_98M function in the main is for?

    2. For general EEPROM programming, how does the GEL-to-C work?

    I wrote the following codes based on GEL description:

    flash_routines.c

    #include "flash_routines.h"

    void DoFlashInitialization() {

    OnTargetConnect();

    }

    /*--------------------------------------------------------------*/

    /* OnTargetConnect() -- this function is called after a target  */

    /* connect.                                                     */

    /*--------------------------------------------------------------*/

    void OnTargetConnect()

    {

        //GEL_Reset();

       // Peripheral_Reset();

        ProgramPLL_100MHz();

        //GEL_TextOut("Target Connection Complete.\n"); 

    }

     

    /*--------------------------------------------------------------*/

    /* OnRestart()                                                  */

    /* This function is executed before a file is restarted. Disable*/

    /* interrupts and DMA from the current program so pending       */

    /* events and transfers don't interfere with the new program.   */

    /*--------------------------------------------------------------*/

    //void OnRestart()

    //{

    //    /* Disable interrupts */

    //    *(int*)0x0003 = *(int*)0x0003 | 0x0800; // Set INTM

    //    *(int*)0x0000 = 0;      // Clear IER0

    //    *(int*)0x0000 = 0;      // Clear IER1

    //}

     

    /*--------------------------------------------------------------*/

    /* OnReset()                                                    */

    /* This function is called by CCS when you do Debug->Resest.    */

    /* The goal is to put the C55xx into a known good state with    */

    /* respect to cache, dma and interrupts.                        */

    /*--------------------------------------------------------------*/

    void OnReset( int nErrorCode )

    {

    }

     

    /*--------------------------------------------------------------*/

    /* OnFileLoaded()                                               */

    /* This function is called by CCS when you do File->Load Program*/

    /* The goal is to do in post file loaded configuration that may */

    /* be needed.                                                   */

    /*--------------------------------------------------------------*/

    void OnFileLoaded()

    {

    }

     

    // Reset Peripheral?

    void Peripheral_Reset()

    {

        int i;

     

        *(short *)PSRCR = 0x0020;

        *(short *)PRCR  = 0x00BB;

     

        for(i=0;i<0xff;i++);

        *(short *)IVPD = 0x027F; // Load interrupt vector pointer

    }

     

     

    // Set the Clock to 100MHz

    void ProgramPLL_100MHz() {

        int i;

     

        /* Enable clocks to all peripherals */

        *(short *)PCGCR1 = 0x0;

        *(short *)PCGCR2 = 0x0;

     

        /* Bypass PLL */

        *(short *)CCR2 = 0x0;

     

        /* Set CLR_CNTL = 0 */

        *(short *)CGCR1 = *(short *)CGCR1 & 0x7FFF;

     

        *(short *)CGCR2 = 0x8000;

        *(short *)CGCR4 = 0x0000;

        *(short *)CGCR3 = 0x0806;

        *(short *)CGCR1 = 0x82fa; 

     

        /* Wait for PLL lock */

        for(i=0;i<0x7fff;i++);

     

        /* Switch to PLL clk */ 

        *(short *)CCR2 = 0x1;

    }

    flash_routines.h

    #ifndef FLASH_ROUTINES_H_

    #define FLASH_ROUTINES_H_

    #define ESCR     0x1c33

    #define SDTIMR1  0x1020 

    #define SDTIMR2  0x1021 

    #define SDCR1    0x1008 

    #define SDCR2    0x1009

    #define SDSRETR  0x103C

    #define SDRCR    0x100C

    #define PRCR     0x1C05 

    #define PCGCR1   0x1c02

    #define PCGCR2   0x1c03

    #define PSRCR    0x1c04 

    #define CCR2     0x1c1f

    #define CGCR1    0x1c20

    #define CGCR2    0x1c21

    #define CGCR3    0x1c22

    #define CGCR4    0x1c23

    #define CCSSR    0x1c24

    #define IVPD     0x0049

     

     

    void DoFlashInitialization(void);

    void OnTargetConnect(void);

    void OnRestart(void);

    void OnReset(int);

    void onFileReload(void);

    void Peripheral_Reset(void);

    void ProgramPLL_100MHz(void);

    #endif /*FLASH_ROUTINES_H_*/

    Then in main,
    I have the following:
    main.c
    ....
    #define FLASH 1
    #define PLL_100M 1
    #define PLL_12M 0
    #define PLL_98M 0
    ......
    void main(){
    ....
    InitSystem();
    ....
    ConfigPort();
    #if FLASH
       DoFlashInitialization();
    #endif
    .....
    I tried commenting out Peripheral_Reset and Uncommenting it, but makes no difference.
    Is there anything wrong with GEL-to-C Conversion I made?
    Thank you