Thread: negative edge triggered

  1. #1
    Registered User
    Join Date
    Jun 2010
    Posts
    6

    negative edge triggered

    This function configures and enables /INT0 and /INT1 (External Interrupts)
    // as negative edge-triggered.

    Code:
    void Ext_Interrupt_Init (void)
    {
       TCON = 0x05;                        // /INT 0 and /INT 1 are edge triggered
    
       IT01CF = 0x32;                      // /INT0 active low; /INT0 on P0.2;
                                           // /INT1 active low; /INT1 on P0.3
    
       EX0 = 1;                            // Enable /INT0 interrupts
       EX1 = 1;                            // Enable /INT1 interrupts
    }
    what is meant by "as negative edge triggered" does it mean that wen the logic "0" it is triggered?

    thanks in advance =D

  2. #2
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    Negative edge triggered probably means that the interrupt is triggered when the signal that causes it transitions from high to low.
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

  3. #3
    Registered User
    Join Date
    Jun 2010
    Posts
    6
    Ok thanks alot i understand it now =D

  4. #4
    Registered User
    Join Date
    Jun 2010
    Posts
    45
    its also called a "falling edge" which makes a bit more sense considering its going from high to low

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 04-29-2010, 08:02 PM
  2. How can I make this code more elegant?
    By ejohns85 in forum C++ Programming
    Replies: 3
    Last Post: 04-02-2009, 08:55 AM
  3. error help making no sense
    By tunerfreak in forum C++ Programming
    Replies: 5
    Last Post: 04-17-2007, 07:55 PM
  4. Graphs
    By FlatLost in forum C++ Programming
    Replies: 11
    Last Post: 11-18-2003, 09:47 PM
  5. how to handle integer overflow in C
    By kate1234 in forum C Programming
    Replies: 8
    Last Post: 04-23-2003, 12:20 PM