Interrupt Or I Am Going To Die


Closed Thread
Results 1 to 27 of 27

Hybrid View

  1. #1
    kunguz's Avatar
    kunguz Guest

    Angry Interrupt Or I Am Going To Die

    I have a problem with PORTB:4-7 interrupts ,I can actually get pic in to interrupt but can't get it out from interrupt to last process, here is my code below ; You can find schematics and ISIS simulation file which is processed in 6.9 in attachments.

    PLEASE SOMEBODY HELP ,I AM BEGINING TO LOSE MY MIND!
    device 16f84a
    ON_INTERRUPT goto flash
    intcon = %10001000
    input portb.6 ' Bu pinleri sıfırladıktan sonra alıcı olarak ayarlamalısın

    loop:
    high porta
    delayms 200
    low porta
    delayms 200
    goto loop

    disable

    flash:
    delayms 20
    low porta
    intcon.0 = 0
    resume
    enable

    end
    Attached Images Attached Images  
    Attached Files Attached Files

  2. #2
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default

    You need to read PORTB in your ISR to clear the mismatch. Otherwise, like you have mentioned, you will never be able to get out of you ISR.

    HTH,
    Steve

  3. #3
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Also,

    Instead of High PORTA use PORTA=255
    and
    Instead of LOW PORTA use PORTA=0



    Note:
    "...Bu pinleri sıfırladıktan sonra alıcı olarak ayarlamalısın"

    anteni iyi ayarla!

    ---------------------------------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  4. #4
    kunguz's Avatar
    kunguz Guest


    Did you find this post helpful? Yes | No

    Question How to read portb

    Thanks for replies, what I wonder is I don't know how to read portb; Can you just write down a sample code _?

    Thanks in advance,

    Saolasın Hocam :P

  5. #5
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Like what?

    Example:

    IF PORTB.6 = 0 then .....

    or another one

    WHILE PORTB.3 = 0
    ..
    ....
    WEND

    or

    IF PORTB.2 = 1 AND PORTB.5 = 0 THEN .....

    Etc..


    These are some kind of readinds.
    Make sure you make them input pin.


    ----------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  6. #6
    kunguz's Avatar
    kunguz Guest


    Did you find this post helpful? Yes | No

    Question Really can't understand

    So sorry but can you correct my code , I tried everything as in your sample code for PORTB.6 ; But can't get it out.

    By the way my msn is [email protected]. (Olmadı bana burdan yardımcı olursan çok sevinirim, altı üstü bi interruptan çıkamadık)

    Here is my new code below ;
    device 16f84a
    ON_INTERRUPT goto flash
    intcon = %10001000
    input portb.6 ' Bu pinleri sıfırladıktan sonra alıcı olarak ayarlamalısın

    loop:
    high porta
    delayms 200
    low porta
    delayms 200
    goto loop

    disable

    flash:
    WHILE PORTb.6 = 1: WEND
    intcon.0 = 0
    delayms 20
    low porta
    CONTEXT RESTORE

    end

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. Help with Analog Interrupt
    By brid0030 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th February 2008, 18:14
  4. NEWBIE: Some basic questions using interrupts
    By JackPollack in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 8th March 2006, 02:59
  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