18f242 reset


Closed Thread
Results 1 to 8 of 8

Thread: 18f242 reset

  1. #1
    Join Date
    Sep 2005
    Posts
    28

    Default 18f242 reset

    I am using an 18F2424 to drive a transistor and relay for a 12V LED lamp output.
    When simply flashing the circuit on and off with a pause 700 statement the pic often resets to the start up point. Are there any general causes for the 18f2424 to reset?

  2. #2
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hello Armadus,

    Without seeing your work we can only take guesses. Do you have a .1uF cap across the Gnd and Vdd of the PIC? Do you have a good clean 5vdc power source? What does your program have at the end? (Goto Start?) Do you have the WDT enabled?

    I could go on like this for a while.

    HTH,

    BobK

  3. #3
    Join Date
    Sep 2005
    Posts
    28


    Did you find this post helpful? Yes | No

    Default 18f242 reset

    Bob,

    Thanks for the reply. I do have a cap across +5 and Gnd. The program is simply

    High PortC.1
    YR:
    Low PortC.1
    High PortC.2
    Pause 700
    Low PortC.2
    Pause 700
    goto YR

    I do have the WDT enabled

    It will generally run for about 5 minutes, but sometimes only a few cycles, and resets to High PortC.1.

    I am using a 7805 regulator, well filtered.
    I have been working on the theroy that the power supply is dropping out, but it always appears to be at full power.

    Thanks

  4. #4
    Join Date
    Apr 2007
    Posts
    53


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Armadus View Post
    Bob,

    Thanks for the reply. I do have a cap across +5 and Gnd. The program is simply

    High PortC.1
    YR:
    Low PortC.1
    High PortC.2
    Pause 700
    Low PortC.2
    Pause 700
    goto YR

    I do have the WDT enabled

    It will generally run for about 5 minutes, but sometimes only a few cycles, and resets to High PortC.1.

    I am using a 7805 regulator, well filtered.
    I have been working on the theroy that the power supply is dropping out, but it always appears to be at full power.

    Thanks

    Do you have a diode across the relay coil to suppress the back emf? If not, the "spike" when the relay is switched off could be causing the pic to reset.

    Andy

  5. #5
    Join Date
    Sep 2005
    Posts
    28


    Did you find this post helpful? Yes | No

    Default 18f242 reset

    Andy,

    There is a diode accross the relay.

    Thanks

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Try replacing the transistor with a LED and a 470 ohm resistor to make sure it is not something to do with the transistor or relay.

    Is the cap across power rails large enough for BOR fuse. Rule of thumb, LED with resistor across power rails should go dim not instant off when power is cut.

    What have you done with MCLR?
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Sep 2005
    Posts
    28


    Did you find this post helpful? Yes | No

    Default 18f242 reset

    Dave,

    1. I have replaced the transistor and relay, but made no difference. I will try the resistor and LED you suggested.

    2. I have a 330uF cap between the output of the regulator and Gnd.

    3. MCLR pin is connected to +5 via a 4.7K series resistor, and a 0.1uF cap to gnd.

    Thanks

  8. #8
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    One more thing if the other does not get it. Tie all un-used pins to ground with a 10k or so. If there is "noise" could have something to do with it. Good to do this on finished projects.
    Dave
    Always wear safety glasses while programming.

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. Software Driven Reset Routine
    By Tissy in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th April 2005, 00:53
  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