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.

help.........I am getting problem with pic serial communication program.

Status
Not open for further replies.

ramanareddym

Newbie level 3
Joined
Dec 21, 2011
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,303
this is my code but it not giving any output on ter term serial window on my pc...


#include<pic.h>
void main(void)
{
TXSTA=0x24; //8-bit
RCSTA=0x90; //
BAUDCTL=0x12; //
SPBRG=71; //for 9600 baudrate..
TXEN=1;
SPEN=1;
while(1)
{
TXREG=0x41;
while(TXIF==0);
}
}
 

this is my code but it not giving any output on ter term serial window on my pc...


#include<pic.h>
void main(void)
{
TXSTA=0x24; //8-bit
RCSTA=0x90; //
BAUDCTL=0x12; //
SPBRG=71; //for 9600 baudrate..
TXEN=1;
SPEN=1;
while(1)
{
TXREG=0x41;
while(TXIF==0);
TXIF=0;
}
}
Try this code.
 

I generally agree, but next time please remember to at least write which PIC you are using, because different families have sometimes very different peripheral mechanisms (although what Easyrider83 said is true for all of PIC micros, maybe excluding pic32 because it's MIPS core and may have interrupts handled in different way).
 

ya tried......but same junk characters getting .........
 

wonderful
show your configuration bits if you can't understand what i'm talking about
 

You forget to set BRG16=1 for this SPBRG value.
Or just use SPBRG=17 for default settings.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top