I'm working on a library for STM32 to learn I2C protocol (Software I2C, not hardware).

I connect my DS1307 (Sparkfun BOB-12708) : (Here is the module schematic) :

  • I remove welding on the SJ2 jumper to dont use 4.7K embedded module pullup resistors.
  • I supply 5v power to the module
  • My STM32 board already has 4.7K pullup resistors to 3.3V
  • I connect module SDA and SCL to my STM32 3.3V GPIO with 15 cm cables.
  • I connect my two way oscilloscope to SDA and SCL.

I can produce a nice SCL (100KHz) and SDA signal except for the I2C "START CONDITION", SDA take time to fall down, the falling edge is not straightforward. When I increase timing in my code I can get the DS1307 address ACK. So I suspected the resistors values not be appropriate.

I used two different GPIO without pullup resistors and I use my own 1K pullup resistors to 3.3V and this work very well. Signal is nice I can read and write successfully to DS1307 and get date/time.

So I disconnect my oscilloscope, but after that, I could not read or write to the device :(. My oscilloscope impedance is 1M. If I leave 1K pullup resistor to 3.3V AND put a 1M resistor to ground this work.

I also try with bi-directional logic level converter (BOB-12009) and this work well but I want to use DS1307 directly without converter.

  • Can someone help me to understand why I need this 1M resistor ?
  • What 3.3V pullup resistors value can I use to only use pullup ?


  • STM32 board is an Olimex STM32F103STK
  • Ground is connected between STM32, DS1307 (and oscilloscope when i plug it)

Edit 2:

My cable got bad ground wire connector, i replace the connector and now all work fine with or without oscilloscope and with 4.7K or 1K pullup resistors to 3.3V. Empirically 2.2K seem to be a good trade-off between current and clean signal edges.

  • \$\begingroup\$ Which STM32 module are you using? Are you connecting GND between the STM32 and the DS1307? \$\endgroup\$ – Adam Lawrence Sep 10 '14 at 15:46
  • \$\begingroup\$ Adam, thanks for reading. Yes ground is connected between STM32 and DS1307. \$\endgroup\$ – rom1nux Sep 10 '14 at 18:51
  • \$\begingroup\$ Too high pull-up resistor would make rising edge slower, not falling. Are you sure you are in open-drain output mode? \$\endgroup\$ – venny Sep 10 '14 at 19:56
  • \$\begingroup\$ Adam look right, this is a ground problem on câble. Problem solved with good cable... sorry to disturbe \$\endgroup\$ – rom1nux Sep 10 '14 at 20:31

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.