PIC16F877A serial port - virtual terminal problem

Status
Not open for further replies.

lignin

Junior Member level 2
Joined
Apr 27, 2013
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,436
I am learning rs232 serial communication and ı write code and ı simulate this code in proteus but not work. here is my code :
Code:
#include<pic.h>
#include<htc.h>
#include<PIC16F877A.h>

#define _XTAL_FREQ 4000000;

void init()
{
	BRGH=1;
	SPBRG=25;
	SYNC=0;
	SPEN=1;
	TXEN=1;
}

void characterarraywrite(char character[])
{
	int i=0;
	while(i<100)
	{
		if(character[i]!=0)
		{
			TXREG=character[i];
			_delay(100000);
			i++;
			continue;
		}
		break;
	}

}


void main()
{
	init();
	char array[] = "ahadir";
	characterarraywrite(array);
	while(1);
}

here is my proteus virtual terminal outcome :


so why I cant see the "ahadir" in virtual terminal ?
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…