Multiple HW Interrupts


Closed Thread
Results 1 to 4 of 4
  1. #1
    Radiance's Avatar
    Radiance Guest

    Default Multiple HW Interrupts

    I've just begun a project using the 18F2320, that requires two hardware interrupts. Is the best(fastest?) way to determine WHICH interrupt was fired to loop through the INTCONx register, checking the INT2IF and INT1IF bits?

    Thanks,

    Nik

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Pretty much. Check for the Interrupt with the highest priority first.

    What you can also do is alias the flags in PBP to a name of your choice, and then just check the alias in your program...

    PressureHigh var INTCON3.0
    PressureLow var INTCON3.1

    .. ..

    If PressureLow=1 then Panic
    If PressureHigh=1 then ReallyPanic

    Melanie

  3. #3
    Radiance's Avatar
    Radiance Guest


    Did you find this post helpful? Yes | No

    Default

    Yes, that's exactly what I had intended. Funny thing about PBP, I usually just make the assumption that a register for a specific chip exists. Is this the case? Can I assume that if a chip is considered "supported" by a version of PBP that all registers and special features can be aliased according to registername.pin#?

    Nik

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Well yes... I make that assumption and it works for me. Check the respective INC file for your chip to see that the register you need is listed - they generally are - or at least I've not found an instance yet of something missing.

    If it doesn't work, then the compiler will soon complain if it doesn't like something.

    Melanie

Similar Threads

  1. Problem with multiple interrupts
    By aratti in forum General
    Replies: 7
    Last Post: - 2nd June 2009, 08:18
  2. General Question About Multiple Interrupts
    By grzeh666 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 31st August 2008, 17:09
  3. help: TMR0 interrupts disabling PORTAchange interrupts???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th August 2008, 15:10
  4. Handeling multiple Interrupts
    By BobSpencerr in forum General
    Replies: 15
    Last Post: - 1st March 2007, 01:12
  5. Turning on & off multiple interrupts
    By elec_mech in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 30th June 2005, 17:50

Members who have read this thread : 1

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