Go Down

Topic: Internal RTC with back up battery (Read 2 times) previous topic - next topic

feveran

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?

Markus_L811


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

feveran

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

Palliser


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!

feveran

#4
Aug 23, 2013, 09:54 pm Last Edit: Aug 23, 2013, 09:57 pm by feveran Reason: 1
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.

Palliser


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!


feveran

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

Palliser

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

Transistorfips

>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.

feveran



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?

feveran




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 :D
Here example code:
Code: [Select]
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);

}



garygid

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.
Cheers, Gary
Due for controlling Electric car charging.
Nissan LEAF - Mini Quick Charge (mQC)

garygid

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.
Cheers, Gary
Due for controlling Electric car charging.
Nissan LEAF - Mini Quick Charge (mQC)

guallini

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.

guallini

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.

Go Up