Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #79625

    kakas
    Participant

    Which RTC chip can be used? In the schematics I see both DS1307 and PCF8563. Will the firmware detect the chip type? The PCF8563 works from 1.8V, that is fine.
    But the recommended minimum operational voltage of DS1307 is 4.5V according to datasheet. Still it works from 3.3V? Datasheet is really foggy about it.

    #79636

    Ray
    Keymaster

    The current OpenSprinkler design uses PCF8563. The firmware can auto-detect the chip:;
    https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/master/I2CRTC.cpp#L46
    so you can use any of PCF8563, DS1307, and MCP7940.

    You are right that DS1307 requires at least 4.5V VCC. So the previous version of the OpenSprinkler that used DS1307 has its VCC tied to +5V, whereas PCF8563 can work with 3.3V so its VCC is tied to 3.3V.

    #79642

    kakas
    Participant

    Thank you Ray. I have both chips and test them. I used the 8563 first, it worked well if the AC was on. With power outage I got delays and weird dates/times. The batt voltage was 2-3V well above the required minimum for the 8563. So now I try to find the reason.
    The firmware has its own clock, and periodically refreshes it from the RTC? If so, how frequently?

    #79646

    Ray
    Keymaster

    It’s hard to tell without seeing your schematic. The firmware writes the current UTC time into RTC every time it gets a successful time sync from NTP server. The firmware maintains a system time. When the controller reboots, it will first retrieve the system time from the RTC. If it subsequently gets a successful NTP result, that will overwrite the system time (and writes that to RTC). The firmware does time keeping on ESP8266, which is pretty accurate, so it only needs to perform NTP occasionally to ensure the time is still accurate. The involvement of the RTC is pretty minimal here — it primarily covers the situation when the controller has rebooted but can’t access NTP yet (e.g. because the router hasn’t finished booting). Normally if the controller has NTP access (which is the common scenario), it will get time from that.

    #79649

    kakas
    Participant

    Schematics is v3.3. Thank you for the clear explanation, it will help a lot to find the bug.

    #79764

    kakas
    Participant

    So what I experience: board is v3.3 with PCF8563. I let the backup cap get charged fully, and let NTP to sync. I switch off NTP sync, and disconnect power. After some minutes I re-connect power, and the actual time will be the time moment when I disconnected the power. I do not know if ESP saves the time and retrieves it, or the RTC provides this time. Backup voltage is OK. I have replaced the RTC and resonator, same result.

    #79766

    Ray
    Keymaster

    This is a v3.3 board you bought from us or did you make it yourself? Do you have the 32.768kHz crystal connected to your PCF8563? Without the crystal the time will not move.

    #79924

    kakas
    Participant

    I made the board, but I think schematics is the same at the RTC chip. See attached.
    Experience: after NTP sync, NTP swiched off. Power off.
    After re-connecting, behavior seems to be always the same. Depending on the time of the re-connection, it jumps back an hour, then starts to go backwards.

    What I have already tried:
    – built a new board with all chips new
    – re-burned the firmware
    – checked with oscilloscope that 32kHz clock is working

    What else to check?

    #79930

    Ray
    Keymaster

    1) What firmware are you using? The OpenSprinkler firmware, or your own program?
    2) Is your super capacitor charged to at least 2V, so that it can keep the RTC chip going when power is off?

    I just verified that with the current OpenSprinkler firmware, power on, NTP sync, then power off, keep the unit away for 1 hour and power it on again, the LCD shows the correct time right away before NTP sync. So it’s working as expected.

    #80001

    kakas
    Participant

    Firmware is the latest official from github. Voltage is above 2V.
    thank you for checking the functionality.
    I will try the DS chips I have. What is the necessary hardware modificaton (to operate from higher voltage)?

    #80002

    Ray
    Keymaster

    Can you be more specific about ‘to operate from higher voltage’ — as in to power the RTC chip from a higher voltage? How high?

    #80003

    kakas
    Participant

    Ray, as you pointed out in your previous post:

    You are right that DS1307 requires at least 4.5V VCC. So the previous version of the OpenSprinkler that used DS1307 has its VCC tied to +5V, whereas PCF8563 can work with 3.3V so its VCC is tied to 3.3V.

    So wiht DS chip I have to connect VCC of DS to 5V. But the supercap’s max voltage is 3.3V, so I’m interested how the complete schematic with DS chip should look like.

    #80004

    Ray
    Keymaster

    You want to use DS1307 or PCF8563? With DS1307, it has dedicate battery backup pins, so the backup battery voltage doesn’t have to be the same as the supply voltage. In fact, you don’t need to use a supercap, you can use a 3V lithium coin battery, connect the positive to DS1307’s VBat pin, and negative to ground. That way you don’t need the diode and the super capacitor.

    #80272

    kakas
    Participant

    I have tested the PCF8563 again. Inserted some code to the firmware to see the operation. The PCF8563 does not work. After sync (and stopping sync), it jumps back an hour, then starts to go backwards. (or something like that). I have replaced the chip from the same batch, same results. Then I purchased it from an other source, still it works in the same way.
    It has nothing to do with Opensprinkler code or hardware.
    So I replaced to DS1307 and that works fine. (VCC is 3.3V)

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.