AnsweredAssumed Answered

PLL initilization of BF531 in SPI boot mode

Question asked by Bora on Apr 27, 2010
Latest reply on Apr 28, 2010 by Bora

Hi,

 

I managed to configure SDRAM and initilize some big arrays in SDRAM before call of "main" in both with debugger environment (by modifiying XML file) and in SPI booting mode (by writting initilizing DXE in ASM).

 

Now I want to initlize PLL in SPI boot mode, and I am not using internal voltage regulator.

 

As you pointed out I looked ..\VisualDSP50\Blackfin\ldr\init_code

but I am a little bit confused. I need a simple PLL initilization code in ASM like the one below;

 

This code stucks somewhere and DSP can not start!

 

What is wrong with this code? Could someone send me a working one?

 

Best regards,

Bora Dikmen

 

 

 

#include <defBF531.h>

 

.section program;

 

/*******Pre-Init Section*********************************************/
    [--SP] = ASTAT;        //save registers onto stack
    [--SP] = RETS;
    [--SP] = (R7:0);
    [--SP] = (P5:0);
/********************************************************************/

 

Setup_PLL:

 

    P0.L = SIC_IWR & 0xFFFF;          // enable PLL wakeup
    P0.H = (SIC_IWR >> 16) & 0xFFFF;       
    R0 = 0x0001(Z);
    W[P0] = R0;                       
    SSYNC;   

 

    P0.L = PLL_DIV & 0xFFFF;           
    P0.H = (PLL_DIV >> 16) & 0xFFFF;
    R0 = 0x0004(Z);
    W[P0] = R0;
    SSYNC;       

 

    P0.L = PLL_CTL & 0xFFFF;           
    P0.H = (PLL_CTL >> 16) & 0xFFFF;
    R0 = 0x4000(Z);
    W[P0] = R0;
    SSYNC;   
   
    IDLE;
   
/*******Post-Init Section********************************************/

 

DONE:
    (P5:0) = [SP++];      // Restore Regs
    (R7:0) = [SP++];
    RETS = [SP++];
    ASTAT = [SP++];

 

    RTS;

Outcomes