trouble with my 16f84a


Closed Thread
Results 1 to 27 of 27

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    The data sheet says it best. If not, let us know.
    6.10 Watchdog Timer (WDT)
    The Watchdog Timer is a free running On-Chip RC
    Oscillator which does not require any external
    components. This RC oscillator is separate from the
    RC oscillator of the OSC1/CLKIN pin. That means that
    the WDT will run even if the clock on the OSC1/CLKIN
    and OSC2/CLKOUT pins of the device has been
    stopped, for example, by execution of a SLEEP
    instruction. During normal operation, a WDT time-out
    generates a device RESET. If the device is in SLEEP
    mode, a WDT wake-up causes the device to wake-up
    and continue with normal operation. The WDT can be
    permanently disabled by programming configuration bit
    WDTE as a '0' (Section 6.1).
    6.10.1 WDT PERIOD
    The WDT has a nominal time-out period of 18 ms, (with
    no prescaler). The time-out periods vary with
    temperature, VDD and process variations from part to
    part (see DC specs). If longer time-out periods are
    desired, a prescaler with a division ratio of up to 1:128
    can be assigned to the WDT under software control by
    writing to the OPTION_REG register. Thus, time-out
    periods up to 2.3 seconds can be realized.
    The CLRWDT and SLEEP instructions clear the WDT
    and the postscaler (if assigned to the WDT) and prevent
    it from timing out and generating a device
    RESETcondition.
    The TO bit in the STATUS register will be cleared upon
    a WDT time-out.
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Nov 2008
    Location
    Columbus, OH, USA
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Well here's the strange thing.Shutting off the watchdog timer works quite well on one PIC.It functions as it is supposed to.However, I tried the exact same thing in the exact same circuit with the other pic, and it doesn't work. Same old problem. Also the book I've been referencing states to set the watchdog and power up timers on.
    Any thoughts?

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by cavity creep View Post
    Well here's the strange thing.Shutting off the watchdog timer works quite well on one PIC.It functions as it is supposed to.However, I tried the exact same thing in the exact same circuit with the other pic, and it doesn't work. Same old problem. Also the book I've been referencing states to set the watchdog and power up timers on.
    Any thoughts?
    Just guessing...as usual.

    Try reading the PIC and see if that hex matches the hex generated by the assembler. The config part might not be getting programed correctly.

    If they are not the same.

    Erase all but the chips ID if the EPIC has that setting. Then write to the chip program memory and config settings.
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Nov 2008
    Location
    Columbus, OH, USA
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Nope.They look the same.

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Exclamation

    Hi,

    Works fine, as written ...

    Hardware problem ( or config ) ... then !!!

    Alain
    ************************************************** ***********************
    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 " !!!
    *****************************************

  6. #6
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Have you tried the code example I posted above?
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  7. #7
    Join Date
    Nov 2008
    Location
    Columbus, OH, USA
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Hi,

    Works fine, as written ...

    Hardware problem ( or config ) ... then !!!

    Alain
    I'm going to have to agree with you I think.I suppose I have one good PIC and one bad, but I would think I would have difficulty reading from the ports of aa bad one, or at the very least the programmer would fail to recognize it.Maybe I'm asking for too much.

    Bruce, I haven't tried your code yet.I'm afraid your suggestion got buried in the conversation.I think I'll give it a try and post the results later if I have any success.

    Thanks for everyone for helping me figure this out.I'm sure I'll have many more questions as I go

  8. #8
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Lightbulb Idea

    Hi,

    I'd suggest you to try to place 4.7k and 22 pf as the external RC Clock components ... and give a try like that ...

    no risk !

    Will tell if CONFIG Word is transmitted by the programmer ...

    Just one step further.

    Alain
    ************************************************** ***********************
    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 " !!!
    *****************************************

Similar Threads

  1. Code works on 16F84A but not on 16F88?
    By pharaohamps in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th November 2009, 18:29
  2. MCLR causing trouble . .
    By shahidali55 in forum General
    Replies: 10
    Last Post: - 21st December 2007, 12:20
  3. ICSP using a 16F84a to program 24CXX
    By aftab in forum mel PIC BASIC
    Replies: 26
    Last Post: - 8th April 2007, 11:39
  4. 16F84A and Optrex LCD
    By coyotegd in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 17th October 2005, 16:08
  5. RS 485 using 16F84A
    By ngeronikolos in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th May 2005, 14:46

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