Thanks to generous and helpful online community, I have finally learned to talk to esp8266 in c.
Most of the learning is by way of copy pasting others' code shamelessly.
For last three days, I am trying to get ds3231 talk to esp8266.
I am coding on OsX 10.9, gcc toolchain, espressif SDK 1.2.0.
Using Richard Burton's exquisite driver for ds3231 and espressif's i2c_master driver, I initialised i2c_master_gpio_init in my user_init.
I am using gpio4 (SCL) and gpio5 (SDA) on esp-07, considering silk-mask on module has swapped 4<->5 (confirmed by lua code).
The output I get from getTime (hh:mm:ss, dd-mm-yy) is strange..-> command 6 - RTC
-> command 6 - RTC
-> Time: 37:165:93, 165-24-265
-> command 6 - RTC
-> Time: 37:165:93, 165-24-265
-> command 6 - RTC
-> Time: 37:165:93, 165-24-265
-> command 6 - RTC
-> Time: 37:165:105, 165-24-265
-> command 6 - RTC
-> Time: 37:165:43, 165-24-265
-> command 6 - RTC
-> Time: 37:165:41, 165-24-265
I have confirmed time setting and getting in lua code using same pins on the module-it works like charm.
Can anyone help me in solving the problem.
ESP8266 communication with ds3231 RTC on i2c
Re: ESP8266 communication with ds3231 RTC on i2c
Postby eriksl » Sat Aug 01, 2015 2:13 am
If there's something wrong with the i2c bus (hardware) it should be detectable. Missing pull ups, gpio's that are not in open drain mode (but push-pull), swapped scl and sda, they all give situations the i2c software can detect. My implementation does. When an implementation sets sda or scl it should check if it's really up or down, every output is always also an input. I know the espressif example code doesn't... You might want to try to get it to work with my universal i/o bridge, using raw i2c commands.
Who is online
Users browsing this forum: No registered users and 71 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.