LPC 1768 FEED SEQUENCE SETUP

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC 1768 FEED SEQUENCE SETUP

878 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kranthi on Mon Feb 10 03:23:18 MST 2014
Hi,  i have a trouble in setting PLL0 Feed sequence .So PLL0 is not connecting.  Please see the code below and rectify my mistakes.

#include "lpc17xx.h"
int main()
{
//SC->PCONP |= (1<<15); //GPIO0 Power On
SC->CLKSRCSEL |= (1<<1);// Select RTC
SC->PLL0CON|= (1<<0) | (1<<1); // 0 bit for PLL0 Enable, 1st bit for PLL0 Connect.
SC->PLL0CFG|= (1<<0) | (1<<2) |(1<<3) | (1<<5) | (1<<7) | (1<<8) | (1<10) | (1<<12) | (1<<13); //M value = 13733, 11 0101 1010 0101 [14:0]
SC->PLL0CFG|= (1<<17)| (1<<16);// N value = 3( 11 ) [23:16]   for Fcco = 300 MHz ,see LPC17xx Preliminary user manual page no. 34

return 0;
}

Thanks,
Kranthi.
Labels (1)
0 Kudos
2 Replies

721 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kranthi on Mon Feb 10 05:50:37 MST 2014
Hi labrat,
Thank you very much.
0 Kudos

721 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Mon Feb 10 03:43:05 MST 2014

Quote: kranthi
Hi,  i have a trouble in setting PLL0 Feed sequence .



Could be a good idea to look in a working toolchain setup like LPCXpresso and check the differences?

LPCXpresso CMSIS2.0 system_LPC17xx.c:
void SystemInit (void)
{
#if (CLOCK_SETUP)                       /* Clock Setup                        */
  LPC_SC->SCS       = SCS_Val;
  if (SCS_Val & (1 << 5)) {             /* If Main Oscillator is enabled      */
    while ((LPC_SC->SCS & (1<<6)) == 0);/* Wait for Oscillator to be ready    */
  }

  LPC_SC->CCLKCFG   = CCLKCFG_Val;      /* Setup Clock Divider                */

  LPC_SC->PCLKSEL0  = PCLKSEL0_Val;     /* Peripheral Clock Selection         */
  LPC_SC->PCLKSEL1  = PCLKSEL1_Val;

  LPC_SC->CLKSRCSEL = CLKSRCSEL_Val;    /* Select Clock Source for PLL0       */

#if (PLL0_SETUP)
  LPC_SC->PLL0CFG   = PLL0CFG_Val;      /* configure PLL0                     */
  LPC_SC->PLL0FEED  = 0xAA;
  LPC_SC->PLL0FEED  = 0x55;

  LPC_SC->PLL0CON   = 0x01;             /* PLL0 Enable                        */
  LPC_SC->PLL0FEED  = 0xAA;
  LPC_SC->PLL0FEED  = 0x55;
  while (!(LPC_SC->PLL0STAT & (1<<26)));/* Wait for PLOCK0                    */

  LPC_SC->PLL0CON   = 0x03;             /* PLL0 Enable & Connect              */
  LPC_SC->PLL0FEED  = 0xAA;
  LPC_SC->PLL0FEED  = 0x55;
  while (!(LPC_SC->PLL0STAT & ((1<<25) | (1<<24))));/* Wait for PLLC0_STAT & PLLE0_STAT */
#endif
0 Kudos