PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Feb 21, 2005 8:43 pm |
|
|
Quote: | I have been using an 8 way dip switch which puts the supply
voltage onto each of the Porta input pins. Perhaps this is wrong??? |
The standard method is to put pull-up resistors on the PIC input pins,
and then connect each pin to a DIP switch section. The other side
of the DIP switches all go to ground.
Look at this schematic. He has 1K pullup resistors on RA0-RA2.
Each pin also goes to a switch, and the other side of the switches
go to ground. You don't need to use 1K. I would have used 4.7K
or 10K resistors.
http://www.vermontficks.org/pellets.gif
If you want extra safety, you can put a series resistor between
the PIC pin and the pullup and DIP switch. This prevents you
from accidently shorting the output driver of the PIC to ground,
in case you configure the pin as an output instead of an input,
as you intended. The 470 ohm series resistor limits the current
so the output driver won't be damaged. This is a good idea in
a board designed for students.
Look at the schematic on page 19 of the PicDem2-Plus manual
at the "40-pin Device", at pin RA4 to see this:
http://ww1.microchip.com/downloads/en/DeviceDoc/51275b.pdf |
|