P89V51RD2 Interfacing with the UART Serial Communication
Description
Interfacing the UART Serial Communication with the P89v51rd2 Micro controller, with the baud rate of 9600bps. The Source code and Simulator Model of this Communication is listed Below.
Source :
#include <reg51.h>
unsigned char var;
unsigned char var1;
void Serial_Init()
{
TMOD = 0x20;
SCON = 0x50;
TH1 = 0xFD;
TR1 = 1;
}
void Transmit_Char(unsigned char x)
{
SBUF = x;
while(!TI)
{
;
}
TI = 0;
}
void Transmit_String(unsigned char *s)
{
unsigned char i;
while((s[i]) != 0)
{
Transmit_Char(s[i]);
i++;
}
}
char Rcv()
{
while(!RI)
{;}
RI = 0;
return SBUF;
}
void delay(unsigned int i)
{
unsigned int j,k;
for(j=0;j<=i;j++)
{
for(k=0;k<256;k++);
}
}
void main(void)
{
unsigned char r;
Serial_Init();
while(1)
{
Transmit_String("Hello World \n");
//r = Rcv();
//delay(100);
//Transmit_Char(r);
delay(100);
}
}
Proteus Simulator Design:
Interfacing the UART Serial Communication with the P89v51rd2 Micro controller, with the baud rate of 9600bps. The Source code and Simulator Model of this Communication is listed Below.
Source :
#include <reg51.h>
unsigned char var;
unsigned char var1;
void Serial_Init()
{
TMOD = 0x20;
SCON = 0x50;
TH1 = 0xFD;
TR1 = 1;
}
void Transmit_Char(unsigned char x)
{
SBUF = x;
while(!TI)
{
;
}
TI = 0;
}
void Transmit_String(unsigned char *s)
{
unsigned char i;
while((s[i]) != 0)
{
Transmit_Char(s[i]);
i++;
}
}
char Rcv()
{
while(!RI)
{;}
RI = 0;
return SBUF;
}
void delay(unsigned int i)
{
unsigned int j,k;
for(j=0;j<=i;j++)
{
for(k=0;k<256;k++);
}
}
void main(void)
{
unsigned char r;
Serial_Init();
while(1)
{
Transmit_String("Hello World \n");
//r = Rcv();
//delay(100);
//Transmit_Char(r);
delay(100);
}
}
Proteus Simulator Design:
I can not find p89v51rd2 in proteus??? from where I can find the library for p89v51rd2??? or if there is any controller similar to it???
ReplyDeletehi Nisarg
DeleteIn proteus there is no library for that P89V51RD2 Controller, so we have to design this by changing the property of normal 40 pin 8051 controller,..
Hey I am having problems with creating P89V51RD2 from 8051 can you please help me out, tries to display a message on hyperterminal it didn't work
DeleteThanks for this post ,it is very useful for my project. here i found more detailed information on Embedded Systems
ReplyDeletenice info regards, flipkart discount coupons
ReplyDeleteHello Avinash can you please send me the Library file for p89v51rd2. Pls mail it to me at ram461555@gmail.com. I want it for my project
ReplyDelete