Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esp12 #3

Closed
bamboo-master opened this issue Oct 2, 2022 · 10 comments
Closed

esp12 #3

bamboo-master opened this issue Oct 2, 2022 · 10 comments

Comments

@bamboo-master
Copy link

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?

@Erriez
Copy link
Owner

Erriez commented Oct 2, 2022

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

@bamboo-master
Copy link
Author

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

@Erriez
Copy link
Owner

Erriez commented Oct 2, 2022

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

@bamboo-master
Copy link
Author

Yes I've done that before.

@Erriez
Copy link
Owner

Erriez commented Oct 2, 2022

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.

@bamboo-master
Copy link
Author

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

@Erriez
Copy link
Owner

Erriez commented Oct 2, 2022

That works.

@bamboo-master
Copy link
Author

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

@bamboo-master
Copy link
Author

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.

@Erriez
Copy link
Owner

Erriez commented Oct 4, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants