[SOLVED] Problem in Pic16f870 with uart.can anyone help me...

Status
Not open for further replies.

arunbharathi.arasu

Full Member level 2
Joined
Feb 28, 2013
Messages
134
Helped
7
Reputation
14
Reaction score
6
Trophy points
1,298
Location
Chennai, Tamil Nadu, India
Visit site
Activity points
2,151
hi friends,
i have problem in pic16f870 uart.
i don't know where the problem is.....
can any one help me...
below i post my code..
Code:
#include<htc.h>#include<string.h>


uart_send(unsigned char*s)
{
	while(*s != '\0')
	{
		TXREG=s;
		while(TXIF!=0);	
		s++;
	}
}
void main()
{
	TRISC6=0;
	SPBRG=77;
	BRGH=1;
	SYNC=0;
	SPEN=1;
	TXIE=0; 
	TX9=0;
	TXEN=1;


	while(1)
	{
		uart_send("WELCOME");
		
	}	
}

- - - Updated - - -

baud rate is 9600;
frequency is 12MHZ;
 

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…