Interrupt portb


Closed Thread
Results 1 to 9 of 9

Thread: Interrupt portb

  1. #1

    Default Interrupt portb

    Good Morning,
    While reading the manual about on_interrupt it says:INTCON = %10010000
    enables the interrupt for RB0/INT. Is this the only dedicated port for using interrupt or can it be changed to portb bit 1-7? I have read through the manual and I don't see any reference to changing the input.

    Thanks

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


    Did you find this post helpful? Yes | No

    Default

    You really DO need to download and look at the Datasheet for the PIC you're using.

    Look in the section near the end entitled SPECIAL FEATURES OF THE CPU, there you will find the section on INTERRUPTS. Different PICs have different arrangements - the Datasheet tells you what is and isn't available on that PIC.

    For example, on the 16F628, you get a PortB.0 interrupt, the only other interrupts available on PortB is a single combined interrupt for the four Ports B.4 through B.7. This arrangement is NOT GUARANTEED on every chip (since some don't have a PortB or only have a partial PortB).

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by tazntex View Post
    While reading the manual about on_interrupt it says:INTCON = %10010000 enables the interrupt for RB0/INT. Is this the only dedicated port for using interrupt or can it be changed to portb bit 1-7? I have read through the manual and I don't see any reference to changing the input.
    That is the only dedicated-single-input interrupt pin for that purpose.
    However, you can (if the PIC supports it) enable various PORTB pins for the interrupt-on-change function.

    EDIT: Timing! It's all in the timing! Mel wins...

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,516


    Did you find this post helpful? Yes | No

    Default

    Hi,
    Generally speaking the INT0 interrupt is on PortB.0 and the Interrupt on change feature is on PortB.4-7. With that being said the dataheet for your particular PIC has specific info on each interrupt and how it is controlled. Some have more than one external interrupt (INT1 etc) some don't, some can enable/disable the IOC feature on individual pins (within the predefined group), some can't etc etc.

    /Henrik.

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


    Did you find this post helpful? Yes | No

    Default

    If we are talking about 16F628A, then you can use two 628A in your project with RB7-RB4 int source.

    This way, you get 8 pins for interrupt.

    Connect two pics to each other and control one another.

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

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Use a stack of 10F200's, GP1/GP2/GP3 interrupt inputs, GP0 is a serial interrupt output, simulated 'open-drain' setup, feeding a master PIC on RxD. A bit like the stacked interrupt chain (8259? 8279? INT2?) on the old PC's...

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    10F200's don't have interrupts.
    <br>
    DT

  8. #8


    Did you find this post helpful? Yes | No

    Default

    Thanks everyone, I am using the 16F628A. I will go back to the datasheet and see if I can make out what it is talking about.

  9. #9
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    10F200's don't have interrupts.
    <br>
    I know...used the term interrupt in the wrong context...

    What I meant to get across was 'a very tight loop, polling the pins, waiting for an event on any of the input pins, and reacting to that input event with an output event on another pin.'

    The 10F2xx may not have interrupts, but they do have Wake-From-Sleep, which might be just as good. (just noticed, the 10F doesn't have a RETFIE instruction either!)

Similar Threads

  1. PICs can do more if use others than delays instructions
    By hardcore in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 24th February 2010, 20:52
  2. shifting problem
    By helmut in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 31st August 2007, 07:11
  3. Output PIC module
    By freelancebee in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th September 2005, 21:10
  4. Can anyone help a beginner in a struggle?
    By douglasjam in forum mel PIC BASIC
    Replies: 1
    Last Post: - 6th May 2005, 00:29
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 02:07

Members who have read this thread : 2

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