Mysterious Reset


Closed Thread
Results 1 to 25 of 25

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    brooklyn
    Posts
    33

    Default Mysterious Reset

    Hello,

    My current application is too specific to really get into in a forum post. I've got a complex circuit with cascading SIPOs and PISOs, which takes inputs from analog and digital sensors, and uses darlington arrays to drive relays.
    My problem is that the controller has a habit of resetting itself frequently, but not so that you can tell what is causing the issue.
    I'm running with a 16F819, and the code is tapping on the ceiling of memory.
    At one point I had configured pin A.5 as input, and had a microswitch attached to it via about 15' of 16g lamp cord. I thought the problem was with the MCLR not configuring correctly in the code, so I switched it out and am now inputting the microswitch signal to an analog input [pretty chunky, I know], but I'm still getting the phantom reset.
    I've debugged the physical circuitry until my eyes are crossed, and I don't have any problems there, evidenced by correct opperation, albeit with intermittent restart.
    I have received a stack of 16F88, and will be using that chip for further development, as I'm in need of more memory.

    I'm wondering if this rings a bell with anyone out there? I did notice that the problem subsided after I changed the pin confguration and set A.5 as MCLR.

    I have a 1000uF cap decoupling the chip, with a 10K pulling MCLR high. My powersupply is from Mouser: 5V, 5A part# 552-PSA-25LS-050-R.

    I will be plugging in the 'F88 tomorrow, and that might solve the issue... but still! What's going on?

    Thanks for your help!
    I've gotten much out of searching the forums for the past few months!

    -Joel

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by JoelMurphy View Post
    Hello,
    I have a 1000uF cap decoupling the chip, with a 10K pulling MCLR high. My powersupply is from Mouser: 5V, 5A part# 552-PSA-25LS-050-R.

    I will be plugging in the 'F88 tomorrow, and that might solve the issue... but still! What's going on?

    Thanks for your help!
    I've gotten much out of searching the forums for the past few months!

    -Joel
    You might have a 1000uF, nice fat cap across the rails, and they might even be right at the PIC, but...do you have a small cap with low ESR right there also? Generally speaking, a 1000uF cap is more for power smoothing, not decoupling. The problem might be that the big ol' fat cap can't do it's job at high freq's because of high ESR...in other words, works at low freq's, not at high freq's. I'd (as well as others I'm sure) suggest putting a .1uf right at the PIC's power/ground pins, both sides (if you're using that sort of PIC, 40 pin types). I'd doubt if an 'F88 will solve your problem.
    Also, you're driving relays. You might have enough juice coming out of your power supply to drive everything...steady state. But what about the instant that a relay closes? If your power supply can't handle the instantaneous load (which could very well be far above the steady state load), you get voltage drop (which the 1000uF should help with), and instant reset

    And don't forget about putting a 'dump diode' across the relay coils. Without one, a relay can really screw with a power supply in unintended ways.
    Let us know what happens...
    Last edited by skimask; - 19th February 2007 at 04:46. Reason: Forgot the 'dump diode' across the relays

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    There are 4 bits that indicate what caused a RESET.
    Code:
    POR	Power-On Reset	PCON.1
    BOR	Brown-out Reset	PCON.0
    TO	Time-out bit	STATUS.4
    PD	Power-down bit	STATUS.3
    This table from the 16F818/819 datasheet shows the values of them after various reset conditions.
    You can send them to an LCD or RS232 terminal to determine what happened.

    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1398&stc=1&d=117185912 4"></img>

    BOR/POR must be set manually to detect a Brown-Out Reset. See datasheet section 12.9

    Also, if changing the value of OPTION_REG in your program. Be aware...
    Quote Originally Posted by PIC16F818/819 Datasheet
    Note: To avoid an unintended device Reset, the instruction sequence shown in the
    “PICmicro® Mid-Range MCU Family Reference Manual” (DS33023) must be
    executed when changing the prescaler assignment from Timer0 to the WDT. This
    sequence must be followed even if the WDT is disabled.
    My guess would be something to do with the relays. Possibly back EMF feeding to the power supply.

    And, even though you've got a HUGE capacitor on the power. You should still have a 0.1uf cap from VDD to VSS as close as possible to the chip.

    Another possibility is a Stack Under-Flow. An Over-Flow won't do it, but an Under-Flow (Return without a Gosub) can cause it to jump to address 0000. It looks like a reset, but isn't. But you can see that from looking at those 4 bits.

    HTH,

    P.S. That's pretty weird sending sound thru 4 different bushes.
    <br>
    Attached Images Attached Images  
    DT

  4. #4
    Join Date
    Aug 2006
    Location
    brooklyn
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    Yeah, it's called Vegetable Mediation!

    Thanks for the great advice. I'll put a .1uF cap on the rails right now, and if I'm still having trouble I'll debug those power bits... although, that sounds kinda cool. I might just do that anyway.

    I'm driving the relays with ULN2004A Darlington Chip, so the charge should 'dump' through that ok.
    I'll go over the power supply datasheet to check it's freq specs.
    There may be something to the Stack Under-Flow...

    Also, This reset problem only happens when the entire system is running. That is, the relays are actually driving motor control. When I'm testing the system [Controller goes through it's program, sending power to the 5V relays thru the darlingtons, which send power to the relays that control the motors, but not actually turning on the motors.] it works great!

    Likely problem is the absence of a low ESR.

    Thanks again!

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by JoelMurphy View Post
    Also, This reset problem only happens when the entire system is running. That is, the relays are actually driving motor control. When I'm testing the system [Controller goes through it's program, sending power to the 5V relays thru the darlingtons, which send power to the relays that control the motors, but not actually turning on the motors.] it works great!
    That would lead me to believe that your power supply's output impedance is too high, voltage dropping out if only for a couple of milliseconds, something you'd probably miss even on a 'scope. Starting current for most motors is quite a bit higher than running current, even under load. Maybe try seperating the PIC's power supply from the motor's supply?

  6. #6
    Join Date
    Aug 2006
    Location
    brooklyn
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    yes, skimask.
    the powersupply that is running my controller is outputting 5V to the relays, and I'm also tapping into the 110VAC input to send power out to the motor relays.

    Power to the motors themselves is 220VAC on a separate circuit.

    Maybe I need to put the 110VAC to the Motor Relays on a diferent circuit? the problem is that the issue is still very intermittent. The system may run for 10 minutes without a glitch, it may run for 30 seconds before a glitch.

    gotta admit, i didn't add the .1uF cap yet. just got done debugging my chip upgrade...

  7. #7
    Join Date
    Aug 2006
    Location
    brooklyn
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    oh, also, the problem doesn't always manifest itself when the relay switches on. it could be that the motor relay is on for 10 seconds before it glitches, or there could be NO relays on at all, and then it glitches...

    it's the nature of the beast, i guess. expecting that i could just wake up one morning and tame all the electrons and hold them under my sway...

    joel

Similar Threads

  1. IC12F508 with Internal Oscillator and Software Reset
    By karan123 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 2nd October 2009, 16:13
  2. pic reset sometimes
    By Pedro Pinto in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 23rd January 2008, 17:27
  3. Mysterious Reset Revived!
    By JoelMurphy in forum General
    Replies: 8
    Last Post: - 16th May 2007, 00:26
  4. reset and interrupt vectors
    By dtoohey in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th February 2005, 22:02
  5. Replies: 5
    Last Post: - 1st December 2004, 12:49

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts