Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

External interrupt in 8051: help me out

Status
Not open for further replies.

Rohi231

Member level 2
Joined
Mar 21, 2012
Messages
53
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,673
Can anyone provide me reference for External interrupt for 8051. ?
 

HI Rohi
what u want to perform with the ext interrupt,
here the sample code is inserted for ur ref jus go through it
Code:
#include <REG52.H>

/*=============================================================================
=============================================================================*/
unsigned char ex0_isr_counter = 0;

void ex0_isr (void) interrupt 0
{
ex0_isr_counter++;   // Increment the count
}

/*=============================================================================
=============================================================================*/
void main (void)
{

/*-----------------------------------------------
Configure INT0 (external interrupt 0) to generate
an interrupt on the falling-edge of /INT0 (P3.2).
Enable the EX0 interrupt and then enable the
global interrupt flag.
-----------------------------------------------*/
IT0 = 1;   // Configure interrupt 0 for falling edge on /INT0 (P3.2)
EX0 = 1;   // Enable EX0 Interrupt
EA = 1;    // Enable Global Interrupt Flag

/*-----------------------------------------------
Wait forever.
-----------------------------------------------*/
while (1)
  {
  }
}
 
what do u want to know.. like any specific requirements or any instance. ??
 

Hi avinesh & dean winchester. Thanks a lot for the code. It worked fine for me. I am trying to do gprs application. I am able to send the data from gprs modem to server through p89v51rd2. now i wanted to send the data from server to gprs. Here Gprs is connected to microcontroller through P3^6 and P3^7. (WR: external data memory write strobe P3.7 RD: external data memory read strobe P3.6). ( unfortunately for a reason i cant connect gprs to serial uart directly in this project). So just i wanted to know can i write any interrupt for P3.6 and P3.7? Help me out:)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top