PDA

View Full Version : Hardware problem or what ?



Steve S.
- 2nd March 2007, 20:09
Something strange happens in my circuit......

Think a PIC16F877A were PORTD.1 (pin 20)
is defined as Input (WELDEND VAR PORTD.1)

This pin is pulled to Vdd with a 4.7K resistor and there is (was)
a 0.1uF condenser between the pin to ground (Vss) wich i put
thinking to void noise problem but...

Now the problem....

a signal (Vdd) come to this pin through a n.o. external switch.

When you close the switch no problem

When you open the switch the pic is resetted !!!

Removing the condenser the problem disappear.....


Did you have any idea about.... why?



Steve S.

mister_e
- 2nd March 2007, 20:13
Did you put 0.1uF on both Vdd lines as well?

Did you disable the LVP mode?

How the MCLR pin is attach to VDD?

Steve S.
- 2nd March 2007, 20:53
MCLR is tied up to vdd through a 4.7K res
VLP has been disabled during programming.
Vdd and Vss are both connected and there is a 0,1uF cond between.

WDT is off
BOR is off

mister_e
- 3rd March 2007, 00:34
can you post the offending code here... i miss something...

paul borgmeier
- 3rd March 2007, 07:53
Something strange happens ...
This pin is pulled to Vdd with a 4.7K resistor ...
a signal (Vdd) come to this pin through a n.o. external switch....


Indeed strange – it's not clear to me from what you wrote above .. is your n.o tied to ground? The way you have it written, it looks like it is tied to Vdd because Vdd “come to this pin through” it which makes no sense if your pin is tied weak high.

Something to try ...

If your n.o. is tied to ground, you could

a) increase the pull-up value on the pin in an effort to slow the recharging of the condenser when the switch opens in case your power supply is very very very soft
b) add a decoupler cap of 10uF electrolytic close to your .1uF bypass cap between VDD and VCC
c) add a bypass on MCLR between the pin and the resistor.

Like you said, you fixed it by removing the cap but I am sure you would like to know why - gremlins are scary.

Like Steve said, It would be interesting to see your code as well as what else is going on with your circuit hardware.

Steve S.
- 3rd March 2007, 13:08
Thank Paul,

Yes, i forgot to write that switch connect the pin to ground Vss

Code is very long but it do nothing of strange....



ENDWELD VAR PORTD.1
.
.
INPUT ENDWELD
.
.
PRESSED CON 0
NOTPRESSED CON 1
.
.
.
End_Weld: 'wait for end of welding cycle

if ENDWELD = NOTPRESSED then goto End_weld
.
.


I'm testing the software on the machine and seems to be
insensistive to noise but i wouldn't like to meet with gremlins!

J. Mark Wolf
- 4th March 2007, 12:34
It sounds like your power suppy is "sagging" when you release the switch, because the cap on the PortD.1 is charging, and drawing current from either your MCLR circuit or your power supply.

Add some 10uF caps across the bypass caps on your PIC power pins and the problem should go away.

I learned years ago to use DS1233 reset generator chips on my MCLR pin to solve little issues like this. Never had a problem since.

sougata
- 4th March 2007, 13:31
Hi,

It all seems so strange. It is really difficult to comment without having the schematics and the code handy. If you are using Brownout reset enabled then you can try disabling it. If that solves the problem then there is something wrong with your PS. Also take care that all your VDD/VSS pins (11/12<->32/31) are hardwared. Although they are internally connected you cannot give power to one and draw out from the other.

Steve S.
- 4th March 2007, 21:39
Thanks to all,

i will try monitoring the power line and MCLR to see if something strange will appear also if without the cap seems to work fine and seem also to be insensitive to noise.

about PIC programming.... oscillator XT all aother flags OFF.

This week the hardware and firmware will be extensively tested
on a induction welding machine in a very electrically noisy environment

AC and DC line will be monitorized...

When the gremlins will be found i will post his head in the forum!









about