- This topic has 0 replies, 1 voice, and was last updated 9 years, 10 months ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
|
Microcontroller › 8051 › AT89c4051 Programming
Hi, Getting problem with programming AT89c4051 serial port.
Doubt about configuration.
void setup()
{
TMOD = 0x20;
SCON = 0x50;
TH1 = 0xFD;
TR1 = 1;
IE = 0x90;
}
if(send == 0)
{
while(send == 0);
SBUF = tx_val1;
while(TI==0);
TI=0;
SBUF = tx_val2;
while(TI==0);
TI=0;
}
void serial() interrupt SIO_VECTOR
{
unsigned int val1,val2;
if(RI)
{
while(RI == 0);
val1 = SBUF;
rx_val1 =val1;
RI = 0;
while(RI == 0);
val2 = SBUF;
rx_val2 = val2;
RI = 0;
}
else
{
TI = 0;
}