pipi61 wrote:
If you do not use the sd card, then this pins available
But if I use SD later, can it?
In
this link the DS1302 is avaiable for ESP32
Code: Select all
#include <ErriezDS1302.h>
// Connect DS1302 data pin to Arduino DIGITAL pin
#if defined(ARDUINO_ARCH_AVR)
#define DS1302_CLK_PIN 2
#define DS1302_IO_PIN 3
#define DS1302_CE_PIN 4
#elif defined(ARDUINO_ARCH_ESP8266)
#define DS1302_CLK_PIN D4
#define DS1302_IO_PIN D3
#define DS1302_CE_PIN D2
#elif defined(ARDUINO_ARCH_ESP32)
#define DS1302_CLK_PIN 0
#define DS1302_IO_PIN 4
#define DS1302_CE_PIN 5
#else
#error #error "May work, but not tested on this target"
#endif
// Create DS1302 RTC object
DS1302 rtc = DS1302(DS1302_CLK_PIN, DS1302_IO_PIN, DS1302_CE_PIN);
analyzing
this and
this
This guy uses the following pins for the ESP32 wroom
Code: Select all
DS1302RTC RTC(14, 13, 16); // CLK, IO, CE
So, I check the pinout of the esp32 wroom
And I compare it with esp32 ai thinker
Sketch:
Code: Select all
#include <DS1302.h>
DS1302 rtc(16,12,14); // rst, dat, clk
void setup() {
Serial.begin(115200);
}
void loop() {
Serial.println(rtc.getTimeStr());
Serial.println(rtc.getDateStr());
delay(1000);
}
Why do I get this on serial monitor?
Code: Select all
Guru Meditation Error: Core00,len:6352
entry 0x400806b8
f001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8
Guru Meditation Error: Core 1 panic'ed (LoadStoreError). Exception was unhandled.
Core 1 register dump:
PC : 0x400d0f38 PS : 0x00060330 A0 : 0x800d0d21 A1 : 0x3ffb1f50
A2 : 0x3f400f05 A3 : 0x00000002 A4 : 0x00000009 A5 : 0x00000003
A6 : 0x00000001 A7 : 0x00000000 A8 : 0x00000032 A9 : 0x0000001b
A10 : 0x3ffb1f5c A11 : 0x3ffb1f6e A12 : 0x00000009 A13 : 0x3ffb1f64
A14 : 0x000000ff A15 : 0x0875eb55 SAR : 0x00000010 EXCCAUSE: 0x00000003
EXCVADDR: 0x3f400f05 LBEG : 0x4000c349 LEND : 0x4000c36b LCOUNT : 0xffffffff
Backtrace: 0x400d0f38:0x3ffb1f50 0x400d0d1e:0x3ffb1f90 0x400d1b35:0x3ffb1fb0 0x4008a53d:0x3ffb1fd0
Rebooting...
ets Jun 8 2016 00:22:57
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8
Guru Meditation Error: Core 1 panic'ed (LoadStoreError). Exception was unhandled.
Core 1 register dump:
PC : 0x400d0f38 PS : 0x00060330 A0 : 0x800d0d21 A1 : 0x3ffb1f50
A2 : 0x3f400f05 A3 : 0x00000002 A4 : 0x00000009 A5 : 0x00000003
A6 : 0x00000001 A7 : 0x00000000 A8 : 0x00000032 A9 : 0x0000001b
A10 : 0x3ffb1f5c A11 : 0x3ffb1f6e A12 : 0x00000009 A13 : 0x3ffb1f64
A14 : 0x000000ff A15 : 0x0875eb55 SAR : 0x00000010 EXCCAUSE: 0x00000003
EXCVADDR: 0x3f400f05 LBEG : 0x4000c349 LEND : 0x4000c36b LCOUNT : 0xffffffff
Backtrace: 0x400d0f38:0x3ffb1f50 0x400d0d1e:0x3ffb1f90 0x400d1b35:0x3ffb1fb0 0x4008a53d:0x3ffb1fd0
Rebooting...
ets Jun 8 2016 00:22:57/code]