INT0 Zero Interrupts


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2009
    Posts
    26

    Default INT0 Zero Interrupts

    Hi All,
    I have been banging my head on the wall for weeks. I am not sure what I am missing and I have read over the datasheet many times. Please take a sec to see if you notice anything wrong.

    I can't get INT0 to interrupt. The TMR0 interrupt is working great, the led flashes 100ms as desired. If I take pin RA0 and jump to 5V or Ground the interrupt doesnt seem to interrupt. The program should turn on an led if it interrupts.

    MCU: PIC18F1330

    Thanks Again,
    Nemesis
    Attached Files Attached Files
    Last edited by nemesis; - 26th March 2009 at 23:44.

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


    Did you find this post helpful? Yes | No

    Question

    I gotta ask . . . Why do you put the percent sign before the value of your variables? It seems to me you are telling the Variables, ports and registers to read binary, and I suppose as long as you only use zero and one it will work, but it's confusing as all get out. Why not just use 0 and 1 ?
    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
    Join Date
    Feb 2009
    Posts
    26


    Did you find this post helpful? Yes | No

    Default

    Percent madness... I try to make my variable names start with bt for bit, w for word, l for long. The percents really just remind me they are bits. I totally could ditch them. lol maybe I should.

    Thanks for looking at the file. I can't figure out what I am missing, really hoping someone finds something.

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


    Did you find this post helpful? Yes | No

    Default

    The chart sec 9.1 shows INT0 port latch as 1 not zero when INT0 enabled. Other than that I see nothing, but I am really sleepy right now Doggone PBP interrupts, it doesn't take much for them not to work . . . You might try commenting out the parts that do work until you hit the right formula . . .
    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.

  5. #5
    Join Date
    Feb 2009
    Posts
    26


    Did you find this post helpful? Yes | No

    Default

    Anybody pick up anything else? I feel really frustrated with this interrupt. I think I will try pulling out everything but that interrupt as Joe suggested. Just hoping that maybe the order or bit is wrong in one of the registers.

  6. #6
    Join Date
    Feb 2009
    Posts
    26


    Did you find this post helpful? Yes | No

    Default

    Thanks for your replies Joe S.

    I figured out the problem. My ADCON1 should have been:

    ADCON1 = %00011111 ' Set all to digital

    Thanks Again,
    Nemesis

  7. #7
    Join Date
    Dec 2007
    Location
    Finland
    Posts
    191


    Did you find this post helpful? Yes | No

    Post

    After INT0 interrupt you are not clearing INT0IF variable. I don't know does it make difference or not, but add
    Code:
    INT0IF = 0
    before last ENDIF in INT0 interrupt section.


    Also TMR0 comment is not valid. It should be ON
    Code:
    INTCON =  %10110000 ' Global, TMR0 off, INT0 ON
    BR,
    -Gusse-

  8. #8
    Join Date
    Feb 2009
    Posts
    26


    Did you find this post helpful? Yes | No

    Default

    Will do thanks Gussee. Sometimes I am victim of my own cut and paste. Thanks again all.

    -Nemesis

Similar Threads

  1. Instant Interrupts - Revisited
    By Darrel Taylor in forum Code Examples
    Replies: 772
    Last Post: - 17th February 2016, 22:14
  2. Clock using Instant Interrupts
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th February 2009, 21:43
  3. Microcode studio - PIC16F877A Interrupts
    By mcbeasleyjr in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th January 2009, 06:10
  4. DT's Instant Interrupts trouble
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th November 2008, 20:48
  5. help: TMR0 interrupts disabling PORTAchange interrupts???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th August 2008, 15:10

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