Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/25/09 09:32
Read: times


 
#163830 - EA in "Interrupt service routine"
Hi,

We are using 8052 microcontroller in my project and having compiled code around 100K. I am using Keil microvision 3 compiler and using code banking with 2 code banks. Crysta used = 11.0592 Mhz.

I am using Timer 0 Interrupt service routine in Mode 1 running with 20 milliseconds ticks. The routine is:

	void onTimerISR(void) interrupt 1 using 1
	{
		unsigned char i;

		EA = 0;		//DISABLING ALL INTERRUPTS

		TR0 = 0;	//TIMER 0 RUN BIT = 0
		TH0 = 0xB8;	//MANUAL RELOAD VALUES IN
		TL0 = 0x00;	//TL0,TH0 OF TIMER 0 FOR COUNTING 20 MILLISECONDS AGAIN
		TR0 = 1;	//START TIMER 0 RUN BIT

		--		// 
		--		// REMAINING CODE IN TISR ROUTINE...
		--		//

		ET0 = 1;	//TIMER 0 INTERRUPT ENABLING

		EA = 1;		//ENABLE ALL INTERRUPTS
	}

 

Q: Should we disable and enable Interrupts with EA = 0/1 after control enters the routine?


---
I am also using Timer 1 as a baud rate generator for transmitting data bytes at 2400 baud to computer. The serial Interrupt service routine is as follows:
	unsigned char volatile serialVal;

	void onSerialPortISR(void) interrupt 4 using 3
	{
		EA = 0;		//DISABLING ALL INTERRUPTS
		
		if(TI)//CHECKING WHETHER INTERRUPT OCCUTED DUE TO TI
		{
			TI = 0;		  //CLEARING THIS BIT MANUALLY
			SBUF = serialVal; //SENDING DATA ASSIGNED INTO THIS VARIABLE
					  //TO SBUF
		}

		EA = 1;		//ENABLE ALL INTERRUPTS
	}

 


Q: Should we disable and enable Interrupts with EA = 0/1 after control enters the routine?

thanks in advance.


List of 9 messages in thread
TopicAuthorDate
EA in "Interrupt service routine"            01/01/70 00:00      
   yes,no            01/01/70 00:00      
      both are wrong            01/01/70 00:00      
         ... including this one?            01/01/70 00:00      
            well, I'll be            01/01/70 00:00      
         thanks >> it's working >> further            01/01/70 00:00      
            but WHY are you doing that?            01/01/70 00:00      
               Now i am not doing EA=0 in ISR.            01/01/70 00:00      
                  ah, then it's OK            01/01/70 00:00      

Back to Subject List