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] Problem in Pic16f870 with uart.can anyone help me...

Status
Not open for further replies.

arunbharathi.arasu

Full Member level 2
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
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;
 

hai,
what proplem? u didnt specify....
- if u are getting garbage values, .... s is pointer, so TXREG=s will load the address,
so change to, TXREG=*s am I right?

Ratheesh
 
ya u both r right....
thanks......
And i din't configure the configuration bits...
Now i configured the bits and it is working....
one again thanks you both.....
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top