Pic reset and following lock up problem


Closed Thread
Results 1 to 20 of 20
  1. #1
    Join Date
    Dec 2007
    Posts
    11

    Default Pic reset and following lock up problem

    Hi Everyone,
    I am building a Pic based automotive ignition coil driver. I use CMOS operational amplifier to drive a MOSFET that grounds the coil primary winding (I have attached the circuitry and the code I am using). The problem is that every time the coil fires the Pic resets that causes the coil to be triggered again instantly rather than in a set period of time. After several seconds the Pic locks up and I have to reset it manually. If I disconnect the coil everything works fine. I am using 16f628a but I also tried 16f877a and 16f84a with 4Mhz oscillator it made no difference. The circuit is built on a breadboard and I use a battery as a power supply for the coil and Pic. I’ve attached the oscillograms taken at various points of the circuitry and a photo of the project. The scope traces are not synchronized I put them in one file for convenience. I shall appreciate any help or advise.
    Attached Images Attached Images    
    Attached Files Attached Files

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Woohaa, it's certainly not something i would try on a breadboard... Anyways, i would suggest to use something else than this opamp to drive your mosfet, use mosfet driver TC1427 or whatever else. Isolate your logic ground and your power ground, don't leave any pin floating even if they're set as output, and plah plah), keep your coil away from your pic.

    Breadboard is nothing else than a big antenna, and of course this is one of your main problem.

    Not sure if a Cordless battery have enough guts...

    You could try to disable the brown out detect.. but i'm not a fan of disabling this feature...

    100 uF at the input of the regulator... increase it as much as you can and see if this improve results.

    100uF at it's output is almost pointless, i would suggest to decrease the value to say 10uF tantalum and also add a 0.1uF at the output.

    Try something else... use another voltage source for your PIC, wall wart, 9V battery whatever else, and leave the Cordless tool battery for your Coil.

    See how better/worst it is with the above suggestion and post your results.
    Last edited by mister_e; - 3rd January 2008 at 07:43.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Dec 2007
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    Hi Mister_E,
    Thanks for the valuable information. I would really like to make this circuitry work on the breadboard. Then I can transfer it to the strip board assuming that if it works fine on the breadboard it will definitely work on the strip board.

    I increased the capacitor on the 12v side up to 2200uF in 100uF steps. It made no difference.

    Put 10uF tantalum capacitor on the 5v side. It made no difference.

    Placed additional 0.1uf right across the Pic. That improved it a bit but still after several coil firings the Pic locks up.

    Disabled Brown-out reset it made no difference.

    Pulled MCLR directly to 5v the PIC stopped working all together so I had to replace it

    Powered the Pic of a separate power supply (my programmer is capable of supplying 500mA so I used it) and left the battery for the coil. It made no difference.

    When I touch MCLR pin with a needle probe PIC locks up immediately so I tried to put 0.1uF capacitor from MCLR to Earth it made no difference. Removed the capacitor.

    Inserted 40v 1A schottky diode into 5V supply line. That improved it a bit. Put 0.1uF capacitor from MCLR to ground. This time it worked. I can touch MCLR pin and it makes no difference. It improved the performance but unfortunately PIC still resets and if I increase the spark gap it locks-up.

    Put voltage limiting Zenner diodes on 12v and 5v supply lines. 6.2v on 5v and 18v on 12v supply line. It made no difference.

    Inserted 100uH inductor into 5v supply line. It made no difference. Put 100uF capacitor from one side of the inductor to ground, no difference.

    Replaced voltage regulator with 5v 1A low drop out LM2940-50C. It made it worse. When PIC locks up the regulator heats up considerably. Put LM7805C back. It improved stability.

    Replaced the OP-AMP with TC1427 mosfet driver. It made no difference.

    I redraw the schematics to accommodate the changes. The code is the same.
    But never mind will keep on trying
    Attached Images Attached Images  

  4. #4
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    947


    Did you find this post helpful? Yes | No

    Default

    Keeping your circuit exactly as it is, I suggest you connect a high current schottky diode across the coil primary(cathode to +12V). This should clear your problem (fingers crossed )

  5. #5
    Join Date
    Dec 2007
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    Hi Jerson,

    I put a schottky diode across the coil primary terminals. I’ve attached the scope traces taken at the coil negative (switching point). It does fix the problem completely. It proves the need for suppression diode whenever inductive load is switched on and off. Though in my case it makes the ignition system inoperative. Absence of the voltage spike at the primary side means that no high voltage will be generated at the secondary side and there will be no spark. Nevertheless thanks for the advise. I have learned something about suppression from this.

    I also tied to use switch mode step-down voltage regulator LM2574N-5. It does not make much difference and requires several external components to operate.

    When I touch any oscillator pin the PIC stops. I tried to remove oscillator capacitors one at a time and tried different brand oscillator. It didn’t change a lot. I tied to use external clock source. I used 16f628 at 20MHz powered from and independent power supply. Using High and LOW command in a tight loop gave me 500kHz signal. So I adjusted my original code to keep the length of the driving signal the same and changed configuration fuses accordingly. It made the system less stable.

    I also changed the MOSFET (had to because it stopped working )to IGBT 12N60A4. I think the reason for the MOSFET to fail was the clamping voltage. So I lowered it to 200v intending to rise it later to 300v. It improved the stability. The problem is still there though.
    Attached Images Attached Images  

  6. #6
    Join Date
    Dec 2007
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    Hi Everyone,

    My IGBT stopped functioning as well as the mosfet. It measures short circuit between Collector and Emitter. I replaced IGBT with vb921 dedicated coil driver. It made no difference. After a while the mosfet driver TC1427 stopped working and got really hot. I increased the value of the resistors at its input and output to 10 kOm. Installed the other TC1427 and after several firings of the coil it got really hot and stopped working. So I ordered more parts

  7. #7
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Lightbulb

    Hi, Zerosvarka

    First of all, you should use an ignition dedicated Ibgt, like

    - ISL 9V5063 P3
    - IRGS 14 C 40
    - MGP 15 N 40
    - FGB 3040 CS

    ...

    they include their own overvoltage protections ( your Zeners are Wayyyyyyy tooooooo slow !!! ).

    Second, you'll have to take great care of the 12 > 5 v section, serial inductors HAVE to be used to kill the spikes from the coil. Two cascaded regulators are not a view of mind here.

    Third, the locking problems ...
    ahaaaaaa, here, generally, the ground connections are made via the car body ... and are not good at all ( rust, oxydation, paint relieves ... ) . Try "star" connections to a same point. ( like HiFi !!! )

    - and remember a breadboard doesn't like high currents or high slew rate signals.


    NOW ... I see you use a NiCad 1500-1700 mah as a primary battery ... That's way too weak to drive a Car ignition coil AND give a "clean" 12 v ... ( see Osc pict. ...)





    and most of all : ...

    don't tell me your Ibgt is the little black thing with a heatsink, on the upper right part of your breadboard ...
    Connected to the coil with thin gauge wires ...



    begin by a "real world" wiring with ONLY the 5 volts section on the Breadboard ... at least use "veroboard" for the rest of the components ...

    The problem is in the wiring and supply ... nowhere else.



    This kind of design should work ... and have been working fine for years aboard the ignition we designed for Alpine A110 cars ...

    The "Alpine A110 AEPL" ... it's it !!!

    Alain
    Last edited by Acetronics2; - 21st January 2008 at 09:54.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  8. #8
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Hi, Zerosvarka,
    I have to agree with Acetronics, an automotive coil uses about 6 - 7 amps RMS, so in reality it is using probably 6 times that in very short bursts, making everything Acetronics said make sense. Big also, what do you expect to keep cool with a little Chicken S_ _ T heatsink like that, maybe a 7805 regulator, but never your switching transistor. Really good connections will lose some voltage at those currents and the really bad connection associated with breadboards will cause heating and big time voltage loss. Cars require ROBUST parts, and then even then they fail. Good luck, and keep us posted, I would like to see the results when you have it working.
    JS
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  9. #9
    Join Date
    Dec 2007
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    Hi Everyone, and thanks once again for all the advises.

    So this is redesigned circuitry. I’ve included a photo so that you can assess it.
    The 12v side is assembled on the veroboard and the 5v is still on the breadboard. I ran all the earths back to the battery terminal. I use IRGS14C40L IGBT with internal voltage clamping. Improved the heat-sink and changed the battery to a car battery. I put 18v Zenner and 6.2v Zenner on 12v and 5v respectively. After 5v regulator the 5v power line goes through 100mH inductor and schottky diode. I’ve got 0.1uF capacitor from MCLR pin to ground.

    Ran the circuit first time with IGBT disconnected no problems. Connected the IGBT but left the secondary winding open circuited (in this case coil fires inside of itself) no problems. Connected the secondary winding circuit(earth). I think secondary winding earth (black/red wire on top of the coil) acts as an aerial. Got the Reset problem back. After several firings the driver TC1427 got hot and locked the output to 12v irrespectively of it’s input.

    So I replaced it with the old op-amp LMC6482IN. Several firings and it got hot and stopped functioning.
    These are all the results up to now but I shall keep on working
    Attached Images Attached Images   

  10. #10
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Hi zerosvarka, Heat sink looks better, should be Aluminium or Copper, steel is a poor conductor of heat. You should have somewhere for that big old spark to go, put a plug wire into it attached to a sparkplug and ground the plugs outer shell, think where is the spark going now, if it flashes over to the side the transistor is on it's time to practice replacing it again. ! more thing, the coil looks like a used unit, how much current is the primary pulling, and do you have a current limiting resistor in the primary circuit?
    Last edited by Archangel; - 29th January 2008 at 08:25.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  11. #11
    Join Date
    Dec 2007
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    Hi Joe S,

    I replaced my IGBT driver with CNY17-1 opto-coupler. That brought my circuit back to life. But the old reset problem still exists.
    When I touch one of the crystal pins with a needle probe Pic locks up and when I remove the probe it starts working again. When I touch the other crystal pin or any other Pic pin nothing happens.

    When I trigger the IGBT driver using Pic powered by the programmer/evaluation board. The reset problem doesn’t improve and eventually it blows the 315mA fuse in 12v power supply of the programmer. The Pic is 16f628 positioned on a sim stick that is plugged into the programmer. The 20Mhz crystal, capacitors and MCLR pull up resistor are positioned on the sim stick as well.

    I replaced the secondary winding earth wire with a high-tension lead and a spark plug and attached the earth to the spark plug outer shell. That fixed the problem. Pic works stable. Though I would still like to get it to work without the additional resistance in the secondary circuit. This would make the circuit a bit more robust. I will try to get the current clamp and graph the primary current and solve the crystal problem.

  12. #12
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default

    Hi, Zeros

    << When I touch one of the crystal pins with a needle probe Pic locks up and when I remove the probe it starts working again >>

    This is absolutely normal ...,

    I think you should add a 10µF Tantalum CLOSE to the Pic ( on the pic side of your coil )

    << I replaced the secondary winding earth wire with a high-tension lead and a spark plug and attached the earth to the spark plug outer shell >>

    This is "real life" config, it seems ...


    You'll Find attached some "bullet proof" scheme ... moreover, easy to use !!!

    Alain
    Attached Images Attached Images
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  13. #13
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by zerosvarka View Post
    Hi Joe S,

    I replaced my IGBT driver with CNY17-1 opto-coupler. That brought my circuit back to life. But the old reset problem still exists.
    When I touch one of the crystal pins with a needle probe Pic locks up and when I remove the probe it starts working again. When I touch the other crystal pin or any other Pic pin nothing happens.
    The needle probe acts as a path to ground for the oscillator and the oscillator stops as a result, just what I would expect that tiny little R/F oscillator to do.
    When I trigger the IGBT driver using Pic powered by the programmer/evaluation board. The reset problem doesn’t improve and eventually it blows the 315mA fuse in 12v power supply of the programmer. The Pic is 16f628 positioned on a sim stick that is plugged into the programmer. The 20Mhz crystal, capacitors and MCLR pull up resistor are positioned on the sim stick as well.
    Remember 25 ma per output total all outputs . . . oops I cannot remember and I am in the house right now, but probably less than what that IGBT requires.
    I replaced the secondary winding earth wire with a high-tension lead and a spark plug and attached the earth to the spark plug outer shell. That fixed the problem. Pic works stable. Though I would still like to get it to work without the additional resistance in the secondary circuit. This would make the circuit a bit more robust. I will try to get the current clamp and graph the primary current and solve the crystal problem.
    Then you need a coil who's primary is wired to work on 12 volts. standard automotive 12v coils are made to operate on about 7 volts. The late modle GM HEI coils may in fact be 12v, I do not know for sure, the coil for an 1989 chevy caprice with 350 and F.I. is a square coil with a standard sparkplug tip secondary electrode and may serve you well, they cost about $45 US and make sparks in the lethal range, really big nasty blue sparks! Or check companies like ACCEL or Mallory or MSD for Hi Perf aftermarket coils, their tech support people can advise as to whether or not a primary resistor is required. BTW I have seen up to 60 KV from a GM HEI coil.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  14. #14
    Join Date
    Dec 2007
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    Hi Everyone,
    While I am ordering more hardware I have got current clamp and graphed the current draw. The clamp was set to 10mv/A and is clamped around all the earth wires just near the battery terminal. Top signal is the current and the bottom one is the trigger.
    Attached Images Attached Images  

  15. #15
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    The late modle GM HEI coils may in fact be 12v, I do not know for sure
    They are straight up 12V. The early coils for points type distributors also had an 'S' terminal on the starter. You hit the key, the coil gets it's juice direct from the battery since the starter is already killing off some voltage. You release the key, the coil gets juice thru the ballast resistor, knocking the volts down to 7-ish like you said. Keeps the coil from overheating.
    The HEI coils can run 12V because of the inherent variable dwell (not to mention they're designed for it), whereas the older coils for points had a more-or-less constant dwell.

    What's really fun is to hook a coil up to an 'old-school' turn signal flasher and a single spark plug gapped to about 1/4"+ and zapping your friends.

  16. #16
    Join Date
    Dec 2007
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    Hi Everyone,

    I use Usb to Serial adaptor to communicate between Pic and PC. I noticed that when I fire the coil without the high tension lead and spark plug (the spark jumps to the secondary earth wire that goes to the battery negative terminal) my Usb to Serial adaptor locks up and I have to reconnect it on the usb side. But if I communicate with stand alone Pic powered from a separate power supply and trigger the coil from my circuit everything works fine.

    I tried to Debug Status and Pcon registers to determine the cause of the reset. When I disconnect power or ground the MCLR pin it doesn’t change the registers. I attached the code. Can someone have a look at it please
    Attached Files Attached Files

  17. #17
    Join Date
    Dec 2007
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    Hi Everyone,
    Sorry for delay. I have assembled the circuitry as suggested by Acetronics. I was adding one part after the other and checking for any changes. When I run the coil with suppressed resistance type high tension lead (all the modern cars) everything works fine. When I run the coil with old-fashioned copper core high-tension lead or just a wire(cars before 197x) it does not work properly. As soon as the coil fires it resets the Pic and it fires the coil again without delay. Obviously it needs more work. I will carry on and post the results

  18. #18
    Join Date
    Dec 2007
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    Hi,
    Thanks to this forum I’ve got it working.
    I used this thread http://www.picbasic.co.uk/forum/showthread.php?t=11222
    So I changed the PIC to 12F683 configured MCLR as an input and used 8MHz internal oscillator. MCLR pin is protected by 5vTVS. I attached circuitry and the code I use. The REFIRE and REFIRE2 allow to hear when reset occurs. I started with suppression lead and resistive sparkplug (they both suppress interference). Then substituted adjustable spark tester (1 cm gap) for spark plug and then removed the suppression lead leaving bare gap (no suppression). When the coil fires it creates quite a strong interference. My laptop screen flickers (laptop just seats on the same table), USB to SERIAL converter locks-up(use it for RS232) and my scope freezes (none of these devices are connected to any circuitry). But the PIC works fine and doesn’t reset .
    Attached Images Attached Images   

  19. #19
    Join Date
    Dec 2007
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    Sorry for misspell. It should’ve been None of these devices IS connected to any circuitry.

  20. #20
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by zerosvarka View Post
    Hi,
    Thanks to this forum I’ve got it working.
    Great !
    When the coil fires it creates quite a strong interference. My laptop screen flickers (laptop just seats on the same table), USB to SERIAL converter locks-up(use it for RS232) and my scope freezes (none of these devices are connected to any circuitry). But the PIC works fine and doesn’t reset .
    Looks like a good demonstration of how EMT weapons work, what is this for ?
    Sorry for misspell. It should’ve been None of these devices IS connected to any circuitry.
    Depends upon the neighborhood, in my neighborhood, we would say, None of these devices Are connected to, . . .
    <br>I used to play with MDS decoders years ago, and what I did was get some brass sheet and build a box, into which; I put the oscillator to shield it. I fed it with feed through capacitors. If you really want to shield your circuit, this is an option.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Members who have read this thread : 1

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