Continue to Site

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.

[SOLVED] Hyper terminal problem for data receive pic16f877

Status
Not open for further replies.

ragav4456

Full Member level 4
Joined
Aug 1, 2012
Messages
228
Helped
19
Reputation
38
Reaction score
17
Trophy points
1,308
Activity points
2,568
In this code is working in Proteus simulation but didnt work in HYPER Terminal. What is the reason?
But serial port working in some other application. What is the problem?


Code:
void putrs1USART(const char *data);
void putrsUSART(const char *data);
void putByteUSART(unsigned char data);
unsigned char a=33,b=0,udata,i;

void main()
{
SPBRG = 129;	 // 9600 baud @ 20MHz
TXSTA = 0x24;	 // setup USART transmit
RCSTA = 0x90;	 // setup USART receive
PORTC = 0;	 // Clear PORTC
TRISC = 0x80;	 // 



while(1)
{
putrsUSART("\r\n\ UART");
SPBRG=SPBRG+1; 
if(RCIF)
{
udata = RCREG;
putByteUSART(udata); //send char back
for(i=0;i<5;i++)
{
putrsUSART("\r\n\ 1234567890ABCDEFGHIJKLMNOPRSTVZXYQW");
putrs1USART("\r\n\ 1234567890abcdefghijklmnoprstvzxyqw");
putByteUSART(10);
putByteUSART(13);
}
}
}
}	
void putrsUSART(const char *data)
{
do
{	
while(!(TXSTA & 0x02));
TXREG = *data;
} while( *data++ );
}

void putrs1USART(const char *data)
{
do
{	
while(!TXIF);
TXREG = *data;
} while( *data++ );
}
void putByteUSART(unsigned char data)
{
while(!(TXSTA & 0x02));
TXREG = data;
}
 

the serial port for hyper terminal only (or) some other hardware is connected to serial communication.
 

Above program only not working in hyper terminal. Other programs will running in hyper terminal.
 

you post the hex file & proteus design we'll test it.
what is your compiler? & version.
 

Kindly check the attachment
 

Attachments

  • test uart.rar
    12 KB · Views: 82

Ya i know. But Hyper terminal problem?
 

My Hyperterminal is not working. How to check it is working or not? i using serial port monitor also,data is not receiving.what is the problem?
 

may be your serial port problem.
you can buy the serial port plug-in card, otherwise you can use USB to serial converter.
 

Short pins 2 and 3 on your serial port.
Fire up HyperTerminal and set 'Flow control' to 'none'.
Now anything you type should loop right back to the screen.

It's called a loop back. You can also loop flow control signals (check google for pins).
 

you connect serial port to PC, the other end there is interconnect the wire to txd & rxd of db9 connector. & check it the every character is display what ever you type in keyboard.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top