Skip to main content

P89V51RD2 Interfacing with the UART Serial Communication

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:







Comments

  1. 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???

    ReplyDelete
    Replies
    1. hi Nisarg

      In 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,..

      Delete
    2. 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

      Delete
  2. Thanks for this post ,it is very useful for my project. here i found more detailed information on Embedded Systems

    ReplyDelete
  3. Hello 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

Post a Comment

Popular posts from this blog

Interfacing UART with 8051

The interfacing of serial communication (UART) with 8051 micro controller, with the baud rate of 9600bps.  Code: #include <reg51.h> #include <stdio.h> unsigned char c; void Serial_Init() {     TMOD = 0x20;     SCON = 0x50;     TH1  = 0xFD;     TR1  = 1;     TI   = 1;     RI   = 0;       } void delay(unsigned int i) {     unsigned int j,k;     for(j=0;j<=i;j++)     {         for(k=0;k<256;k++);     } } void main(void) {     Serial_Init();     printf("Hello World \n");     while(1)     {                 delay(5);         c = getchar();         delay(5);         //putchar(c);         delay(5);            }                    } Design Proteus:
P89V51RD2 Interfacing with DS1307 RTC           The DS1307 RTC IC I nterfacing with P89V51RD2 Micro Controller use of the KEIL IDE, and proteus simulator. The source code and thhe screen short of simulator model are attached with this.              This interfacing is done by the I2C Communication between the Micro Controller and DS1307 RTC. Source Code: #include <reg51.h> #include <stdio.h> sbit SCL = 0x90; // SCL for I2C sbit SDA = 0x91; // SDA for I2C volatile unsigned char DS1307_WA=0xD0; volatile unsigned char DS1307_RA=0xD1; unsigned char Rdata; unsigned char sec1,min1,hour1,date1,month1,year1,d,l,m,j,i; unsigned char sec[20],min[2],hour[2],ch1; unsigned char RTCDateTime[15]; unsigned char Buf[20]; void Serial_Init() {     TMOD = 0x20;     SCON = 0x50;     TH1  = 0xFD;     TR1  = 1;     TI   = 1;     RI   = 0;       } void delay(unsigned int i) {     unsigned int j,k;     for(j=0;j<=i;j++)     {         for(k=0;