Int Interrupt question


Closed Thread
Results 1 to 13 of 13

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

    Here are some snippets from a 16F873A project.
    It triggers on PORTB.0 using ON INTERRUPT.
    Code:
    ON INTERRUPT GOTO MYINT
    INTCON = %10010000
    
    MAIN:
    'DO STUFF
    GOTO MAIN
    
    DISABLE
    MYINT:
    IF PORTB.0 = 1 THEN
        PC = PC + 1
    	WRITE 3,PC.BYTE0
    	WRITE 4,PC.BYTE1
        READ 3,PCNT.BYTE0
    	READ 4,PCNT.BYTE1
        pause 100
    ELSE
    	PC = PC
    ENDIF
       
    INTCON.1 = 0
    RESUME
    ENABLE
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Hi Ken,
    Spend an hour or more in ME Labs website, there are a Gaggle of sample programs and user submitted programs there. It is a very good resource, I promise. It may / not have the example you seek, it IS worth the time.
    http://melabs.com/resources/samples-pbp-general.htm
    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.

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