Author Topic: Serial comm. between 89s52 and computer  (Read 6281 times)

0 Members and 1 Guest are viewing this topic.

Offline neo01124Topic starter

  • Jr. Member
  • **
  • Posts: 46
  • Helpful? 0
Serial comm. between 89s52 and computer
« on: December 10, 2007, 09:40:06 AM »
we are using the schematic to establish comm between 89s52 and serial port. We are using 22uf caps instead of the 1uf caps rest of the circuit is identical and we are providing supply to both the ICs from a seperate adapter thru a 7805. We are using the following c code to communicate with the uC but no comm. is established.The serial port monitor shows following output .Since the serial port monitor shows proper output and no effect is seen on the uC side we feel there is something wrong with its programming here is the program we have loaded into the uC
#include<reg51.h>
void main()
{
unsigned char mybyte;
SCON=0x50;
TMOD=0x20;
TH1=-18;
TR1=1;
while(1)
{
while(RI==0);
mybyte=SBUF;
P1=mybyte;
RI=0;
}
}
The Keil simulator shows a baud rate of 4772 whiole COM1 port baudrate is 4800
Please help us with establishing this protocol!!!!

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Serial comm. between 89s52 and computer
« Reply #1 on: January 26, 2008, 09:52:54 AM »
did you ever get it to work?

your com ports aren't matching baud rates

Offline neo01124Topic starter

  • Jr. Member
  • **
  • Posts: 46
  • Helpful? 0
Re: Serial comm. between 89s52 and computer
« Reply #2 on: January 27, 2008, 08:34:51 AM »
ya v got it working basically there was an error in setting the baudrate in the IDE cos we were using a 11.0592mhz crystal and it was set to 20mhz or something, if i remembered correctly, thats y the simulator was showing a wrong frequency of 4772 bauds
then we corrected this did the tx rx shorting test at a few places and voila serial communication!! 8)

 


Get Your Ad Here

data_list