RS232 Port Communication 89c51 to PC

Status
Not open for further replies.

jay_3189

Banned
Joined
Sep 19, 2013
Messages
104
Helped
0
Reputation
0
Reaction score
0
Trophy points
16
Location
Ahmedabad
Visit site
Activity points
0
Hello Everyone
I have written code as below and i am juat sending signal to pc but i have problem in communication.
1. I am not getting ICON in first step in Hyperlink Terminal.
2. How could i know that my data is under process or it going to transmit.
3. How could i see or set baud rate that supported by my wire.(In terminal i have set it as 9600)
4. i am using 9 pin RS 232 port and 89c51 controller with freq. 11.0592.
HTML:
#include <REG51.H>               
#include <stdio.h>              
void serial_init(void);	


void main(void)
{
            serial_init();
            printf (" PS - PrimerC51 UART Demo\n\n\r");
            while (1)
            {
            printf ("Hello World!! \n\r");   /* Print "Hello World" */
            }
}
//-------------------------------------------------
//Setup the serial port for 9600 baud at 11.0592MHz.
//-------------------------------------------------
void serial_init(void)
{
    SCON  = 0x50;                  /* SCON: mode 1, 8-bit UART, enable rcvr         */
    TMOD |= 0x20;               /* TMOD: timer 1, mode 2, 8-bit reload                    */
    TH1   = 0xFD;               /* TH1:  reload value for 9600 baud @ 11.0592MHz*/
    TR1   = 1;                  /* TR1:  timer 1 run                               */
    TI    = 1;                  /* TI:   set TI to send first char of UART           */
}
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…