R
Robert Monsen
Guest
Danny T wrote:
Connecting it to ground would just waste 0.5mA to no purpose.
The pullups work just like an external 10k resistance to Vdd. The point
is that you can set ports up as inputs without worrying about the CMOS
'floating input' problem, which causes a big current drain when a CMOS
input sits 1/2 way between ground and Vdd.
As far as your circuit goes, if you use these pullups, you don't have to
connect the port to anything, it will automatically read as high when
you look at it, and won't consume inordinate amounts of power.
You can also use this to your advantage with pushbuttons, for example.
Use a normally open pushbutton, set the port to use the internal weak
pullups, and connect the other side to ground. Then, if you push the
button, the port will read 0, otherwise, it'll read high.
If you aren't using the port, however, you can just set it to be an
output using the TRIS register, and then safely leave it unconnected.
--
Regards,
Robert Monsen
"Your Highness, I have no need of this hypothesis."
- Pierre Laplace (1749-1827), to Napoleon,
on why his works on celestial mechanics make no mention of God.
It's under 'special features of the CPU', where it talks about MCLRRobert Monsen wrote:
I just removed the 4.7K resistor on my breadboard, and it still works
the same. I'll ignore this in future
I just looked at the datasheet for the 16F676, and it specifies a
resistor of at least 1k, along with an optional cap of 0.1uF to
ground. This is on pg 58 of the 16F630/16F676 datasheet.
I'm currently using 16F627 and 12F629. What section of the datasheet was
it under, so I can check what these say?
I don't think so. Connecting it to 5V would just bypass the resistor.4. RA2 has a jumped, and gets tied to +5V or ground, via a 1k
resistor. I've been using 10k - how important is this value?
The value is not critical; 100 ohms or 100k would also work.
Actually, many microchip parts have internal "weak pullup resistors",
which can be turned on and of individually for port pins. They are
10k. Look at the datasheet for your part.
I noticed these, but didn't full understand them. If these are turned
on, is it safe to remove the resistors and connect directly to 5V/Ground?
Connecting it to ground would just waste 0.5mA to no purpose.
The pullups work just like an external 10k resistance to Vdd. The point
is that you can set ports up as inputs without worrying about the CMOS
'floating input' problem, which causes a big current drain when a CMOS
input sits 1/2 way between ground and Vdd.
As far as your circuit goes, if you use these pullups, you don't have to
connect the port to anything, it will automatically read as high when
you look at it, and won't consume inordinate amounts of power.
You can also use this to your advantage with pushbuttons, for example.
Use a normally open pushbutton, set the port to use the internal weak
pullups, and connect the other side to ground. Then, if you push the
button, the port will read 0, otherwise, it'll read high.
If you aren't using the port, however, you can just set it to be an
output using the TRIS register, and then safely leave it unconnected.
--
Regards,
Robert Monsen
"Your Highness, I have no need of this hypothesis."
- Pierre Laplace (1749-1827), to Napoleon,
on why his works on celestial mechanics make no mention of God.