generating interrupt

Discussion in 'Embedded Systems and Microcontrollers' started by midoman, Apr 4, 2007.

  1. midoman

    Thread Starter New Member

    Mar 21, 2007
    3
    0
    how can i get interrupt (active low for 8051 ) when there is any input on port 1 p1


    any input on prt1__>generate interrupt
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
  3. Papabravo

    Expert

    Feb 24, 2006
    10,135
    1,786
    The 8051 does not have the interrupt on change mechanism of the PIC16F family. There is a slight possibility that input capture can be on one or more bits of port 1 if the 8051 variant you are using has the PCA(Programmable Counter Array) peripheral. How about giving us a manufacturer and a part number.
     
  4. midoman

    Thread Starter New Member

    Mar 21, 2007
    3
    0
    i use a AT89S52 controller and i want when there is any change in the data on port 1 ____> generate interrupt
     
  5. Papabravo

    Expert

    Feb 24, 2006
    10,135
    1,786
    As I tried to explain in my previous post, the AT89S52 does not have the interrupt on change mechanism that exists on some members of the PIC16F family. Having said that there is one pin, T2EX(P1.1), which has a transition detector and can be used to generate an interrupt. You will also capture the value of the free running Timer2 when the transition happens if Timer2 is running.

    You need to enable EXEN2 to get a timer2 interrupt on the transition. If you don't want to have to ignore T2 overflows then just turn TR2 off, by setting it to zero.
     
Loading...