interrupt register


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Aug 2009
    Location
    Paso Robles California
    Posts
    167

    Default interrupt register

    I have a serial process that needs to finish its cycle before moving on. I will be using a pushbutton to advance to the next step, my plan was to use portb.0 interrupt pin for this by setting the interrupt bit ( intsomething ) and then polling this bit when the serial data has completed. Is this a logical approach.

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: interrupt register

    Hi,
    Sure, that'll work. The interrupt request bit will get set even if the interrupt is masked (so it won't actually trip an interrupt) so you can poll the flag. Don't forget to reset it or you will most likely lock up.

    /Henrik.

  3. #3
    Join Date
    Aug 2009
    Location
    Paso Robles California
    Posts
    167


    Did you find this post helpful? Yes | No

    Default Re: interrupt register

    Henrik thanks so the interrupt will not jump to the set line number if I just turn on portb.0 interrupt thats good and then polling the interrupt flag bit will work like a latch for me thats good.

    Ok will try and by the way Im just getting back into PBP so lock up is my middle name

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


    Did you find this post helpful? Yes | No

    Default Re: interrupt register

    Hi,
    No, the whole idea is to NOT turn the interrupt on, in other words don't enable it. If you enable it (and the GIE bit is set) it WILL cause interrupt - which you don't want.
    It doesn't matter if the interrupt is enabled or disabled, the interrups request flag will get set no matter what. It's just that it won't cause an actual interrupt when it's not enabled. Depending on which PIC it is you may want to set if you want the flag to be set on the rising or falling edge, which PIC is it?

    And you're right, it'll work as a nice latch.

    /Henrik.

  5. #5
    Join Date
    Aug 2009
    Location
    Paso Robles California
    Posts
    167


    Did you find this post helpful? Yes | No

    Default Re: interrupt register

    16f648a if that's the case will any port b pin set the register bit

  6. #6
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: interrupt register

    No, PortB.0 is the INT0 pin, it will set INTF-bit (INTCON.1)
    PortB.4-7 has interrupt on change, a mismatch condition will set the RBIF-bit (INTCON.0)
    PortB.1-3 does not have any interrupt capabillity on the 16F648.

    /Henrik.

Similar Threads

  1. pic+shift register+lcd
    By eworld in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 3rd October 2012, 05:11
  2. Register Settings
    By Archangel in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 26th September 2007, 00:28
  3. Tris Register use.
    By tsanders in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 25th October 2006, 15:12
  4. setting register
    By volcane in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 19th April 2006, 22:46
  5. How do I to set one bit in a register?
    By jessey in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th February 2006, 08:43

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