AnsweredAssumed Answered

bfrom_SysControl() throws an exception in BF547 Simulation mode

Question asked by Gana1970 on Nov 15, 2016
Latest reply on Nov 21, 2016 by Jithul_Janardhanan

Hi:

 

I am using the following code to set the PLL frequency to be 6 times the input clock. In simulation mode the VisualDSP++ 5.1.2 throws an exception saying that "Exception: #8 UNDEFINST:Undefined Instruction at PC 0xef000038" and halts. The exception happens in the bfrom  function bfrom_SysControl().

 

--------------------------------------------

#include <ccblkfn.h>
#include <bfrom.h>
#include <cdefBF547.h>

void setPLL(float clk) {

unsigned int Flag;
clk = 480;

ADI_SYSCTRL_VALUES pllControl, myStruct2;

//pllControl.uwVrCtl = 0x40FB; // Default=0x40FB - removed CLKBUFOE (00FB) - clock in buffer
/* Set MSEL = 0-63 --> VCO = CLKIN*MSEL */
pllControl.uwPllCtl = SET_MSEL(6) ;
/* Set SSEL = 1-15 --> SCLK = VCO/SSEL */
/* CCLK = VCO / 1 */
pllControl.uwPllDiv = SET_SSEL(1) | CSEL_DIV1 ; // SSEL[3:0]=1, CSEL[1:0]=0;
pllControl.uwPllLockCnt = 0x0200;

Flag = bfrom_SysControl( SYSCTRL_INTVOLTAGE | SYSCTRL_PLLCTL |
                                          SYSCTRL_PLLDIV | SYSCTRL_LOCKCNT | SYSCTRL_WRITE, &pllControl, NULL );


// Read back and check whether set correctly
Flag = bfrom_SysControl(SYSCTRL_PLLCTL| SYSCTRL_PLLDIV| SYSCTRL_READ, &myStruct2, NULL);
}

Outcomes