This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

2 UARTs

Hi guys,
Here is the situation I've 89c51 microcontroller board which I want to connect with PC as well as GSM but as everybody knows it(8051) has only one UART so one solution is try using 87xx or 83xx series of controller but that means I'll have to change my programmer. So what I'm thinking is I'll use simple mux/demux for Tx/Rx of 8051. I want to know will it be o.k.? Can simple AND or OR gates can handle data rate of 9600bps?

Thank you very much in advance.

Parents
  • Can anybody let me know what should following programing do? Is main in keil is reentrant? even with for loop following pogram work infinitely

    //program to transmit a chaaracter
    #include<reg51.h>
    
    sbit Select = P3^2;
    void Delay(void);
    
    
    void main(void)
     {
      int i;
      SCON = 0x50;
      TMOD = 0x20;
      TH1  = 0xFD;
      TR1  = 1;
      for(i=0; i<21; i++)
       {
        Select = 0;
            SBUF = 'p';
            while(TI == 0){}
            TI = 0;
            P2 = 'p';
            Delay();
            Delay();
            Delay();
            Delay();
            Delay();
            Select = 1;
            SBUF = 'q';
            while(TI == 0){}
            TI = 0;
            P2 = 'q';
            Delay();
            Delay();
            Delay();
            Delay();
            Delay();
       }
    
     }
    
    
     void Delay(void)
      {
       unsigned char i;
       for(i=0;i<=200;i++)
        {}
       return;
      }
    
    
    
    

Reply
  • Can anybody let me know what should following programing do? Is main in keil is reentrant? even with for loop following pogram work infinitely

    //program to transmit a chaaracter
    #include<reg51.h>
    
    sbit Select = P3^2;
    void Delay(void);
    
    
    void main(void)
     {
      int i;
      SCON = 0x50;
      TMOD = 0x20;
      TH1  = 0xFD;
      TR1  = 1;
      for(i=0; i<21; i++)
       {
        Select = 0;
            SBUF = 'p';
            while(TI == 0){}
            TI = 0;
            P2 = 'p';
            Delay();
            Delay();
            Delay();
            Delay();
            Delay();
            Select = 1;
            SBUF = 'q';
            while(TI == 0){}
            TI = 0;
            P2 = 'q';
            Delay();
            Delay();
            Delay();
            Delay();
            Delay();
       }
    
     }
    
    
     void Delay(void)
      {
       unsigned char i;
       for(i=0;i<=200;i++)
        {}
       return;
      }
    
    
    
    

Children