View previous topic :: View next topic |
Author |
Message |
buckeyes1997
Joined: 12 May 2005 Posts: 15
|
PIC affected by human hands?? |
Posted: Sun Jul 03, 2005 4:07 pm |
|
|
Hello
i have a project that works fine and does what its supposed to do, but it seems that whenever i pass my hand near the PIC it turns off. I know that PIC pins that are left floating will go high when a hand is brought near the pins but this is strange. I have one pin im monitoring as an input and its low most of the time. when i turn the device on it works until i pass my hand near it and then it turns off. the condition is that when it reads a high (caused by a human hand) it turns off an LED. its like this think is reading either an input from the input device or from my hand. how can i make it more stable? could the other pins that are not used be a problem?? should i make all unused pins outputs or inputs or something?
thanks |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Jul 03, 2005 4:55 pm |
|
|
Somewhere on your project, you've left off a ground connection
or you've got floating input pins, or a combination of the two.
You can take all unused pins and set them to be low level outputs.
For example, if you're not using Pin E0, then do this:
output_low(PIN_E0);
This assumes that you're using the CCS standard i/o mode,
in which the TRIS is handled by the compiler. |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Sun Jul 03, 2005 7:07 pm |
|
|
your missing a pullup resistor. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
buckeyes1997
Joined: 12 May 2005 Posts: 15
|
thanks guys |
Posted: Sun Jul 03, 2005 7:52 pm |
|
|
hey everyone thanks for helping.
im not sure what i should be grounding other than the PIC. i dont have a cap across the rails, but the input is 5v digital so should be fairly clean. the pins that are not in use are not tied to ground or high they just arent connected to anything. i dont use pullups because i have the weak pullups turned on. i shouldnt need an additional pull up right?
my next step was to try using output_low(pins) at boot and see if that fixes them. im just worried because the only pin that is even used in the program is in input, so if its the other pins that are the problem i dont understand why since i never use them in my code.
thanks for any suggestions. |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Mon Jul 04, 2005 12:44 am |
|
|
You should always put 0.1uf caps as close to the power pins to most all IC's. But this isn't the cause of your problem. Make sure all your power and grounds are connected. Also check your oscillator circuit. |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Mon Jul 04, 2005 3:15 am |
|
|
Quote: | i dont use pullups because i have the weak pullups turned on | The internal pull-up is for most chips only available on port B.
In general, with CMOS chips you have to be carefull with open inputs. An open input pin will have it's input voltage float somewhere in the middle between gnd and VCC. CMOS is so sensitive that just a bit of noise on the input pin will make it switch rapidly between logic high and zero. CMOS has a low current consumption except during switching. The rapid switching of an open input causes a much higher power consumption than you would expect for your circuit.
Most PIC's have their I/O-pins defined as inputs on power up. |
|
|
|