For Switchs, Keypad the Pull-up value is not really important. 10K is common, that's what i use. They can be higher... but i stick with 10K.
For switches and Keypad, yes you could use the internal one without having too much problem.
If you don't use any, this will cause you some problem as the internal gate don't see a logic level... it will see noise, so it will react weird. It has nothing to do with the Output driver, as the pin is set as Input. And BTW, if you enable ALL internal pull-up, they will be disabled on all Output configured I/O.
<hr>PORTA.x = 1 = 5Volt
PORTA.x = 0 = 0Volt<hr>
To drive a transistor (NPN/PNP) you need a resistor in serie with the base, unless you will burn the I/O. Roughly, if you don't insert a resistor in serie with the transistor base, the i/O will see only a diode, as there's no current limiting resistor the current will be infinite. I=E/R, I=Vdd/0
hence some obvious damage to the PIC which can't provide more than 25mA by I/O, and x/PORT.
The base resistor will have to be calculated. But you need to know how much current your transistor will drive and the transistor Hfe. The base resistor have to be higher than Vdd/25mA to avoid burning the I/O and few time lower than the calculated one to ensure proper switching.
rb=Vdd-0.7/(Ic/Hfetyp)
HTH
Last edited by mister_e; - 18th June 2007 at 01:17.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks