Content originally posted in LPCWare by fjrg76 on Thu Jul 18 12:00:01 MST 2013
I'm having problems too with the RTC, but I can tell you a couple of things:
In order the RTC to work at 1 HZ you need an external 32KHz crystal.
If you're going to use any internal clock, then you need to divide the internal clock frecuency so you get the desire output frec.
Let's talk about code:
RTC_Init (0x00, 0);
In this case the second argument is not used, that's way its value is 0, but in this next escenario
RTC_Init (0x04, 24);
the second argument means the divider (or prescaler). If you've chosen, say, 1KHz internal clock, then the second argument should be 1000 in order to get a time interval of one second. BTW, the option 0x04 is not a valid one, so please use literal constants instead of magic numbers.
The NXP's sample project for the RTC bahaves erratically, that's the problem I'm facing right now.