Pages: [1]   Go Down
Author Topic: Internal RTC with back up battery  (Read 2351 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 3
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am looking for using arduino due's internal rtc with a 3v rtc battery.
RTC oscillator already assembled and connected battery to VDDBU.
But i haven't got any idea about codes.
Have someone already tried to use it?
Logged

Germany
Offline Offline
Full Member
***
Karma: 10
Posts: 230
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am looking for using arduino due's internal rtc with a 3v rtc battery.
RTC oscillator already assembled and connected battery to VDDBU.
But i haven't got any idea about codes.
Have someone already tried to use it?
Try this.
https://github.com/MarkusLange/Arduino-Due-RTC-Library
Logged

Offline Offline
Newbie
*
Karma: 3
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, its not working.
When i make usb connection off and on again, rtc resets to 2007 0..0
Logged

Venezuela
Offline Offline
God Member
*****
Karma: 17
Posts: 522
Ground, ground, always ground
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

RTC oscillator already assembled and connected battery to VDDBU.

Hello feveran, just in case, verify that in your battery backup system, the VDDBU pin is powered from the 3.3V and the backup battery via a dual Schottky diode D1, as follows.



Regards!
Logged

Offline Offline
Newbie
*
Karma: 3
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No, i connected battery directly to the VDDBU.
Is this  can be problem?
I also want to ask, is this scheme, no 1 pin of bat54c is connected to the 3.3 v. what is purpose of this? what will be done if connected or not connected?
thanks.
« Last Edit: August 23, 2013, 02:57:58 pm by feveran » Logged

Venezuela
Offline Offline
God Member
*****
Karma: 17
Posts: 522
Ground, ground, always ground
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

No, i connected battery directly to the VDDBU.
Is this  can be problem?

BAT54c is more a protection device for the battery backup system, but here is your problem:The Arduino Due reset pin is the NRSTB and not NRST, thus, every time that NRSTB lost power, it will reset the SAM3X8E Backup region (RTC, RTT and Supply Controller). This wouldn't be the case if NRST were connected to the reset button, because NRST does not reset the Backup region. This is one of the design changes to be done by the Ardino team in future Due revisions.  

I also want to ask, is this scheme, no 1 pin of bat54c is connected to the 3.3 v. what is purpose of this? what will be done if connected or not connected?
thanks.

I assume your backup battery is not rechargeable. and as I stated before, the BAT54c (schottky barrier) has a protective role, keeping the battery to be discharged in case no 1 drops below 3.3v. It also protects the battery in the opposite case when the power supply voltage is above 3.3v. Additionally, BAT54c has a low voltage drop. Regards!

Logged

Offline Offline
Newbie
*
Karma: 3
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't touch reset button, i only toggle the power. Is it same problem?
Logged

Venezuela
Offline Offline
God Member
*****
Karma: 17
Posts: 522
Ground, ground, always ground
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Could you show the connection between power supply (3.3v), backup battery and VDDBU pin? Thanks.
Logged

Germany
Offline Offline
Jr. Member
**
Karma: 0
Posts: 57
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

>When i make usb connection off and on again, rtc resets to 2007 0..0
Hi, please look at the DUE schematic. There you find that Master-Reset is connected to the 16U2 which produces the reset pulse when reseting or during power-up sequence (DUE: Pin 47, NRSTB  <-- MASTER-RESET--> 16U2: PC7, RESET_CMD) which take place during toggling power.


Bummer, there are really so little soldering jumpers for additional configuration on the board. I also think about how to use VDDBU.
Logged

Offline Offline
Newbie
*
Karma: 3
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Hi, please look at the DUE schematic. There you find that Master-Reset is connected to the 16U2 which produces the reset pulse when reseting or during power-up sequence (DUE: Pin 47, NRSTB  <-- MASTER-RESET--> 16U2: PC7, RESET_CMD) which take place during toggling power.


Bummer, there are really so little soldering jumpers for additional configuration on the board. I also think about how to use VDDBU.

So may i need to broke 16u2 pc7 connection?
Logged

Offline Offline
Newbie
*
Karma: 3
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Hi, please look at the DUE schematic. There you find that Master-Reset is connected to the 16U2 which produces the reset pulse when reseting or during power-up sequence (DUE: Pin 47, NRSTB  <-- MASTER-RESET--> 16U2: PC7, RESET_CMD) which take place during toggling power.


Bummer, there are really so little soldering jumpers for additional configuration on the board. I also think about how to use VDDBU.

So may i need to broke 16u2 pc7 connection?
And finally without 16U2, RTC is keep alive with external battery smiley-grin
Here example code:
Code:
void setup() {
  SerialUSB.begin(9600);
  pmc_switch_sclk_to_32kxtal(PMC_OSC_XTAL);
  while (!pmc_osc_is_ready_32kxtal());
  RTC_SetHourMode(RTC, 0);
  pinMode(6,INPUT);//rtc will be set without reset
}

void loop() { 
  int x=digitalRead(6);
  if(x==0){
    RTC_SetTime(RTC, 5, 4, 40); //set the time one time
  }
  uint8_t hour, minute, second;
  uint8_t year, month, day, week;
  RTC_GetTime(RTC, &hour, &minute, &second);
  SerialUSB.print(hour);
  SerialUSB.print(minute);
  SerialUSB.println(second);

}


Logged

Laguna Hills, CA 92653
Offline Offline
Full Member
***
Karma: 0
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Some have reported that the 32 kHz oscillator (Y2) is not
on their Due board.  I just got 4 "genuine" Due R3 boards,
and all 4 have the Y2 populated.
Logged

Cheers, Gary
Due for controlling Electric car charging.
Nissan LEAF - Mini Quick Charge (mQC)

Laguna Hills, CA 92653
Offline Offline
Full Member
***
Karma: 0
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So, there remains two problems with trying to use the RTC:

1.  The NRSTB resets the RTC.
2. VDDBU is tied directly to 3.3v power.
Logged

Cheers, Gary
Due for controlling Electric car charging.
Nissan LEAF - Mini Quick Charge (mQC)

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I'm sorry but someone can show me a picture of the DUE that shows the connection of the modification for VDDBU?

Thanks in advance.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I was able to connect a battery to VDDBU. I've disconnected the VDDBU from 3.3V and connected to battery. The only difficult is to cut the pist correctly. I will post a picture.
Logged

Pages: [1]   Go Up
Jump to: