Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 29 21:20
    Makuna unlabeled #110
  • Sep 29 21:20
    Makuna closed #110
  • Sep 29 21:15

    Makuna on master

    enable travis build using platf… (compare)

  • Sep 29 21:15
    Makuna closed #116
  • Sep 23 20:22
    Makuna closed #120
  • Sep 23 20:22
    Makuna updated the wiki
  • Sep 23 20:13
    Makuna updated the wiki
  • Sep 23 08:34
    T0m92 opened #120
  • Aug 27 15:58
    Makuna closed #119
  • Aug 27 15:58
    Makuna labeled #119
  • Aug 27 15:55
    Makuna closed #118
  • Aug 27 08:15
    Bredahl opened #119
  • Aug 03 15:39
    Flavian opened #118
  • Aug 01 19:24
    Makuna closed #117
  • Aug 01 17:19
    lucagrosshennig opened #117
  • Jul 31 17:46
    thijstriemstra opened #116
  • Jul 25 23:30

    Makuna on 2.3.5

    (compare)

  • Jul 25 23:28

    Makuna on NextRelease

    (compare)

  • Jul 25 23:28

    Makuna on master

    increment version (#115) (compare)

  • Jul 25 23:28
    Makuna closed #115
koosiekloek
@koosiekloek
10:35:32.521 -> compiled: Apr 18 201910:35:21
10:35:32.574 -> 04/18/2019 10:35:21
10:35:32.574 -> RTC lost confidence in the DateTime!
10:35:32.621 -> RTC is the same as compile time! (not expected but all is fine)
10:35:32.674 -> 04/18/2019 10:35:21
10:35:33.378 -> 04/18/2019 10:35:21
10:35:34.083 -> 00/00/2000 00:00:00
10:35:34.083 -> RTC lost confidence in the DateTime!
10:35:34.734 -> 04/18/2019 10:35:23
10:35:35.489 -> 04/18/2019 10:35:23
10:35:36.138 -> 00/00/2000 00:00:00
10:35:36.192 -> RTC lost confidence in the DateTime!
10:35:36.842 -> 04/18/2019 10:35:25
10:35:37.544 -> 04/18/2019 10:35:25
10:35:38.249 -> 00/00/2000 00:00:00
10:35:38.302 -> RTC lost confidence in the DateTime!
10:35:38.951 -> 04/18/2019 10:35:27
10:35:39.655 -> 00/00/2000 00:00:00
10:35:39.709 -> RTC lost confidence in the DateTime!
10:35:40.361 -> 00/00/2000 00:00:00
10:35:40.415 -> RTC lost confidence in the DateTime!
10:35:41.064 -> 04/18/2019 10:35:29
10:35:41.767 -> 00/00/2000 00:00:00
10:35:41.820 -> RTC lost confidence in the DateTime!
10:35:42.472 -> 00/00/2000 00:00:00
10:35:42.525 -> RTC lost confidence in the DateTime!
10:35:43.176 -> 04/18/2019 10:35:31
10:35:43.879 -> 00/00/2000 00:00:00
10:35:43.879 -> RTC lost confidence in the DateTime!
10:35:44.583 -> 04/18/2019 10:35:33
10:35:45.288 -> 04/18/2019 10:35:33
10:35:45.991 -> 00/00/2000 00:00:00
10:35:45.991 -> RTC lost confidence in the DateTime!
10:35:46.693 -> 04/18/2019 10:35:35
10:35:47.397 -> 04/18/2019 10:35:35
10:35:48.055 -> 00/00/2000 00:00:00
10:35:48.102 -> RTC lost confidence in the DateTime!
10:35:48.760 -> 04/18/2019 10:35:37
10:35:49.507 -> 04/18/2019 10:35:37
10:35:50.209 -> 00/00/2000 00:00:00
10:35:50.209 -> RTC lost confidence in the DateTime!
10:35:50.868 -> 04/18/2019 10:35:39
10:35:51.572 -> 00/00/2000 00:00:00
10:35:51.619 -> RTC lost confidence in the DateTime!
10:35:52.320 -> 00/00/2000 00:00:00
10:35:52.320 -> RTC lost confidence in the DateTime!
10:35:53.022 -> 04/18/2019 10:35:41
10:35:53.680 -> 00/00/2000 00:00:00
10:35:53.726 -> RTC lost confidence in the DateTime!
10:35:54.384 -> 00/00/2000 00:00:00
10:35:54.431 -> RTC lost confidence in the DateTime!
10:35:55.088 -> 04/18/2019 10:35:43
10:35:55.795 -> 00/00/2000 00:00:00
10:35:55.795 -> RTC lost confidence in the DateTime!
10:35:56.498 -> 00/00/2000 00:00:00
10:35:56.498 -> RTC lost confidence in the DateTime!
10:35:57.202 -> 04/18/2019 10:35:45
10:35:57.905 -> 00/00/2000 00:00:00
10:35:57.905 -> RTC lost confidence in the DateTime!
10:35:58.609 -> 04/18/2019 10:35:47
i am using A1, A2, A3 that is not used to my knowledge
koosiekloek
@koosiekloek
Delay on 0.1 Sec is very interesting. might there be some problem in the library math that dislikes even seconds?
00:00:00
10:40:42.145 -> RTC lost confidence in the DateTime!
10:40:54.829 -> compiled: Apr 18 201910:40:43
10:40:54.876 -> 04/18/2019 10:40:43
10:40:54.876 -> RTC is the same as compile time! (not expected but all is fine)
10:40:54.976 -> 04/18/2019 10:40:43
10:40:55.030 -> 04/18/2019 10:40:43
10:40:55.131 -> 04/18/2019 10:40:43
10:40:55.231 -> 04/18/2019 10:40:43
10:40:55.332 -> 04/18/2019 10:40:43
10:40:55.394 -> 04/18/2019 10:40:43
10:40:55.534 -> 04/18/2019 10:40:43
10:40:55.633 -> 00/00/2000 00:00:00
10:40:55.633 -> RTC lost confidence in the DateTime!
10:40:55.734 -> 00/00/2000 00:00:00
10:40:55.734 -> RTC lost confidence in the DateTime!
10:40:55.834 -> 00/00/2000 00:00:00
10:40:55.834 -> RTC lost confidence in the DateTime!
10:40:55.935 -> 00/00/2000 00:00:00
10:40:55.935 -> RTC lost confidence in the DateTime!
10:40:56.035 -> 00/00/2000 00:00:00
10:40:56.035 -> RTC lost confidence in the DateTime!
10:40:56.136 -> 00/00/2000 00:00:00
10:40:56.136 -> RTC lost confidence in the DateTime!
10:40:56.236 -> 00/00/2000 00:00:00
10:40:56.283 -> RTC lost confidence in the DateTime!
10:40:56.337 -> 00/00/2000 00:00:00
10:40:56.384 -> RTC lost confidence in the DateTime!
10:40:56.437 -> 00/00/2000 00:00:00
10:40:56.437 -> RTC lost confidence in the DateTime!
10:40:56.537 -> 00/00/2000 00:00:00
10:40:56.584 -> RTC lost confidence in the DateTime!
10:40:56.639 -> 04/18/2019 10:40:45
10:40:56.723 -> 04/18/2019 10:40:45
10:40:56.854 -> 04/18/2019 10:40:45
10:40:56.939 -> 04/18/2019 10:40:45
10:40:57.040 -> 04/18/2019 10:40:45
10:40:57.140 -> 04/18/2019 10:40:45
10:40:57.241 -> 04/18/2019 10:40:45
10:40:57.340 -> 04/18/2019 10:40:45
10:40:57.441 -> 04/18/2019 10:40:45
10:40:57.541 -> 04/18/2019 10:40:45
10:40:57.641 -> 00/00/2000 00:00:00
10:40:57.688 -> RTC lost confidence in the DateTime!
10:40:57.788 -> 00/00/2000 00:00:00
10:40:57.788 -> RTC lost confidence in the DateTime!
10:40:57.842 -> 00/00/2000 00:00:00
10:40:57.888 -> RTC lost confidence in the DateTime!
10:40:57.942 -> 00/00/2000 00:00:00
10:40:57.989 -> RTC lost confidence in the DateTime!
10:40:58.089 -> 00/00/2000 00:00:00
10:40:58.089 -> RTC lost confidence in the DateTime!
10:40:58.190 -> 00/00/2000 00:00:00
10:40:58.190 -> RTC lost confidence in the DateTime!
10:40:58.243 -> 00/00/2000 00:00:00
10:40:58.290 -> RTC lost confidence in the DateTime!
10:40:58.375 -> 00/00/2000 00:00:00
10:40:58.375 -> RTC lost confidence in the DateTime!
10:40:58.476 -> 00/00/2000 00:00:00
10:40:58.523 -> RTC lost confidence in the DateTime!
10:40:58.565 -> 04/18/2019 10:40:47
10:40:58.697 -> 04/18/2019 10:40:47
10:40:58.797 -> 04/18/2019 10:40:47
10:40:58.897 -> 04/18/2019 10:40:47
10:40:58.998 -> 04/18/2019 10:40:47
10:40:59.098 -> 04/18/2019 10:40:47
10:40:59.199 -> 04/18/2019 10:40:47
10:40:59.299 -> 04/18/2019 10:40:47
10:40:59.400 -> 04/18/2019 10:40:47
10:40:59.500 -> 04/18/2019 10:40:47
koosiekloek
@koosiekloek
have a look here might help you Lib
msparks/arduino-ds1302@5650f7d
Michael Miller
@Makuna
More than likely there is a communications problem of some sort.
I looked at their code, I have the delays already. I am following the specification of the part. The only weird thing they do is that the transition from write to read, they set the pin to input BEFORE the clock drops.
I am away from my hardware so I can't test this.
Try the ThreeWireCommFix branch and see if this fixes it for you.
koosiekloek
@koosiekloek
Thanks a mill, i am also not with my hardware now but will test in the morning and report back
koosiekloek
@koosiekloek
The changes you made fixed my problem thanks a million for the help and time spent! So much appreciated!
0.3Sec Delay
09:15:47.540 -> compiled: Apr 19 201909:15:35
09:15:47.573 -> 04/19/2019 09:15:35
09:15:47.573 -> RTC is the same as compile time! (not expected but all is fine)
09:15:47.640 -> 04/19/2019 09:15:35
09:15:47.908 -> 04/19/2019 09:15:35
09:15:48.212 -> 04/19/2019 09:15:36
09:15:48.517 -> 04/19/2019 09:15:36
09:15:48.822 -> 04/19/2019 09:15:36
09:15:49.129 -> 04/19/2019 09:15:37
09:15:49.437 -> 04/19/2019 09:15:37
09:15:49.742 -> 04/19/2019 09:15:37
09:15:50.017 -> 04/19/2019 09:15:38
09:15:50.325 -> 04/19/2019 09:15:38
09:15:50.634 -> 04/19/2019 09:15:38
09:15:50.942 -> 04/19/2019 09:15:38
09:15:51.219 -> 04/19/2019 09:15:39
09:15:51.528 -> 04/19/2019 09:15:39
09:15:51.831 -> 04/19/2019 09:15:39
09:15:52.136 -> 04/19/2019 09:15:40
Michael Miller
@Makuna
Great, I will merge that in and put out a new release
koosiekloek
@koosiekloek
:D
Leandro Boari
@leandrorepos
Hi!
Does the DS3231 alarm work when the clock is in backup mode?
Leandro Boari
@leandrorepos
I can't make the RTC send a pulse through the SQW:-(
Michael Miller
@Makuna
Did you set it, call myRtc.SetSquareWavePin(DS3231SquareWavePin_ModeClock) and myRtc.SetSquareWavePinClockFrequency(DS3231SquareWaveClock_1Hz) for once a second.
What do you mean by "backup mode"?
Leandro Boari
@leandrorepos
I'm sorry! "Backup mode": When I do not supply 3.3V on the VCC of the RTC, but it is supplied by the RTC battery. Will send pulses too?
Leandro Boari
@leandrorepos
What I would like to do, is the DS3231 give an pulse to a Flipflop Latch SR to switch the CHPD from the ESP8266 high to low. But the DS3231 is a pulse in low, right?
Michael Miller
@Makuna
To trigger the int/sqw pin when vcc is below backup power, you call myRtc.SetSquareWavePin(DS3231SquareWavePin_ModeBatteryBackup).
And yes, the docs state active low for the int pin.
I have no idea if the alarms still work when vcc is below backup power, but I would suspect so.
Leandro Boari
@leandrorepos
DS3231SquareWavePin_ModeBatteryBackup - the pin will trigger when the external power is lower than the battery power
I believe it is not possible. :-(
I'm making tests...
Michael Miller
@Makuna
The docs don't mention if the alarms work or shouldn't work if on backup battery power.
The docs do state that the int pin should have an external pullup resistor on it, with most Arduinos, just set the pin mode to pullup should work fine.
Leandro Boari
@leandrorepos
OK! I'll try and return news here.
Thank you very much, @Makuna. You are too kind!
Leandro Boari
@leandrorepos
But so far the SQW pulses only work when VCC is powered.
Michael Miller
@Makuna
Even if you set it to DS3231SquareWavePin_ModeBatteryBackup? This would defy its usefulness completely.
Leandro Boari
@leandrorepos
The DS3231 VCC pin pull up SQW. I'll try to understand better the signal.
Michael Miller
@Makuna
Ah, the module you have already has a resistor between VCC and the SQW pin. That's handy.
Leandro Boari
@leandrorepos
@Makuna, DS3231SquareWavePin_ModeBatteryBackup makes the SQW pin send low pulses of 1Hz intermittents.
And when the RTC is not supplied by VCC, it doesn't send alarm with low pulses.
:-(
Leandro Boari
@leandrorepos
I found a possible solution @Makuna! I'll test now...
They said:
To others who see this thread, the JChristensen library did not have a function to set the BBSQW pin so I wrote this one:
/*
Sets/resets the BBSQW pin in the control register
*/
byte DS3232RTC::setBBSQW(bool state)
{
    //Get original contents
    byte t = readRTC(RTC_CONTROL);
    if (state)
        //Set bit 6 i.e. the BBSQW
        t |= (1 << BBSQW);
    else
        t &= ~(1 << BBSQW);

    return (writeRTC(RTC_CONTROL, t));
}
Leandro Boari
@leandrorepos
Was the INTCN, A1IE & A2IE bits also set in the control register (0x0E) to enable the Alarm match to also trigger the interrupt?
Leandro Boari
@leandrorepos
So I modified the file RtcDS3231.h of your library and it worked!!!
case DS3231SquareWavePin_ModeAlarmOne:
            creg |= _BV(DS3231_BBSQW);
            creg |= _BV(DS3231_A1IE);
            break;
Michael Miller
@Makuna
Do you want to make a pull request with the changes and I will review and merge it?
Michael Miller
@Makuna
So the BBSQW is NOT to test for vcc<vb, but to just enable the square wave output for alarms and others when in this state.
Michael Miller
@Makuna
I think I am going to change the method a little with this newly learned information. This is what I will be, what do you think?
void SetSquareWavePin(DS3231SquareWavePinMode pinMode, bool enableWhileInBatteryBackup)
    {
        uint8_t creg = getReg(DS3231_REG_CONTROL);

        // clear all relevant bits to a known "off" state
        creg &= ~(DS3231_AIEMASK | _BV(DS3231_BBSQW));
        creg |= _BV(DS3231_INTCN);  // set INTCN to disables clock SQW

        if (enableWhileInBatteryBackup && pinMode != DS3231SquareWavePin_ModeNone )
        {
            creg |= _BV(DS3231_BBSQW); // set enable int/sqw while in battery backup flag
        }

        switch (pinMode)
        {
        case DS3231SquareWavePin_ModeNone:
            break;

        case DS3231SquareWavePin_ModeClock:
            creg &= ~_BV(DS3231_INTCN); // clear INTCN to enable clock SQW 
            break;

        case DS3231SquareWavePin_ModeAlarmOne:
            creg |= _BV(DS3231_A1IE);
            break;

        case DS3231SquareWavePin_ModeAlarmTwo:
            creg |= _BV(DS3231_A2IE);
            break;

        case DS3231SquareWavePin_ModeAlarmBoth:
            creg |= _BV(DS3231_A1IE) | _BV(DS3231_A2IE);
            break;
        }

        setReg(DS3231_REG_CONTROL, creg);
    }
Leandro Boari
@leandrorepos
Sorry for the delay. Great, that's it! It worked very well.
Bastian Jäger
@bastianhjaeger
@m1ch3l4 Did you solve it? I think I am facibg the same problem and maybe I am just to stupid to find the right Pins to replace 19 and 4 for my ESP12f.
Right niw my DS3231 can not wake up the ESP12f and there is no clear example on solving this.
shyney7
@shyney7
Hi, Im trying to get the epoch time as a float from the DS3231 but I'm not able to. I'm able to get the day,month etc as an integer like in this Code:
RtcDateTime currentTime = rtcObject.GetDateTime();    //get the time from the RTC


    char str[20];   //declare a string as an array of chars

    sprintf(str, "%d.%d.%d,%d:%d:%d,",     //%d allows to print an integer to the string
          currentTime.Day(),    //get day method
          currentTime.Month(),  //get month method
          currentTime.Year(),   //get year method
          currentTime.Hour(),   //get hour method
          currentTime.Minute(), //get minute method
          currentTime.Second()  //get second method
         );
but if I try float current = currenttime.TotalSeconds(); or float current = currenttime.Epoch32Time(); it doesnt work
Michael Miller
@Makuna
because its not a float and a float will not represent the value accurately. Why do you need it as a float?
Michael Miller
@Makuna
Epoch time is best as either a unsigned 32 bit integer or unsigned 64 bit integer.
Converting/casting this to float will loose time precision.
What do you mean by "it doesn't work"? It doesn't compile? It doesn't give you a value you expected?
Leandro Boari
@leandrorepos
Hi, @Makuna!
I'm here again. We figured out how to make the alarm pulses by Vbat power supply. But the alarm trigger is logic 0. I really need it to be in logic 1! The implementation of NOT GATES has considerable consumption.