help: TMR0 interrupts disabling PORTAchange interrupts???


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    xnihilo's Avatar
    xnihilo Guest


    Did you find this post helpful? Yes | No

    Smile Problem is solved

    Reseting the TMR0 ovf flag and the TMR0 preload value before leaving handler and checking what int flag are set upon entering the int handler did the trick.
    More funny, the int period is now all right (about 10ms)... What is strange is that I did not change a lot of things besides setting the preload for TMR0 before leaving the int handler...

    Skimask: yes, the code comments were a bit wrong I agree.
    RESUME, ENABLE. I changed the comments in my program
    As you may have noticed I'm not very strict when I write my code and my comments. I should be more cautious because other people may/will read and use the code...
    My brother always tells me that my code is a mess... He's right

    This forum is such a great place.
    I have to reference it in my code so people reading it will know that if I could finish my projects it is because many people on this forum guided me and even sometimes gave me the answers.

    Cool forum!

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by xnihilo View Post
    Reseting the TMR0 ovf flag and the TMR0 preload value before leaving handler and checking what int flag are set upon entering the int handler did the trick.
    More funny, the int period is now all right (about 10ms)... What is strange is that I did not change a lot of things besides setting the preload for TMR0 before leaving the int handler...

    Skimask: yes, the code comments were a bit wrong I agree.
    RESUME, ENABLE. I changed the comments in my program
    As you may have noticed I'm not very strict when I write my code and my comments. I should be more cautious because other people may/will read and use the code...
    My brother always tells me that my code is a mess... He's right

    This forum is such a great place.
    I have to reference it in my code so people reading it will know that if I could finish my projects it is because many people on this forum guided me and even sometimes gave me the answers.

    Cool forum!
    More Importantly, You will come back to your code, long after you have forgotten the details
    and will have to wade through it and try to remember . . . whereas, properly commented code will be easy, sensible, and readable. Spend a little time now or a lot later.
    Happy you got it working! Zot! Tag, you're it!
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by xnihilo View Post
    Reseting the TMR0 ovf flag and the TMR0 preload value before leaving handler and checking what int flag are set upon entering the int handler did the trick.
    More funny, the int period is now all right (about 10ms)... What is strange is that I did not change a lot of things besides setting the preload for TMR0 before leaving the int handler...
    I guess my main point about ENABLE was that if you ENABLE'd while still processing the interrupt, it'll 'interrupt' right there and you could get stuck in that same loop until you just happen to get lucky and can get out.

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. 18F2420, instant interrupts, and TMR0
    By dhickman in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 11th March 2009, 18:33
  3. 18F2620 tmr0 and interrupts
    By astouffer in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 8th March 2009, 00:56
  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