??? 02/18/08 08:15 Read: times |
#150990 - read the "bible" and FAQs Responding to: ???'s previous message |
Brian Reid said: I'm no EE or CE. I'm a lowly ME[...] What's EE, CE and ME? Brian Reid said:
Re. your comment on the 1Mohm current limiting resistor I'm using. I based that on the info given in the MCU datasheet that says the maximum logic 1 input current is 10uA. I took that as a maximum rating, perhaps incorrectly, so I went with a 1MOhm to limit the input current to 5uA given a 5V Vdd. Did I misunderstand the spec? Yes. This is input leakage, i.e. the current your external circuit should supply to ensure a valid logic level on the input. As you cannot source the specified 10uA through the 1MOhm resistor, you should reconsider it's value. As the input leakage is the ultimate limiting value in case the pin is in the high impedance state, you don't put any resistor in series. Nevertheless, it might be a good idea to limit the current in case of inadvertent setting of the pin to 0, when the relay is on i.e. the external circuit puts 5V on the pin. In this case, the maximum allowable current should be under the specification of Absolute Maximum values - but AD did not care to specify it, so you might resort to the Digital Outputs section (page 5), which defines output voltage of port 0 pin under 1.6mA load (sink), i.e. this is certainly a safe current. In other words, any value between 3k3 and 470k will do. Brian Reid said:
The MCU datasheet did not say the P0 ports default to inputs. Please note that I (and the datasheet) avoid using terms such as "input mode" and "output mode" of the ports. There is nothing such. The '51 ports are traditionally quasi-bidirectional, and this derivative appears to continue this tradition. YOu should really read the "bible" (i.e. the manual of the original 8051, links in this FAQ), the FAQs on inputs/outputs, and all the FAQs on this site, generally. Have fun! Jan Waclawek |