Hi all. I've a problem to initialize the Pll block and the Real time clock. I would use Fin=32.768Khz Fcco=288Mhz cclk=Fcco/4=72Mhz. I read all the datasheet and i write my code but when i download the code, the mcb2300 doesn't work. I don't understand which is the issue.
PLLCON = 0x00; PLLFEED = 0xAA; /*FEED SEQUENCE 1*/ PLLFEED = 0x55; /*FEED SEQUENCE 2*/ CLKSRCSEL = 0x02; /*RTC CCLK 32.768KHZ*/ PLLCFG = 0x12254; PLLFEED = 0xAA; /*FEED SEQUENCE 1*/ PLLFEED = 0x55; /*FEED SEQUENCE 2*/ PLLCON = 0x01; /*enable PCONE*/ PLLFEED = 0xAA; /*FEED SEQUENCE 1*/ PLLFEED = 0x55; /*FEED SEQUENCE 2*/ CCLKCFG = 3; /*Fcco/4 --->CCLK=72MHz*/ VICIntEnable = (1<<12); while ((PLLSTAT & 0x04000000) == 0); /*wait until Phase Lock*/ PLLCON = 0x03; /*enable PCONE and PCONC*/ PLLFEED = 0xAA; /*FEED SEQUENCE 1*/ PLLFEED = 0x55; /*FEED SEQUENCE 2*/ RTC_ILR = 0x07; /*clear flag*/ RTC_CISS = 0x85; /*enable interrupt every 16ms*/ RTC_CCR = 0x19; VICVectAddr13 = (unsigned long)RTC_IRQHandler; /* Set Interrupt Vector */ VICVectCntl13 = 0; /* use it for RTC Interrupt */ VICIntEnable = (1 << 13); /* Enable Interrupt */
Thanks to much.
I follow the example on the lpc2368 user manual exactly on page 59. I use (N-1=1=0x1; M-1=8788=0x2254) because with this parameter gives a much smaller error. Thanks.