1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

External Interrupt on GP2

Discussion in 'Microcontrollers' started by Suraj143, Oct 25, 2017.

  1. Suraj143

    Suraj143 Active Member

    Joined:
    Jan 11, 2007
    Messages:
    1,580
    Likes:
    2
    Location:
    South Mald Isld
    I'm receiving a continuous 5V square wave pulse 50Hz. I want to detect High to low transition (Falling edge) on GP2.

    My question is Do I need to enable internal WPU on GP2? I use PIC12F675.
     
  2. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,084
    Likes:
    326
    Location:
    Brisbane Australia
    ONLINE
    If you use the IOC (Interrupt on change) function on GP2 then if, when the interrupt triggers, the pin is low it must have just transitioned. You need the WPU if the signal is active low only.

    Mike.
     
  3. Suraj143

    Suraj143 Active Member

    Joined:
    Jan 11, 2007
    Messages:
    1,580
    Likes:
    2
    Location:
    South Mald Isld
    Hi,

    I need to use INTF external interrupt flag bit.I set INTEDG to falling edge.In this case do I need the internal WPU enable?
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,084
    Likes:
    326
    Location:
    Brisbane Australia
    ONLINE

    If your signal is driven high then WPU not needed. If open collector then WPU needed. Either way you can enable WPU as it can't do any harm.

    Mike.
     
  6. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,294
    Likes:
    647
    Location:
    Derbyshire, UK
    ONLINE
    You only need pull-ups if the source is open-collector, as long as it's a normal logic output then no pull-ups are needed.
     

Share This Page