Shop OBEX P1 Docs P2 Docs Learn Events
sainsmart rtc interfacing — Parallax Forums

sainsmart rtc interfacing

I have a sainsmart rtc module connected to a propeller. I have 1k resistors between module and prop. The module has pullup resistors approximately 3.3k. I cannot get Key's demo program to connect to the module. The at rest voltage on the SDA and SCL pins of the module is 4.08v and the pins on the prop are reading 3.8v. Anybody have any suggestions.

Comments

  • train nut wrote: »
    I have a sainsmart rtc module connected to a propeller. I have 1k resistors between module and prop. The module has pullup resistors approximately 3.3k. I cannot get Key's demo program to connect to the module. The at rest voltage on the SDA and SCL pins of the module is 4.08v and the pins on the prop are reading 3.8v. Anybody have any suggestions.

    I figure this is an I2C RTC? If so the 3.3k resistors will keep the Prop safe. Lose the 1k resistors.

    The module shouldn't be actively driving the I2C lines so the only 5V the Prop sees is through the 3.3k resistors. These resistors will keep the current below 500uA limit on the Prop's I/O pins.

  • Cluso99Cluso99 Posts: 18,069

    Duane Degn wrote: »
    train nut wrote: »
    I have a sainsmart rtc module connected to a propeller. I have 1k resistors between module and prop. The module has pullup resistors approximately 3.3k. I cannot get Key's demo program to connect to the module. The at rest voltage on the SDA and SCL pins of the module is 4.08v and the pins on the prop are reading 3.8v. Anybody have any suggestions.

    I figure this is an I2C RTC? If so the 3.3k resistors will keep the Prop safe. Lose the 1k resistors.

    The module shouldn't be actively driving the I2C lines so the only 5V the Prop sees is through the 3.3k resistors. These resistors will keep the current below 500uA limit on the Prop's I/O pins.
    What !?!?!

    Of course the RTC drives the SDA line. Otherwise how do you think the data is read out of the RTC???

    I presume the RTC is being driven at 5V. The pullups are a bit low. 10K would be better. A series resistor (1K should be good) at least in the SDA line is going to help protect the prop. Alternately there is a circuit from NXP that connects 5V and 3V3 I2C lines.

  • There's no need to put the 1K resistors in line if the pull-ups are 3.3K or higher -- the I2C devices cannot drive either line to 5v.
  • The SDA output is indeed open drain; it cannot actively drive high. So the 1K resistor is not needful. On the other hand, I cannot see that it is hurting anything because the prop input is very high impedance. Replacing it with a wire will only change the "rest" level at the SDA pin.
  • kwinnkwinn Posts: 8,697
    Cluso99 wrote: »
    Duane Degn wrote: »
    train nut wrote: »
    I have a sainsmart rtc module connected to a propeller. I have 1k resistors between module and prop. The module has pullup resistors approximately 3.3k. I cannot get Key's demo program to connect to the module. The at rest voltage on the SDA and SCL pins of the module is 4.08v and the pins on the prop are reading 3.8v. Anybody have any suggestions.

    I figure this is an I2C RTC? If so the 3.3k resistors will keep the Prop safe. Lose the 1k resistors.

    The module shouldn't be actively driving the I2C lines so the only 5V the Prop sees is through the 3.3k resistors. These resistors will keep the current below 500uA limit on the Prop's I/O pins.
    What !?!?!

    Of course the RTC drives the SDA line. Otherwise how do you think the data is read out of the RTC???

    I presume the RTC is being driven at 5V. The pullups are a bit low. 10K would be better. A series resistor (1K should be good) at least in the SDA line is going to help protect the prop. Alternately there is a circuit from NXP that connects 5V and 3V3 I2C lines.

    The SDA line is open drain so the RTC or RAM will send data out on that line when commanded to do so by the Prop. The SCL is an input to the smartsain board that the Prop outputs when reading or writing data to the RTC or RAM chip.

    The output voltage on SDA is determined by the input voltage to the smartsain board. What voltage are you inputting to the board?
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-11-23 17:26
    Cluso99 wrote: »
    Of course the RTC drives the SDA line. Otherwise how do you think the data is read out of the RTC???

    Yes, of course you're right. I misspoke. I should have said the RTC doesn't drive the data line HIGH.

    I still think the 1k resistors are a bad idea. When the Prop pulls the line low to send data, the RTC will only see a low level of 1.16V instead of 0V.

    Won't the 1k resistor with the 3.3k resistor create a voltage divider on the RTC's input pin?

    5V * 1k / (1k + 3.3k) = 1.16V

    Isn't that the way it would work?
  • Oops. Duane is correct, of course. I didn't think about the prop driving a "zero" case. My bad. Lose the 1K resistors.
  • Thanks guys I leave the 1k resistors out and see what happens.

    Thanks again
    Ben
Sign In or Register to comment.