Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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
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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top