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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/22/05 08:15
Read: times


 
Msg Score: -1
 -1 Non-Specific question
#102753 - problem in serial communication
i am in try to receive a byte from pc on microcontroller at89c51, but SBUF always have a value "0" whatever i send from pc. i am using following code. please let me know what is wrong with this code.
#include <at89x51.h>
unsigned char freqq;
void serial(void) ;
void main()
{
P0=0xff;
P2=0xff;
P3=0xff;
P1=0xff;
EA = 1;
ES=1;
TMOD |= 0x20;
TH1=0xf3;
TR1 = 1;
SCON = 0x52;
while(1)
{ ; }
}

void serial(void) interrupt 4
{

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


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