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.

C6713B (from Dmodule 6713) - PLL register initialization problem

Other Parts Discussed in Thread: TMS320C6713B

Hello,

I am currently working with a TMS320C6713B embedded on a module. I wish to initialize my PLL to set a frequency of 75Mhz, or less, for my EMIF.
 The problem is that my PLL initialization C code does not modify some registers (PLLCSR and PLLM)

Here is the code I'm using:


/* from the module BIOS - please note that the BIOS was written by the company Dsignt, who made the module, so the error is not likely from there */

typedef struct
{
    volatile unsigned int pllpid;
    int rsvd1[0x3F];
    volatile unsigned int pllcsr;
    int rsvd2[0x03];
    volatile unsigned int pllm;
    volatile unsigned int plldiv0;
    volatile unsigned int plldiv1;
    volatile unsigned int plldiv2;
    volatile unsigned int plldiv3;
    volatile unsigned int oscdiv1;
} dsp_pll_struct;
#define PLL ((dsp_pll_struct *) ((int*) 0x01B7C000))

 

From my main code - config.c:

 

void main (void)
{
    int i=0;

/* Initialiser PLL - clock used is the on board oscillator */
    PLL->pllcsr&=~(0x1<<0);    //set bit 0 to 0 - pllen = 0
    //wait 4 cycles of slowest clk signal.
    for(i = 0; i<20; i++); //this should be enough for the wait
    PLL->pllcsr|=(0x1<<3); //set pllrst to 1
    PLL->pllm|=(0x2<<0);    //oscin*2 = 450mhz
    PLL->plldiv0|=(0x1<<15); //enable plldiv0
    PLL->plldiv0|=(0x3<<0);    //pllout=450/3=150mhz
    for(i = 0; i<20; i++);     //wait 4 cycles of slowest clk signal.
    PLL->plldiv3|=(0x1<<15); //enable plldiv3 - clock for emif
    PLL->plldiv3|=(0x4<<0);    //sysclk3=pllout/4=37.5mhz
    for(i = 0; i<20; i++); //wait 4 cycles
    while(PLL->pllcsr&0x64!=1);    //wait for pll stable
    PLL->pllcsr&=(0x0<<1); //pll operational
    PLL->pllcsr&=~(0x1<<3);    //set pllrst to 0
    //Wait for pll to lock. max pll lock time = 187.5us
    for(i = 0; i<20; i++);
    PLL->pllcsr|=(0x1<<0);    //pllen = 1
/* Fin init PLL */

(Rest of code)

}

 

As you can see, I think I followed step by step the PLL initialization guide from the TI datasheet... Can somebody point out if there is a mistake?


Thank you very much.

Thibault

  • Hi,

    We will work on your request and will update you shortly.

    Thanks & regards,
    Sivaraj K
  • Hi, I also forgot to add some details about the debugger. I'm not using CCS but Trace32 Powerview, but it works the same I believe.
    When I execute my code via debugger, I will get an abort code exception if I try to run a for loop. However if I execute the same loop step by step, no problem.
    Thank you for your help.
  • Dear Thibault,

    I have attached the blink code for C6713 (which has PLL and EMIF setup code)

    4034.BlinkDSK6713.zip

    I hope this helps.

    Please let me know if doesn't help.

  • Good morning and thank you for your code. I found the answer to my problem and it was due to my debugger and not the code itself.
    I also have another question but on a later part of my code; should I open a new topic for it?

    If not, I want to write data on my external asynchronous memory interface, specifically on my Iosel address (0x90300000) with this code:

    volatile unsigned int U32_addressBusData = 0x0;
    volatile unsigned int* U32_outaddress = 0x0;
    *U32_outaddress=0x0;

    for(U32_addressBusData =0; U32_addressBusData <65535; U32_addressBusData++)
    {
    U32_outaddress = (volatile unsigned int*)(U32_addressBusData*4+IOSEL_BASE);
    *U32_outaddress = U32_addressBusData;
    }

    So u32_outAddress updates just fine, but *u32_outaddress does not. Also my CE0 bit that shows access to IOSEL remains high (it should be low).

    Again if I should open a topic for this please tell me.

    Thank you in advance
    II