PIC16F819 locking


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2005
    Location
    Hull, UK
    Posts
    2

    Unhappy PIC16F819 locking

    Hi,

    Iam trying to sort out a 'minor' problem. Iam using a 16F819 with internal oscillator running. I have two relays connected via NPN transistors. The relays are fed from 12volts. The transistors are just basic switching transistors.
    The problem is as follows, unit powers up, goes through a brief self test (Flashes 3 leds! a few times), then proceeds to power one of the relays, this works fine. I am using a selector switch connected to other pins to choose one of three options. What iam finding is that quite often the PIC locks up after the relay is powered, it doesnt always happen but it is more often than not. The selector switch ceases to provide the correct output on the LEDs.
    I have noticed one thing, that is if I independently power the circuit it works flawlessly. It is only when I use the onboard transformer that the trouble starts. It has ample amounts of current available. The circuit draws 105mA, the transformer is capable of 192mA. I have added additional smoothing capacitors etc and that only seems to make matters worse.

    Any suggestions?

    Cheers

    Darryl

  2. #2
    Join Date
    Mar 2005
    Location
    Iowa, USA
    Posts
    216


    Did you find this post helpful? Yes | No

    Default

    You might want to post the schematic, or code. Are you using fly back diodes for your inductive loads?
    Wisdom is knowing what path to take next... Integrity is taking it.
    Ryan Miller

  3. #3
    Join Date
    Jun 2005
    Posts
    53


    Did you find this post helpful? Yes | No

    Default

    Darryl,

    I have used a number of different pics but the 16F819 is the 1st that I experienced powerup issues. Disabling the power-up timer eliminated my problem. I am controlling 5 relays and pwm a 40 amp motor, close to 100 amps total. I recently passed a battery of emc noise testing with the 16F819.
    The power-up timer was frustrating, sometimes it powered up and worked fine, sometimes not. I am not using the master clear reset or low voltage programming in my design.
    PCB layout, flyback diodes (across the relay coil), code design are important.
    Good luck!

    Mark

  4. #4
    Join Date
    Jun 2005
    Posts
    37


    Did you find this post helpful? Yes | No

    Default Transient Suppression

    I would pay close attention to the transients generated by the relay coils when switching. I like to use hexfets because of their high gate isolation from the drain and source. You have to add a reverse biased flyback diode like a 1N4001 accross the relay coil and provide further isolation from your port pin to the fet's gate with a resistor, perhaps 4.7K. If you have pic port wires in close proximity to the relay source/sink wires, you can get induced noise in the pic causing havoc as well.

  5. #5
    Join Date
    Dec 2005
    Location
    Hull, UK
    Posts
    2


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Thanks for all the replies,

    Yes I have flyback diodes on each relay, I also have diodes from the pic's port output to the resistor on each transistor.

    My confusion is to why it works perfectly when seperately powered but not when its powered off its own transformer, Iam using the same regulator circuit etc.

    It is driving me mad.

    Yes I did have power up issues with the design initially also, I found adjusting the settings for the start up timer etc in the config sorted that out.

    I had similar problems with the 18F452 with random resetting so I had knowledge of this trickiness.

    I also had a batch of F819's that would only program once, cost me about 10 chips in the end.

    Thanks anyway

    Darryl

  6. #6
    Join Date
    Jun 2005
    Posts
    37


    Did you find this post helpful? Yes | No

    Default Power Up Problems

    It still sounds like your getting a power glitch that is affectig the pic. You could also try a larger capacitor parallel to 0.1uF accross the pic and turning off the brownout detect.

Similar Threads

  1. PIC16F819 LED not blinking
    By ronbowalker in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 1st December 2009, 02:04
  2. Programming Problem with PIC16F819
    By Dick Ivers in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 24th July 2007, 18:42
  3. PIC16F819 serial coms
    By c6jones720 in forum Serial
    Replies: 2
    Last Post: - 13th June 2007, 19:46
  4. Timers using Pic16F819
    By bearpawz in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th October 2004, 15:20
  5. DS1631 with PIC16F819
    By v_merino in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2004, 02:16

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