ON INTERRUPT questions


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default It runs !!!

    I did just a little try ...16F84A, button on PortB.0, Led on PortB.7

    see :

    'Test Blink

    ON INTERRUPT GOTO Period
    DISABLE INTERRUPT


    DEFINE LCD_Ebit 1

    I var Bit
    Periode var Word

    Led var Portb.7
    Led = 0
    Periode = 64


    loop:

    INTCON.4 = 1

    For I = 1 to 1000
    Pauseus Periode
    Next I

    Toggle led

    Goto loop


    Period:

    INTCON = $80

    Periode = ( Periode /2 )

    IF NOT Periode THEN
    Periode = 64
    ENDIF


    GOTO loop




    END


    the HEX, now, in the Program Window

    Change line 5 ( RETURN ) to ( GOTO 0x54 ) ....

    ENJOY !!!

    That's all !!!
    Last edited by Acetronics2; - 16th December 2005 at 14:19.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  2. #2
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    Thanks! I'll try it.
    Charles Linquist

  3. #3
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    I'm using Microcode Studio, so I'm not familiar with Microchip's IDE.

    I'm trying to figure out how you changed the return address of the interrupt routine to the address of my label ''CharInput'.

    A couple of questions then:

    Within the ASM file, how do I find out what address the various labels are located? My character input routine is call 'CharInput'. That is where I want the program to jump when it gets an interrupt from the serial port.

    In the following, I see no RETFIE or RETURN where I could substitute the address of CharInput. Where do I find that?




    Here is a portion of my ASM file.

    ; C:\PIC\BASIC\BAE5_INT.BAS 00175 ON INTERRUPT GOTO CharInput
    ONINT?LL _CharInput, L00001

    ; C:\PIC\BASIC\BAE5_INT.BAS 00176 DISABLE INTERRUPT
    IDISABLE?
    Charles Linquist

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink One step further ...

    Hi Charles

    Try this :

    'Test Blink


    DEFINE INTHAND _Period

    I var Word
    Periode var Word

    Led var Portb.7
    Led = 0
    Periode = 64


    loop:

    INTCON = %10010000

    For I = 1 to 1000
    Pauseus Periode
    Next I

    Toggle led


    Goto loop


    Period:

    INTCON = $80

    Periode = ( Periode /2 )

    IF NOT Periode THEN
    Periode = 64
    ENDIF


    GOTO loop


    END


    !!! IMPORTANT NOTE !!! : DO NOT FORGET the underscore before Period , in the inthand DEFINE !!!

    No mod to add to the Hex, this time !!!

    No Retfie or Return to care with ... just give the jump label you want to go aft the interrupt stubb.

    ENJOY

    Alain

    PS : Doesn't hurt MCS nor ....
    Last edited by Acetronics2; - 19th December 2005 at 17:53.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  5. #5
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    Thank you, Thank you, Thank you!

    I have modified my code to deal with a serial port interrupt, and (so far at least) it is working perfectly.
    Charles Linquist

Similar Threads

  1. Won't go back to SLEEP after 1st Interrupt
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 29th June 2009, 09:00
  2. Can't ID interrupt source with this IntHandler??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd June 2009, 02:35
  3. Interrupt questions
    By ruijc in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 19th August 2008, 22:18
  4. Help with Analog Interrupt
    By brid0030 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th February 2008, 18:14
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 01:07

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