Hi all. I have a problem whit initialize the RTC on lpc2368. I would have an interrupt every 15.6 ms from CISS register. Can someone help me also with sample code? Thanks too much.
Isn't it better that you post your code, and explains what you spected to happen, and what really happens?
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 */
I haven't checked through all the constants, but consider protecting your feed sequences from interrupts. And have you checked if the 32768Hz crystal is spinning up? "doesn't work" is a very incomplete problem description. It would imply that almost 100% of all cars doesn't work. You leave the car to the mechanic with the description "doesn't work" because you have noticed that the lamp in the gloves compartment doesn't light?
"doesn't work" means that when i've downloaded the code into the device, the board MCB2300 doesn't responds in any way. I need to run Flash magic tool to erase the chip.
So you only have a serial interface - no debugger?
How do you know the code doesn't spend 100% of the time in an interrupt handler - that you don't allow us to see?
Where are the test printouts or the pin wiggling to tell you how far your code gets?
Exactly what have _you_ done before posting here that the board "doesn't responds in any way"?