after 2days battle with the DS3231 RTC I want to share my thoughts
If you get this kind of error
Uncaught InternalError: Timeout on I2C Write BUSY
It's most likely because I2C pull-up resistor value is too low, it should be 10k not 4,7k
4,7k is a default pull-up value in many schematics but it's not enough for stm32, of course in many cases 4,7k would do the job but if you want to avoid hazards always pull-up 10k on I2c.
In my case, a cheap DS3231 module had soldered 4,7k resistors, funny enough it was working on a breadboard but not on my custom made PCB lol....
oh here it is, my module
values on these tiny resistors are 432 = 4,3k so it's even worse..
and here is my solution (10k resistors soldered):
Nice - thanks for the post (it's a nice looking little module!).
I'd really have thought that 4k resistors would work - the STM32 shouldn't be that picky. Perhaps it was something wrong with the resistors that came on the board itself?
I don't think so, I've tested the module dozen of times, I think 4,7k would work but anything below 4,7 is hazardous, I assume it was working on a breadboard because of the extra resistance of pins, wires etc (my guess), anyway 10k is a safe option.
Often the I2C master [here, the stm32] is strong enough to force a line to 0V through a 4k7 resistor. I bet the problem here is the RTC itself which should probably have weak output drivers unable to push the lines to zero Volts (thus, very low current drained which is a good point for a RTC in term of power consumption).
Good point about the device on the end! I hadn't considered that.
Yes, the STM32 will push out 20mA or so per pin, so should easily be able to handle 1k or less - but the RTC itself is probably built for low power consumption so won't have powerful output drivers.
I haven't thought about it that way, good point
as I found, these tiny rtc modules are designed to work with Raspberry Pi (https://goo.gl/hwqD8I) moreover they all have soldered 4.3k pull-ups, I dont think they all manufactured broken with wrong pull up value.
I suspect 4,7k is okay for stm32 but anything below (like 4,3k) is not
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem