I am trying to create a small project on PIC16F877a MCU, in which I am showing the lifetime of this project using RTC module and the temperature read from LM35 onto an LCD.

Working with PULLUP Resistor Working with PULLUP Resistor

Not working with 2k pullup resistors Not working with 2k pullup resistors

The simulation of this project works fine in Proteus software, when I replace the pullup resistors for the I2C with the component "PULLUP" in the proteus library. But my ultimate goal is to implement this in hardware, so from I2C pullup resistor calculation formulas, the values calculated for this MCU is as following:

Rp(min) = (5V-0.6V)/8.5mA = 517.6 ohm

Rp(max) = 1/(0.8473)400(10^-12)*(10^3) = 2.9 Kohm

using these values from the MCU datasheet:

tr = 1000ns, Cb = 400pF, Iol = 8.5mA, Vol = 0.6V, Vcc = 5V

The I2C module is working at 100KHz.

But the issue is that I have tried various values in this range, but the time shown on the LCD remains 00:00:00. Can someone please guide me what I am doing wrong?

  • \$\begingroup\$ I think this may just be a modelling issue. This looks like a Proteus simulation - are you sure the pull-up are not just a logical component, rather than a physically modeled component? I would check the documentation that came with your software. \$\endgroup\$ – N.G. near Aug 17 '16 at 19:46
  • \$\begingroup\$ This is a proteus simulation. The PULLUP component is from modelling primitives library and the RES component is from resistors library. \$\endgroup\$ – Mohsin Aug 17 '16 at 19:50
  • \$\begingroup\$ Don't waste time on the vagaries of simulation environments. \$\endgroup\$ – Scott Seidman Aug 17 '16 at 20:04
  • \$\begingroup\$ Simulation is a huge step towards completing a project, if such vagaries are common in Proteus software, then it defeats the purpose of simulation. Thank you for your help @N.G.near. Will move on to hardware stage. \$\endgroup\$ – Mohsin Aug 17 '16 at 20:08
  • \$\begingroup\$ I think the question highlights the difference between logical and physical simulation, so does have some validity. \$\endgroup\$ – N.G. near Aug 17 '16 at 20:08

You have answered your own question! The fact that the PULLUP is a modelling primitive tells you that it has a logical function and is not a physical component i.e. it tells the simulator something - but it's not a real resistor.

  • \$\begingroup\$ The funny thing is, I have tried using RES from resistors and Resistorfrom modelling primitives library too. The simulation should work for any one of these two components. \$\endgroup\$ – Mohsin Aug 17 '16 at 20:01
  • \$\begingroup\$ Is it safe to say that in hardware, the project will work with 2Kohm pullup resistors? Is this a negative feature of Proteus that it is not even able to model a resistor or something is wrong in my simulation? \$\endgroup\$ – Mohsin Aug 17 '16 at 20:03
  • \$\begingroup\$ Not necessarily - logical simulation and physical simulation are not the same thing. I wouldn't worry too much - it is just how simulators work. I would refer this to the software support if you are concerned - it could be a bug after all. \$\endgroup\$ – N.G. near Aug 17 '16 at 20:06
  • 1
    \$\begingroup\$ @Mohsin - this is I2C, so what resistors you can get away with depend on the capacitance on cables on the bus. A simulation that doesn't model cable capacitance won't help. \$\endgroup\$ – Scott Seidman Aug 17 '16 at 22:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.