RTC doesn't count when power on + LPC1768

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

RTC doesn't count when power on + LPC1768

1,316 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Curious on Wed Nov 19 00:03:07 MST 2014
Hi,
I have a really bad problem with 1768 RTC.
when power on my board (with my own design), RTC stops counting! but when switch off, it counts!
the mark on top of micro:
LPC1768FBD100
S2Y077
ZSD1421A

i'm using a 32.768KHz quartz crystal and 10pf caps with a clock battery connecting VBAT.

tanx all
Labels (1)
0 Kudos
Reply
10 Replies

1,157 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by e135193 on Thu Apr 09 22:34:29 MST 2015
Hello

    I had the same problem lately. I realised that I did not put 18pF cap between the pins of the 32.768KHz xtal and gnd. When I put that caps, it worked. Try that.

Regards.
0 Kudos
Reply

1,157 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Curious on Thu Nov 20 13:37:31 MST 2014
Putting a 100k resistor series with crystall doesn't help too. :-(

Any other idea?
0 Kudos
Reply

1,157 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Curious on Wed Nov 19 22:53:08 MST 2014
here are my codes:
  /* Enable CLOCK into RTC */
  LPC_SC->PCONP |= (1 << 9);

  /* If RTC is stopped, clear STOP bit. */
  if ( LPC_RTC->RTC_AUX & (0x1<<4) )
  {
LPC_RTC->RTC_AUX |= (0x1<<4);
  }
  
  /*--- Initialize registers ---*/    
  LPC_RTC->AMR = 0;
  LPC_RTC->CIIR = 0;
  LPC_RTC->CCR = 0;

  /*--- Start RTC counters ---*/
  LPC_RTC->CCR |= CCR_CLKEN;
  LPC_RTC->ILR = ILR_RTCCIF;

 while(1){
         current_time = RTCGetTime();
         ClearmyBuffer();
         sprintf(myBuffer,"%d : %d : %d \n",current_time.RTC_Hour,current_time.RTC_Min,current_time.RTC_Sec);
 SendTCP();    
 }



getting current_time from RTC and send it via TCP/IP.
0 Kudos
Reply

1,157 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Curious on Wed Nov 19 11:06:55 MST 2014

Quote: R2D2
Sorry for asking, won't happen again.


No, i didn't mean that. Just answering ur suggestions.Tanx for ur answers



Quote: MikeSimmonds
Mine works with both battery only and power, yours doesn't.
So either you have a hardware issue that you say you don't.
Or, with power, your code interferes with the RTC.

Basic deductive logic.

So all you need to do is check your code.

Regards, MIke


Well, i think it'll be a hardware issue becasue i tested my code before and worked right. Also i'll put my codes here to see if any problem. Tanx for answering
0 Kudos
Reply

1,157 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MikeSimmonds on Wed Nov 19 10:58:30 MST 2014
Mine works with both battery only and power, yours doesn't.
So either you have a hardware issue that you say you don't.
Or, with power, your code interferes with the RTC.

Basic deductive logic.

So all you need to do is check your code.

Regards, MIke
0 Kudos
Reply

1,157 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Wed Nov 19 10:24:16 MST 2014
Sorry for asking, won't happen again.
0 Kudos
Reply

1,157 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Curious on Wed Nov 19 10:14:58 MST 2014
I said it works when power down!
my program is correct and tested on a training board and also another board of mine.
0 Kudos
Reply

1,157 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Wed Nov 19 10:07:29 MST 2014
#1 Any hint how you init your RTC?

#2 There are several threads here about an additional 100k resistor...

(See schematic of LPCXpresso1769 board) :O
0 Kudos
Reply

1,157 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Curious on Wed Nov 19 09:59:16 MST 2014
There is 3v on VBAT pin when board is power down and it counts correctly!
but when turning on, it stops counting!
0 Kudos
Reply

1,157 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MikeSimmonds on Wed Nov 19 07:58:21 MST 2014
Check Voltage at VBAT.

This should always be 3.3V nominal.
Either from the battery if there is no power, or from Vcc33 when powered.

Check your battery switching/charging circuit. [I am not a hardware engineer
just a hint.]

Mike
0 Kudos
Reply