Erriez / ErriezDS1302

Erriez 3-wire DS1302 Real Time Clock library for Arduino

Home Page:https://github.com/Erriez/ErriezArduinoLibraries

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

esp12

bamboo-master opened this issue · comments

The pin's in the example are indicated in the example d2-3-4, but it doesn't work that way, I changed it to 4-0-2 (gpio) the example compiled but didn't work. Once I successfully assembled it for 4-5-13, but after the bulkhead, errors started again - I get "Time: Error: Could not read the time".
What am I doing wrong? Can pins be changed? What am I doing wrong? Can pins be changed?

@bamboo-master Thanks for your feedback. I've some questions:

Which version of the library are you using?

The pin's in the example are indicated in the example d2-3-4,

Which microcontroller are you using?

I changed it to 4-0-2 (gpio) the example compiled but didn't work.

Which example are you using? Did you make any changes?

Can pins be changed?

Yes, any digital pin can be used for AVR, ESP8266 and ESP32. I recommend to start with this example without modifications:

ErriezDS1302SetGetTime.ino

What am I doing wrong?

Another suggestion is to double check that the connected chip is a DS1302 and contains a 32kHz crystal oscillator.

[v2.0.0]
esp8266 as in the picture
- jpg_640x640
ErriezDS1302Test example
changed only pin numbers
i have 32768Hz crystal oscillator.

The ESP8266 pins in the sketches are tested with a NodeMCU. There is a pin conversion needed from Dx to GPIOy when using a bare ESP8266. Can you convert to GPIO pins without D in the defines?

#elif defined(ARDUINO_ARCH_ESP8266)
#define DS1302_CLK_PIN      2 // GPIO2 NodeMCU: D4 Pin is high during power-on / reset / flashing
#define DS1302_IO_PIN       0 // GPIO0 NodeMCU: D3 
#define DS1302_CE_PIN       4 // GPIO4 NodeMCU: D2

Yes I've done that before.

I tried to reproduce with:

  • LOLIN(WEMOS) D1 mini Lite ESP8266 mini lite (I could not find a bare ESP8266)
  • Default ErriezDS1302SetGetTime.ino
  • Arduino v1.8.19 IDE
  • ESP8266 Community v3.0.2
  • ErriezDS1302 master hash 0093bc7

image

Output:

Erriez DS1302 set get time example
12:00:00
12:00:01
12:00:02
12:00:03
...

Unfortunately, I could not reproduce it.

And you can check with pins ?
#define DS1302_CLK_PIN 13
#define DS1302_IO_PIN 14
#define DS1302_CE_PIN 15

That works.

Are pull-up resistors needed there? Could I have damaged the rtc?

The problem is not only with rtc, it also does not work with bmp180, some pins do not respond at all, once it was possible to start normally and then again "not found". Maybe the board is damaged or some other binding is needed, I will buy a NodeMCU and compare it.

Thanks for sharing. Using a NodeMCU is a good idea. Success!