lpcware

the RTC of the LPC1224 problem

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by leee on Sun Mar 24 20:25:20 MST 2013
我用了 LPC 里面的模板。
void RTC_Config(void)
{
    RTC_Init (0x04, 24);    // 这里如果选择PCLK作为时钟源的话 DR寄存器 不是每秒增加一次,还是要有计算公式
                            // 如果选择 1HZ DR寄存器又不走
                            // 书上的32KHZ 振荡器 是只外接的32.768KHZ晶振吗?

    RTC_SetLoad (0);              
RTC_SetMatch (60);                        
NVIC_EnableIRQ(RTC_IRQn);                            
RTC_Cmd (ENABLE);                       
  }





void RTC_Config(void)
{
    RTC_Init (0x04, 24);    // Here. Is DR the second register of the RTC? But it walked too fast,
// Not increase once per second.            
// And if I write "RTC_Init (0x00, 0);" select 1HZ clock . The DR of the RTC was not walk
    RTC_SetLoad (0);              
RTC_SetMatch (60);                        
NVIC_EnableIRQ(RTC_IRQn);                            
RTC_Cmd (ENABLE);                       
  }
Thank you very much!


Outcomes