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

serial communication

hi there i am trying to communicate microcontroler with computer.the program is as follow's

#include<reg52.h>

void main(void)
     {
         TMOD = 0x20;
         TH1  = 0xF3;
         SCON = 0x50;
         TR1  = 1;
         PCON = 0x80;
         while(1)
               {
                   SBUF ='A';
                   while(TI == 0);
                   TI = 0;
                   }
         }

at hard ware end i am using max 232cpe
controller at89s52
the prog.
is runing properly.as tested in keil
but not working at the hard ware side
i am tested it in hyper terminal
with the following setting

baud rate 9600
parity bit none
stop bit 1
flow controller none

but no output
please help me

  • I guess you used 24Mhz?

    It seems that you programmed it to loop forever but not to transmit A forever, but to transmit A once and do nothing.

    Still an A should be transmitted at each reset. Do you receive it?

    Are you sure RX/TX/Gnd are connected right for your cable?

    How do you know if your max232 circuit is working?

    Ed

  • Yu can connect microcontroller to computer cross connection. computer rx t&#305;o your card tx and computer tx to your cards rx . Yu can test your connection cable. &#304;f you can start hyper terminal and connect your cables rx and tx with an jumper. Then if you press a key in your keyboard you see from yor secreen same charecter. You can use this technic step by step for all rx an tx connection. Last test is 8051 rx and tx pins connect. &#304;f you can recive same charecter all connection is true.

  • erik malund clock speed 24Mhz

    ED Deep
    i tried it transmit A once but still no result

    ali karakas
    shorting 2 and 3 pin of RS 232 pressed charactor
    apperes on screen

  • You can connect to your pc only rs232 cable and then you must make short circuit other side with pin 2 and 3. After open hyper terminal and configure it. All configuration must be true. Select com port from hyper terminal and baud rate and start stop bit and parity bit and follow control. After you can press a character from your keyboard ant you must recive same charecter on your screeen. &#304;f its rigth your connection and your setup for pc side rigth.

    Step 2 ) After you can connect rs232 cables another side to your board. And make short circuit from 232 ic tx an rx pin (not for TTL -only 232 level). Rpeat first step.

    step 3) After you can connect 8051 rx and tx pin short circuit. After rpeat step1. &#304;f all step is okey .your cable and your board connection its possible. &#304;f you can dont make this proses. &#304; can send to you a shema for this operation.

  • thank's for the help
    problem solved the one silly mistake result in big problem.
    this is the first step
    if i struct in any problem in future hope all of you help me

    thank's again