Topics Topics Edit Profile Profile Help/Instructions Help Member List Member List  
Search Last 1|3|7 Days Search Search Tree View Tree View  

PIC16F873A-I/SP Reset Problems

:: EPE Chat Zone ­:: ­Radio Bygones Message Board :: » EPE Forum Archives 2005-2006 » Archive through 07 December, 2005 » PIC16F873A-I/SP Reset Problems « Previous Next »

  Thread Last Poster Posts Pages Last Post
  ClosedClosed: New threads not accepted on this page        

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

Sounded_simple
Just joined
Username: Sounded_simple

Post Number: 1
Registered: 12-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Monday, 05 December, 2005 - 09:10 pm:   Edit Post Delete Post Print Post

Hi All,

New here so here goes.
I have a PIC16F873A-I/SP switching some 12V relays via a ULN2803E (NPN darlington transistor arrary).
Im having some trouble with the PIC resetting quite often, its usually when an input is switched high or low or when one of the relays are switched on or off.
The reset circuit is a simple RC network with a diode between 5V and MCLR (as per the datasheet)
I have diodes and varistors across the relay coils (varistors helped a bit) but the problem keeps occuring once in a while.

The strange thing is that I tried the same program on the same board with a PIC16F873-04I/SP and here is no problem!
Any thoughts?
Top of pagePrevious messageNext messageBottom of page Link to this message

Mikehibbett
Frequent Contributor
Username: Mikehibbett

Post Number: 306
Registered: 04-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Monday, 05 December, 2005 - 09:29 pm:   Edit Post Delete Post Print Post

Do you have a diode across each relays coil, very close to each relay? If not, thats a common problem.

1n4001 or 1n4148 should do.

I'm guessing you have a noise problem and one chip is marginal, the other just working.

Mike
-----
www.drivesentinel.co.uk - Home build GPS Speed Camera Detectors
Top of pagePrevious messageNext messageBottom of page Link to this message

Dave_g
Regular Contributor
Username: Dave_g

Post Number: 30
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Monday, 05 December, 2005 - 09:34 pm:   Edit Post Delete Post Print Post

This sounds like a problem that seems to have an obvious solution - something around the reset circuit - but in fact it's more subtle.

Possibly something is occuring to short circuit the supply, so your problem is not so much reset as "brown out".

Try unplugging the darlington array from it's DIL socket (assuming...) to see if that cures the problem, could be a wiring error or even a duff transistor (short circuit junction) in the array.

Also, make sure the supply is decoupled with a 100n capacitor across the supply as near to the PIC as possible. The odd 100u electroytic will help; it might even be that you need to decouple the high current loads from the PIC supply by a 100R resistor between the two. If you do, make sure ther's a 10u electrolytic across the PIC as well as the 100n.

I'm not sure why the variety of PIC would cause the issue, perhaps someone else can help you there! It may be worth checking datasheets to ensure that configuration bits are the same and that you're not inadvertently causing a software reset or misconfiguring a port. I think that's unlikely offhand, though.

Hope my musings help!

Dave
Top of pagePrevious messageNext messageBottom of page Link to this message

Sounded_simple
Just joined
Username: Sounded_simple

Post Number: 2
Registered: 12-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Monday, 05 December, 2005 - 09:50 pm:   Edit Post Delete Post Print Post

Hi,

I have diodes and varistors accross each coil, I tried RC networks as well but that made no difference.

I have lots of decoupling caps and I have tried various types to kill the noise.

The 100r resistor idea is new - do I put this on the 5V line?

I can see the noise pulses on MCLR on my scope but there does not appear to be noise elsewhere on the circuit!!
Top of pagePrevious messageNext messageBottom of page Link to this message

Mikehibbett
Frequent Contributor
Username: Mikehibbett

Post Number: 307
Registered: 04-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Monday, 05 December, 2005 - 10:04 pm:   Edit Post Delete Post Print Post

Humm...

Clutching at straws now here.

What is your config register set to? More to the point, what setting do you have for low voltage programming? If you have the feature enabled, are you correcting controlling the LVP input pin (I forget which it is)

Mike.
-----
www.drivesentinel.co.uk - Home build GPS Speed Camera Detectors
Top of pagePrevious messageNext messageBottom of page Link to this message

Microguy
Frequent Contributor
Username: Microguy

Post Number: 589
Registered: 09-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Monday, 05 December, 2005 - 10:21 pm:   Edit Post Delete Post Print Post

Remove the relays and see how it operates.

You need to narrow down the problem. So start by pulling all the relays and see what happens.

Reset? Then it's not the relays.

No reset, it's the relays. (in a round about way)

Start by removing them one at a time until you find the problem relay. (it could be more than one, does it happen when you switch TWO at a time??)

You could have a bad diode or varistor, I've seen that before. Is the diode big enough?? Fast enough? Varistor the right rating?

The high voltage being generated by the relays is probably getting back to the power somehow. By that, I mean you need HUGH ground wires or planes, same with supply. Don't skimp on that.

Often, it's not the size of the decoupling you have, but the right decoupling. You're talking about fast very high power spikes. You need fast components to suck it up.

Maybe some ferrite beads in line with the relay on in line with the CPU. At Siemens, we had ferrite beads just about everywhere, any line that went out of the CPU circuit had them, that and protection.

Maybe a "perfect capacitor", that's a tantalum, a disk and a ceramic in parallel, using the best quality from each one.

It's possible you have to either go with opto-isolators, solid-state relays and dual supplies or a combination of them.

The series resistor is a good idea. Put that in line with the relays to lower the power generated, a cap in parallel with the relay may help absorb the spikes too, small and fast.

If you have a scope, use it. Observation is your best tool at this point.

What's driving the inputs? Can you isolate them like you did the relays? To see if that really is the problem?

The problem you have can be very aggravating and hard to find. I spent days hunting down a very similar problem, I mean working 9 hours a day, every day (at work). (then, when I finally tracked it down, the supervisor said in a meeting that I was "Lucky" to find it!! Grrrrrrrrr!!!!) They're small, they're fast, and they carry lots of energy that can bypass lots of things you do to stop them. They're very sneaky.


That's assuming it's not something like the watchdog timer!!)

But no matter what, you need to narrow it down to the specific event that is causing it. Or else you can chase that wild goose around all your life.


Oh, if you beef up the circuit to just keep it from resetting, you may be doing damage to the chip each time it would have reset, so that it will eventually fail later. That's why you need to locate the source and fix the problem, not just find a solution.

(Message edited by microguy on 05 December, 2005)
Top of pagePrevious messageNext messageBottom of page Link to this message

Sounded_simple
Just joined
Username: Sounded_simple

Post Number: 3
Registered: 12-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, 06 December, 2005 - 08:50 am:   Edit Post Delete Post Print Post

Hi,

The noise is definitley coming from the relays, when they are removed the problem never happens.
I will have to experiment with relay suppression.

I will let you all know my findings.

Regards
Paddy
Top of pagePrevious messageNext messageBottom of page Link to this message

Epithumia
Frequent Contributor
Username: Epithumia

Post Number: 137
Registered: 07-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, 06 December, 2005 - 10:42 am:   Edit Post Delete Post Print Post

Make sure there are no common ground or common power problems: don't run the relay coil current through the same wires that power the PIC.

Diagram
'Bother,' said the Borg. 'We've assimilated Pooh!'
Top of pagePrevious messageNext messageBottom of page Link to this message

Mike_b
Frequent Contributor
Username: Mike_b

Post Number: 113
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, 06 December, 2005 - 12:17 pm:   Edit Post Delete Post Print Post

You could try dual zeners just above the supply voltage (say 6V) - they conduct when an overvoltage of either polarity is generated by the coil:

relay -----|>_|-----|_<|------- relay

OR

try lashing up a metal cover for the relays or pic with an earthed metal cover and look at the scope - you may have electromagnetic pickup - you can then tidy the design up if this cures the problem.


rgds

mb

Administration Administration Log Out Log Out   Previous Page Previous Page Next Page Next Page