Setting up the PLL on a single tile Topic is solved

If you have a simple question and just want an answer.
User avatar
140dB
Member
Posts: 10
Joined: Fri Nov 07, 2014 1:30 pm

Setting up the PLL on a single tile

Post by 140dB »

Hello All,

I am trying to set the PLL Control register on my slice kit (XP-SKC-L2) and having some trouble. Here is the snippet that I am running. I put some printf statements in for some feedback on what data is actually in the PLL_CTRL_REG. My external crystal is 25MHz which came on the kit. 

//Set OD = 5, set R = 40, set F =1

#define PLL_CTRL_INPUT_100kHz 0x2800131  

********************************************************************
unsigned pllCtrlReadData;
    read_sswitch_reg(get_local_tile_id(), PLL_CTRL_REGNUM, pllCtrlReadData);
    printf("PLL Data is %d \n",pllCtrlReadData);
 
    if (pllCtrlReadData != PLL_CTRL_INPUT_100kHz)
    {
     write_sswitch_reg(get_local_tile_id(), PLL_CTRL_REGNUM, PLL_CTRL_INPUT_100kHz);
    }
 
    read_sswitch_reg(get_local_tile_id(), PLL_CTRL_REGNUM, pllCtrlReadData);
    printf("PLL Data is %d \n",pllCtrlReadData);
*********************************************************************
Some Questions:
1) I have read some things about how the device resesting after a write to the control register. Do I have to handle this reset or does the program counter revert back to the main and start running through the code again? 
 
2) Can someone explain the addressing scheme of the control registers? Where are the base address's define so I can set up pointers to adjust each register as I need in my application. 
 
example:  REG->PLL_RGE = some hex value or a defined shift to a single bit         
 
3) While debugging, how do I view all the device registers aside from the core register (r0, r1 etc) and are they one in the same? I am using Xtime composer. (this is obvious but when trouble shooting more info and less assumptions are better) I am also doing my application in C.
 
One more thing... I have tried to change the .xn file from 500MHz system clock to a 200kHz system clock and this doesn't seem to do anything. Maybe I am not incorporating the file into my project correctly? 
 
Any advice is appreciated! 
 
Thanks! 
Steve 
 
 
 
View Solution
User avatar
sethu_jangala
XCore Expert
Posts: 589
Joined: Wed Feb 29, 2012 10:03 am

Post by sethu_jangala »

1) Any write to control register 6 will make the device reset. If you are using a multi tile device, you need to write to the registers in each tile separately. You don't need to handle the program counter, the device resets the program counter and starts execution from main after reset. Keep a note that, the device reset works as expected only when the code is flashed in to the SPI flash. If you are writing to the PLL register from the application program which is running on the device using JTAG, the reset does not happen properly and device does not boot up.

2) You will find the information in the appendices from the following link : (Page 28)

https://www.xmos.com/download/public/XS ... heet%281.6%...

3) You will find all the registers of the logical core in the registers tab of the debug view.