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.

C6748 PLL Issue

Expert 1110 points
Other Parts Discussed in Thread: OMAP-L138

Hi, 

Can somebody please tell why the following PLL setting procedure doesn't work?

static void PLLsetting(void){
    sysRegs->KICK0R = 0x83e70b13;
    sysRegs->KICK1R = 0x95A4F1E0;											// Two values for unlocking SYSCFG registers.

    sysRegs->CFGCHIP0 = (sysRegs->CFGCHIP0) & !(1 << CSL_SYSCFG_CFGCHIP0_PLL_MASTER_LOCK_SHIFT);
    sysRegs->CFGCHIP3 = (sysRegs->CFGCHIP3) & !(1 << CSL_SYSCFG_CFGCHIP3_PLL1_MASTER_LOCK_SHIFT);
    																		// Unlocking the PPL registers for both PLL0 and PLL1
	////////////////////////////////////////PLL Setting//////////////////////////////////////////////
	pllRegs->PLLCTL = (pllRegs->PLLCTL) & !(1 << 8);						//Reference clock selection
	pllRegs->PLLCTL = (pllRegs->PLLCTL) & !(1 << 5);						//PLLENSRC bit activate PLLEN
	pllRegs->PLLCTL = (pllRegs->PLLCTL) & !(1<<9);							//External clock source selection to OSCIN
	pllRegs->PLLCTL = (pllRegs->PLLCTL) & !(1<<0);							//Bypassing the PLL by clearing PLLEN bit

	delay(100);

	pllRegs->PLLCTL = (pllRegs->PLLCTL) & !(1<<3);							//Reseting the PLL
	pllRegs->PLLCTL = (pllRegs->PLLCTL) & !(1<<1);							//Bringing the PLL out of power-down

	pllRegs->PREDIV = ((pllRegs->PREDIV) & (0xFFFFFFE0)) | (0x000000000);
	pllRegs->PLLM = ((pllRegs->PLLM) & (0xFFFFFFE0)) | (0x000000017);		//Loading the multiplier value. It is 11 here as the
																			//output of the PLL should be between 300 and 600 for this device.
	pllRegs->POSTDIV = ((pllRegs->POSTDIV) & (0xFFFFFFE0)) | (0x0000000C);	//Loading the post divider value.
	pllRegs->POSTDIV = (pllRegs->POSTDIV) | (1<<15);						        //Loading the post divider value. 

	pllRegs->PLLCTL = (pllRegs->PLLCTL) | (1<<3);							//Bringing the PLL out of reset
	delay(100);
	pllRegs->PLLCTL = (pllRegs->PLLCTL) | (1<<0);							//Bringing the PLL out of bypass

	sysRegs->CFGCHIP0 = (sysRegs->CFGCHIP0) | (1 << CSL_SYSCFG_CFGCHIP0_PLL_MASTER_LOCK_SHIFT);
	sysRegs->CFGCHIP3 = (sysRegs->CFGCHIP3) | (1 << CSL_SYSCFG_CFGCHIP3_PLL1_MASTER_LOCK_SHIFT);
	    																		// Locking the PPL registers

	sysRegs->KICK0R = 0x00000000;											//Locking the SYSCFG register
    sysRegs->KICK1R = 0x00000000;
}

I'm using LCDK6748 and running an LED blinking project on it, but the speed of the blinking doesn't change at all.

By the way, I am using AISgen for generating .bin file. Does it effect the PLL setting. I keep the 'Configure PLL0' check box disabled.

Any help would be appreciated.

  • I should mention that I wrote this code based on the sequence explained in spruh79a.pdf document, page 138, '7.2.2.2 Initializing PLL Mode from PLL Power Down'. This function is called at the beginning of the main.
  • Hi Vala ,

    The input clock to the GPIO peripheral is depends upon SYSCLK4, Please check the SYSCLK4 frequency.

    The actual toggling rate of the GPIO is depends upon the delay function and the internal bus activity.

    Regards

    Antony

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

    Please click the "Verify Answer" button on this post if it answers your question.

  • Hi Antony,

    Thanks for your answer. The SYSCLK4 is also driven from the PLL and I am not changing PLLDIV4. I programmed my chip once with PLLM equal to 0x000000017 and another time with 0x00000000C. The rest of the code was untouched. If the PLL setting was working fine, then the speed of blinking of LED would be different. Am I right? Correct me please if I'm wrong.

    Regards
  • Hi Vala,

    I think you don’t see this visually,but you can use the oscilloscope and probe the GPIO pin to see the difference in the toggling rate by changing the PLLM value.

    Regards

    Antony

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

    Please click the "Verify Answer" button on this post if it answers your question.

  • Thanks for this fast answering Antony. Changing the multiplier from 0x17 to 0x0C makes the PLL output almost twice, 44 MHz and 24 MHz, respectively. Pre-divider and post-divider are 0x00 and 0xC in both cases, respectively. So, I think that would be visible in the LED. Does the procedure seem fine to you? the steps and values?

    Regards

  • Hi Vala,

    As long as the LED blinks I don’t suspect anything goes wrong in the PLL initialization ,the main reason for probing is to make sure the PLL values changes takes place or not.

    How did you write the delay function using for loop or timer based?

    Make sure the PLL initialized through code instead of AIS gen utility.

    Regards

    Antony

  • Antony,

    I will try to make my emulator work to see if I read some values of PLL registers. The delay is done using a for loop. Thanks in advance.

    Regards
  • Antony,

    I checked the registers with my emulator in CCS, they are changed and actually the speed of blinking is changed. It seems that the problem comes form the AISgen utility, because first I used the AISgen and sfh_OMAP-L138.exe for programming the NAND flash but now I'm using the emulator for programming. Is it possible AISgen changes the values of PLLs? If yes, how can I flash the NAND memory on my board without it? Is there any way to do it through CCS and my emulator?

    Regards,
  • Well, it is working fine now, even with AISgen and the worst thing is that I don't why it was not working before posting here. I appreciate your help Antony.

    Regards
  • Vala,

    Quite possible , you can use the CCS based flashing utility tools to burn the image into the flash.

    http://processors.wiki.ti.com/index.php/Serial_Boot_and_Flash_Loading_Utility_for_OMAP-L138

    Regards

    Antony

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

    Please click the "Verify Answer" button on this post if it answers your question.

  • Thank you so much Antony.

    Regards
  • Antony,

    This link explains exactly what I was doing with AISgen and sfh_OMAP-L138.exe. My question was how to program the NAND flash without them, for example using CCS and an emulator. Thanks

    Regards
  • Vala,

    If you download the OMAP-L138_flash_utility , you can find the CCS project under the folder C:\....OMAP-L138_flash_utility\OMAP-L138_FlashAndBootUtils_2_40\OMAP-L138\CCS

    Using this you can flash binary image through CCS & JTAG ,You can open ,build and run these projects and load the binary files to be burned into the flash memory.

    Let me know if you need any help

    Regards

    Antony 

  • Hi Antony,

    Thanks and sorry for replying late. I will go through what you explained.

    Regards,

    -Vala