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 / send data serially on port

send data serially on port

|

Microcontroller › 8051 › send data serially on port

  • This topic has 1 reply, 2 voices, and was last updated 13 years, 2 months ago by AJISH ALFRED.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • August 6, 2012 at 10:15 am #1902
    chitra
    Participant

    hi 

    mi want to send array af strings serially to controller and i want o/p on port.

    i have done program for it.i m getting values in SBUF,but not on port .plz suggest me something,,,,,,,,,

     

    here is my pro.

     

     

     

     unsigned char a[2][3] = {{0x30,0x81,0x92},{0xA4,0xB5,0xD6}};
     unsigned char  *p = &a[0][0];
     void pass(unsigned char * ) ; 
     
     void main()
     {
     TMOD = 0X20;
     SCON = 0X50;
     TH1 = 0XFD;
     TR1 = 1;
     
     pass(p);
     
     }  
     
     void pass(unsigned char *p) 
      {
      static unsigned char value,i,k,j;
       for(i = 0; i<2; i++)
     for( j =0;j < 3; j++ )
     {
         k = *p++;
         SBUF = k;
        while( TI == 0);  //and please tell me where should i write these 2 lines?? 
         TI = 0;              //
         value = SBUF;
         P2 = value;        //wann take o/p on port 2
     
        }
      }
       
    November 5, 2012 at 2:44 pm #8721
    AJISH ALFRED
    Participant

    I believe once you write something into the serial buffer SBUF it will get transmitted serially within no time (shifting bit by bit to serial pin). Hence no data exist in the SBUF after data transmission completes. Hence it is not possible to read back the same data from the SBUF to a port. (value = SBUF;    //not possible)

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

RSS Recent Posts

  • flexible copper cable January 13, 2026
  • Sears 40/20 200amp starter/battery charger switch pinout January 13, 2026
  • renewed interest in old project I call it WICKED 8 January 13, 2026
  • Drawing software January 13, 2026
  • updating circuit with power on off switching January 13, 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