Interrupt Or I Am Going To Die


Closed Thread
Results 1 to 27 of 27

Hybrid View

  1. #1
    kunguz's Avatar
    kunguz Guest


    Did you find this post helpful? Yes | No

    Question For a simple click I get 2 change

    After using this new code below, I get value of sayi +2 each time I click.

    device 16f84a
    ON_INTERRUPT goto flash
    intcon = %10001000
    input portb.6 ' Bu pinleri sıfırladıktan sonra alıcı olarak ayarlamalısın
    dim sayi as byte
    sayi = 0

    loop:
    high porta
    delayms 200
    serout portb.3,16780,[Dec sayi ,13]
    goto loop

    disable

    flash:
    MOVF PORTB, W
    low porta
    intcon.0 = 0
    sayi = sayi + 1
    CONTEXT RESTORE

    end

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


    Did you find this post helpful? Yes | No

    Default

    Hi Kunguz,

    In your code, which you said works, how did you get "HIGH PORTA" or "LOW PORTA" work?


    ?


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

  3. #3
    kunguz's Avatar
    kunguz Guest


    Did you find this post helpful? Yes | No

    Thumbs up Just Works

    May be it's about my IDE ; I am using PROTON SE 1.1.2.8 ,And you can find the working circuit in the attachment with assembly and PICBASIC codes in it.
    Attached Files Attached Files

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Certainely not an IDE problem There's few things in the world want to stay away of. Proton is one of these
    Last edited by mister_e; - 30th October 2006 at 03:35.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Mar 2005
    Posts
    5


    Did you find this post helpful? Yes | No

    Default Interrupt Or I Am Going To Die

    DEFINE LOADER_USED 1
    INCLUDE "modedefs.bas"
    DEFINE HSER_BAUD 9600
    DEFINE HSER_SPBRG 25 'Gebruik deze twee defines 25
    dEFINE HSER_TXSTA 24h 'voor HSER met 9600 Baud
    OPTION_REG = $7f ' Enable PORTB pullups
    ADCON1 = 7 ' Make PORTA and PORTE digital
    on interrupt goto myint
    INTCON = $88
    pause 50
    TRISB = %11110000
    led var portb.0

    start:
    pause 5
    goto start
    '***Start interruptroutine***
    disable
    myint:

    high led
    pause 500
    low led
    INTCON.0=0 'Clear interruptflag
    resume
    enable
    end

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


    Did you find this post helpful? Yes | No

    Default

    Hi paulvits,

    As you can see Kunguz is all fine. He did not die.

    What is your question?


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

  7. #7
    kunguz's Avatar
    kunguz Guest


    Did you find this post helpful? Yes | No

    Lightbulb Hope this is a solution

    Hi Paulvits ; first of all never use pause or a delay in interrupt ; I don't know why but it makes the chip return from an interrupt with a long time. Really really long. And before intcon.0 = 0 use this line; "MOVF PORTB, W" And let the magic happen .Remove PORTB and write down your interrupt port that's all ,Thanks steven and others I learned this with their helps

  8. #8


    Did you find this post helpful? Yes | No

    Wink

    Quote Originally Posted by mister_e
    Certainely not an IDE problem There's few things in the world want to stay away of. Proton is one of these
    They said the same thing about planes in the early days of flight. Sometimes progress takes a while to catch on.

    ---> picnaut

  9. #9
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Talking

    Hey Picnaut

    Why i had this feeling you couldn't resist to add your spices?

    Are you saying we can fly? Really? Wohooo i missed it?

    Is that also true that a man walked on the moon?

    Sometimes progress takes a while to catch on.
    I'm to old to wait 'till it's going to be at least good... if the day come.

    There's a far better tool (not toy) comming up soon. Too bad only for 18Fs... 'till now. Even in pre-release it's already 1E10,000 : 1 better than this Programmer Disaster Software.

    Happy for you that you finnaly get your multi I2CBUS. 2 year later but you have it now. That's true, progress takes a while to catch on.
    Last edited by mister_e; - 1st November 2006 at 05:08.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  10. #10


    Did you find this post helpful? Yes | No

    Unhappy Swordfish?

    Hi Mister E,

    Are you talking about Swordfish?
    If so, it does look cool.

    Unfortunately, I've begun to realize that, as a rule, virtually no one in industry takes Basic languages seriously - procedural or not.
    So, unless you are purely a hobbyist or are planning on working 100% for yourself (and never for "the man"), a serious embedded engineer needs to learn C. It's sad, but true. Employers look for C (primarily) and assembly (is a plus).
    It's frustrating but it's a reality, at least in North America.
    I defy anyone to find one company in the States or Canada that's looking for basic programmers! I'll bet that there aren't any.



    Anyway, I don't mean to rant, but I've been frustrated by this lately.
    So, I've bought some C books and dug my old notes out.
    Basic has served me well (PBP and PDS) and has gotten me very comfortable with PICs, but it's on to the next level.

    Cheers!
    ---> picnaut

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