??? 02/27/08 16:37 Modified: 02/27/08 16:40 Read: times |
#151543 - You have totally misunderstood the situation Responding to: ???'s previous message |
How to choose a proper pull-up:
Your micro can sink up to 4mA, when emitting low state. Output voltage then is 0.4V maximum and by this complying with TTL-standards. But your micro can withstand even a much higher sink current without getting destroyed. I haven't found the correct value in your datasheet, but it must be more than 10mA typically. Take a 4k7...10k pull-up in your application and you are fine. How to choose a proper series limiting resistor: What you do with the series limiting resistor is dangerous! Not because something can be damaged, but because you make it your micro nearly impossible to swing to low state at your port pin. Have a look at this discussion to see what currents are flowing out of the port pins: http://www.8052.com/faqs.phtml?FAQ=121619 In this context have a look into datasheet and find out how high your "Logic 1-0 transition current" is. This is the current which the micro outputs before it turns off the internal weak pull-up pFET3 to allow the port pin to accept low state. If your series limiting resistor is too high, then the voltage drop across it (due to the "1-0 transition current"!) is too high to let the potential at port pin fall under the threshold level (about 2V) which is needed to make the weak pull-up to turn off!! I wouldn't choose a bigger series limiting resistor than 1k in an 8051 application. How to protect your inputs of micro: Although in your application a series limiting resistor isn't needed to protect the port pin from dangerous sink currents, there is sometimes a problem in 8051 applications with just the opposite, means there's a need to protect the port pin from dangerous source currents, when the port pin is emitting high state and your sensor output is emiting low state! This can happen, for instance, during a power-up until the power-on reset has put the ports into high impedance state. In such situations I put a series limiting resistor of 330 Ohm between driver and port pin, just in the way as you did. So, increase your pull-up to 4k7...10k Ohm and decrease your series limiting resistor to 330 Ohm and you will be fine. Kai |