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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/24/05 04:09
Read: times


 
#102792 - Better practice!
Responding to: ???'s previous message
Ghulam Hussain said:

void serial(void) interrupt 4
{

if(RI)
{
RI=0;
P0=SBUF;
}
}


It is better to always write both the conditions inside the serial ISR, so that you are not missing anything (I mean any possibility)

eg.
void serial(void) interrupt 4
{

if(TI)
TI = 0;
if(RI)
{
RI=0;
P0=SBUF;
}
}

This practice would have saved you from failing.

Regards
Sarang





List of 6 messages in thread
TopicAuthorDate
problem in serial communication            01/01/70 00:00      
   Missing info            01/01/70 00:00      
   Missing TI = 0;            01/01/70 00:00      
      Why TI = 0???            01/01/70 00:00      
   Better practice!            01/01/70 00:00      
   nothing much except the SCON 0x52 which            01/01/70 00:00      

Back to Subject List