TMR0 stops working


Closed Thread
Results 1 to 26 of 26

Hybrid View

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


    Did you find this post helpful? Yes | No

    Question

    That is Strange! Wouldn't compile here the way it was before.

    I can't see anything in the program that would cause it to lock up.
    So I put together a breadboard to see what I could see.


    click image for larger version

    It's running on a 16F88 right now. Couldn't find my 628A.

    I'll see if it makes it past 7:14 first.
    Then set the time, and let it run.
    Hopefully I can find that 628A by then.

    I'll let you know if it locks up.

    DT

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


    Did you find this post helpful? Yes | No

    Question

    Thanks DT.
    That is one really neat breadboard.
    Did you notice the hourly on screen animation?


    Just after the two LOOKUP statements there is a tricky piece of code that used to blink the colon:-
    ;if bres_hi<8 then
    ; Segments.7=0
    ;else
    ;Segments.7=1
    ;endif

    It is there in the code posted in #1.
    The code in post #18 has this part commented. Hence no blinking colon.
    But after 4 days of testing with this code (#18) everything seems to be fine.
    Could the blinking colon code have caused the problem?
    To blink the colon, i used to check a critical time keeping variable (bres_hi) of the 24 bit counter. I think if bres_hi was being read when an interrupt occured and the ISR tried to update the register, it got corrupted. Can this happen?
    Last edited by shahidali55; - 19th June 2008 at 18:46.

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


    Did you find this post helpful? Yes | No

    Default

    It is pretty neat isn't it? I'm actually thinking about hanging it on the wall just like it is.

    It's still happily keeping time. No glitches so far.
    I can't image that the blinking colon would have made any difference, but I'll uncomment it just for diligence sake.

    Yup, I saw the animation. That's cute. Also saw the upside down digits that I can see in your previous pictures, were mounted that way. Accidental??
    I commented out the extra Lookup and IF statement.

    Still haven't found the 628A, but I don't think there's enough difference to matter.
    I suppose I should put a battery in there and run it at lower voltages too.
    <br>
    DT

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    I'm actually thinking about hanging it on the wall just like it is.
    <br>
    Not a bad idea. A clock does always comes in handy.
    The last 2 digits were put upside down so as to get a colon from combining the two dot points on the oppositely placed standard 7-segment displays. An extra lookup table was the overhead.
    If the clock is loosing or gaining time, you can adjust bres_lo reload value in the ISR.
    (+.25 sec/day = bres_lo - 8 , -.25sec/day = bres_lo + 8).

    Running it on a battery down to 2.1v will be the ultimate test.
    My chip seems to have no problem till 2.1v. Below that the oscillator stalls and below 0.9v the ram gets corrupted.
    Last edited by shahidali55; - 20th June 2008 at 10:15.

  5. #5
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: TMR0 stops working

    I try to make this clock, using 16F628A.
    But I can't compile ... Why ?! Thanks in advance !
    Attached Images Attached Images  

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


    Did you find this post helpful? Yes | No

    Default Re: TMR0 stops working

    You might want to consider posting the code that you can't compile VS a huge screen capture..;o)
    Regards,

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

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


    Did you find this post helpful? Yes | No

    Default Re: TMR0 stops working

    When using DT_INTS, you have to use MPASM for the assembler.

    Those errors are from PM.
    DT

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