CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

inputs on 16F628

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Feb 21, 2005 8:43 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group