generating interrupt

Thread Starter

midoman

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


any input on prt1__>generate interrupt
 

Papabravo

Joined Feb 24, 2006
12,767
how can i get interrupt (active low for 8051 ) when there is any input on port 1 p1


any input on prt1__>generate interrupt
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.
 

Papabravo

Joined Feb 24, 2006
12,767
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.
 
Top