TMR0 stops working


Closed Thread
Results 1 to 26 of 26

Hybrid View

  1. #1
    Join Date
    Jun 2006
    Location
    Bangalore, India
    Posts
    136

    Angry TMR0 stops working

    I have made a Digital led clock using the following hardware :-
    PIC16F84A (used it as i have many lying around)...
    4X 9 volt led displays

    The time keeping is managed by TMR0 and Instant Interrupts.
    The problem is that the TMR0 suddenly (and randomly) stops incrementing while the chip is on. This may happen in a few hours or in a few days or even after a month.
    The oscillator still clocks at 4 Mhz , the chip still keeps the display running (multiplexing), the time set buttons still work.

    I have been trying to fix this problem from the past 1 and a half year, but nothing seems to work.
    I tried using a 16F628A, still no luck.
    Now i really need some help.
    I have attached the complete source code and schematic.
    Can someone please help me ? ? ?

    PSU.JPG = power supply with battery backup
    clock.gif = base circuit
    12Volt Driver.bmp = modification for large led displays
    clock.pbp.txt = main source code
    DT_INTS-14.pbp.txt = Instant Interrupts subsystem
    Attached Images Attached Images    
    Attached Files Attached Files

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


    Did you find this post helpful? Yes | No

    Default

    Hard to say for sure, but with it working for months at a time, I wouldn't suspect anything in the software.

    A couple things I can see that might cause problems ...

    You are charging the 3V batteries from a 12v source with only a diode and resistor in series.
    That's going to overcharge the batteries severely, and I'm surprised they haven't blown up yet. Then when the voltage gets too high, it'll pass right through to VCC raising the voltage above the F84A's limit.

    Then if main power is lost, the F84A will be powered by only 3.6V, which is below the 4v minimum for an F84A.

    The F84A doesn't have a Brown-out detector, so it won't reset or anything when the voltage is too low.

    Voltages outside the normal operating range can cause just about anything to happen (randomly).<hr>
    Lowering the resistor value to MCLR, with a small capacitor to ground may help reduce spurious resets, if that's where it's coming from.

    Also, this isn't part of the TMR0 problem, but you shouldn't have a switch on the same pins used for an output. It's a dead short to VCC when the switch is pressed. Maybe with some resistors in series to limit the current, but straight to VCC like that, not a good idea.

    <br>
    DT

  3. #3
    Join Date
    Jun 2006
    Location
    Bangalore, India
    Posts
    136


    Did you find this post helpful? Yes | No

    Default

    Thanks for that Darrel . . .
    I've added a .1uf from MCLR to ground, 1k from buttons to VCC. Datasheet states minimum operating voltage is 2 volts. (http://ww1.microchip.com/downloads/e...doc/35007b.pdf)
    Sometime back i have also run the clock from a 12 volt lead acid battery (with 7805).
    After 3 days, the clock stopped incrementing time, though the display was being multiplexed and the input buttons responded fine.
    16F628A also shows the same behavior.
    I tried writing a piece of code that resets all TMR0 registers and variables when the time set button is pressed, but no matter what ,TMR0 doesn't seem to come to life until a powerdown reset is done.
    Last edited by shahidali55; - 25th January 2008 at 07:38.

  4. #4
    Join Date
    Jun 2006
    Location
    Bangalore, India
    Posts
    136


    Did you find this post helpful? Yes | No

    Default

    I think i have found the fault...
    Sometimes when i turn on the tubelight in my room, the clock resets or hangs or stops incrementing time,even tough i'm power it from a battery.
    Does this mean that i have to provide RF shielding to the PCB ? ? ?

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


    Did you find this post helpful? Yes | No

    Default

    I have a similar problem with my breadboards, ... when I turn on the fluorescent light on my desk.

    I pretty much ignore it (mostly because I can't fix it).

    It doesn't seem to be related to proximity, but seems to be related to it being plugged into the same "Power Strip" as the project.

    If I plug the project into the wall, and the light into the power strip, it doesn't happen.

    Surely there's an explanation .. (that will surface real soon).
    <br>
    DT

  6. #6
    Join Date
    Jun 2006
    Location
    Bangalore, India
    Posts
    136


    Did you find this post helpful? Yes | No

    Default

    It happens even if i run the clock from a battery.
    It sometimes locks up when i plug in the cellphone charger adapter.
    Will decoupling capacitors or line filters help?

Similar Threads

  1. COUNT is not counting again
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 33
    Last Post: - 19th June 2009, 04:52
  2. TMR0 interrupt and HSERIN
    By boban in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd September 2008, 11:48
  3. help: TMR0 interrupts disabling PORTAchange interrupts???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th August 2008, 15:10
  4. using TMR0 as a counter..
    By sirvo in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 28th July 2007, 02:56
  5. Strange behaviour from PIC16F877 on TMR0
    By mikebar in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 19th August 2006, 01:31

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