EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / serial communication between pc and AT89c52

serial communication between pc and AT89c52

|

Microcontroller › 8051 › serial communication between pc and AT89c52

  • This topic has 8 replies, 4 voices, and was last updated 14 years ago by AJISH ALFRED.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • May 9, 2012 at 2:52 pm #1232
    bll
    Participant

    helloo, i need codes to communicate pc with AT89c52, pls help me

    May 10, 2012 at 3:00 am #7694
    Harsh Pandya
    Participant

     

     Serial Communication

    UART (Universal Asynchronous Receiver Transmitter) or USART (Universal Synchronous Asynchronous Receiver Transmitter) are one of the basic interface which you will find in almost all the controllers available in the market till date. This interface provides a cost effective simple and reliable communication between one controller to another controller or between a controller and PC.

     

     RS-232 Basics

    RS-232 (Recommended Standard 232) is a standard for serial binary data signals connecting between a DTE (Data terminal equipment) and a DCE (Data Circuit-terminating Equipment).

     

     

     

     

     

    RS-232 Level Converters
    Usually all the digial ICs works on TTL or CMOS voltage levels which cannot be used to communicate over RS-232 protocol. So a voltage or level converter is needed which can convert TTL to RS232 and RS232 to TTL voltage levels. The most commonly used RS-232 level converter is MAX232. This IC includes charge pump which can generate RS232 voltage levels (-10V and +10V) from 5V power supply. It also includes two receiver and two transmitters and is capable of full-duplex UART/USART communication.

    MAX232 Pin description
    MAX232 Pin Description
    MAX232 typical circuit
    MAX232 Typical Connection Circuit

    FIG 3.28 MAX232

     

     MAX232 Interfacing with Microcontrollers

    To communicate over UART or USART, we just need three basic signals which are namely, RXD (receive), TXD (transmit), GND (common ground). So to interface MAX232 with any microcontroller (AVR, ARM, 8051, PIC etc..) we just need the basic signals. A simple schematic diagram of connections between a microcontroller and MAX232 is shown below

    MAX232 connections with microcontroller

     

    May 10, 2012 at 3:00 am #7713
    Harsh Pandya
    Participant

     

     Serial Communication

    UART (Universal Asynchronous Receiver Transmitter) or USART (Universal Synchronous Asynchronous Receiver Transmitter) are one of the basic interface which you will find in almost all the controllers available in the market till date. This interface provides a cost effective simple and reliable communication between one controller to another controller or between a controller and PC.

     

     RS-232 Basics

    RS-232 (Recommended Standard 232) is a standard for serial binary data signals connecting between a DTE (Data terminal equipment) and a DCE (Data Circuit-terminating Equipment).

     

     

     

     

     

    RS-232 Level Converters
    Usually all the digial ICs works on TTL or CMOS voltage levels which cannot be used to communicate over RS-232 protocol. So a voltage or level converter is needed which can convert TTL to RS232 and RS232 to TTL voltage levels. The most commonly used RS-232 level converter is MAX232. This IC includes charge pump which can generate RS232 voltage levels (-10V and +10V) from 5V power supply. It also includes two receiver and two transmitters and is capable of full-duplex UART/USART communication.

    MAX232 Pin description
    MAX232 Pin Description
    MAX232 typical circuit
    MAX232 Typical Connection Circuit

    FIG 3.28 MAX232

     

     MAX232 Interfacing with Microcontrollers

    To communicate over UART or USART, we just need three basic signals which are namely, RXD (receive), TXD (transmit), GND (common ground). So to interface MAX232 with any microcontroller (AVR, ARM, 8051, PIC etc..) we just need the basic signals. A simple schematic diagram of connections between a microcontroller and MAX232 is shown below

    MAX232 connections with microcontroller

     

    May 10, 2012 at 5:48 am #7702
    Amrith
    Participant

    Hello,

     

    There is an available solution on engineers garage for your query.

     

    follow below link:

     

    http://www.engineersgarage.com/microcontroller/8051projects/interface-serialport-RS232-AT89C51-circuit

     

    further doubts kindly post

    May 10, 2012 at 5:48 am #7721
    Amrith
    Participant

    Hello,

     

    There is an available solution on engineers garage for your query.

     

    follow below link:

     

    http://www.engineersgarage.com/microcontroller/8051projects/interface-serialport-RS232-AT89C51-circuit

     

    further doubts kindly post

    May 10, 2012 at 8:10 am #7704
    bll
    Participant

    im using these codes

    #include <regx52.h>
    unsigned char a ;

    void main(void)
    {

    TMOD=0x20;
    TH1=0xFD;
    SCON=0x50;
    TR1=1;

    IE=0X00;

    while(1)
    {
    while(RI==0);
    a=SBUF;
    P1=a;
    RI=0;
    }

    }

     

     

     

     

     

    but there is a problem at receiving data, i send numbers from 0 to 15, i got them properly at 89c52, but after 15 it doesnt work properly?, i cant see what is the problem.

    May 10, 2012 at 8:10 am #7723
    bll
    Participant

    im using these codes

    #include <regx52.h>
    unsigned char a ;

    void main(void)
    {

    TMOD=0x20;
    TH1=0xFD;
    SCON=0x50;
    TR1=1;

    IE=0X00;

    while(1)
    {
    while(RI==0);
    a=SBUF;
    P1=a;
    RI=0;
    }

    }

     

     

     

     

     

    but there is a problem at receiving data, i send numbers from 0 to 15, i got them properly at 89c52, but after 15 it doesnt work properly?, i cant see what is the problem.

    May 11, 2012 at 2:44 pm #7742
    AJISH ALFRED
    Participant

    If everything else is right, I guess the problem might be there in the data type of the variable you are using. Well I’m not sure, anyway try changing the data type of ‘a’ to char a, or int a.

    May 11, 2012 at 2:44 pm #7764
    AJISH ALFRED
    Participant

    If everything else is right, I guess the problem might be there in the data type of the variable you are using. Well I’m not sure, anyway try changing the data type of ‘a’ to char a, or int a.

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Phone Charger 5v to 12v May 17, 2026
  • reviving old swordfish program but? May 17, 2026
  • Assistance locating a 'trail' camera gadget, please ? May 16, 2026
  • Analog multiplexer has gone obselete May 16, 2026
  • Difference between TTL, RS232 and RS485 May 16, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise