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! PIC USART interrupt problem!

Status
Not open for further replies.

kerden

Junior Member level 3
Joined
Dec 11, 2004
Messages
25
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
284
My problem as follow.and i emluator in ICD2, the progam can send out the data. but it can't receive any data, and it can run into the interrupt.
what's wrong?
thank you!

Code:
void init_com()
{
	SPBRG = 0x23;  
	TXSTA = 0x04;   
	RCSTA = 0x90;  
	TRISC = 0x80;
	INTCON |= 0xc0;  
	PIE1 |= 0x20;   
}

main()
{
	init_com();
	while(1);	
}

void interrupt Data_Rec(void)
{
	if(RCIF)   
	{
		data = RCREG;
	}
}
 

Hi Kerden,

I could probably help you on this, but I need to know which PIC you use... There's a lot of different versions out there! :D

cyberblak
 

cyberblak said:
Hi Kerden,

I could probably help you on this, but I need to know which PIC you use... There's a lot of different versions out there! :D

cyberblak


thank you !
i use pic16f877 chip.
 

hi

I used pic 16f877 the problem what ur saying i understood i think u r doing some mistake in ur code itself u assigned the RCREG to a variable data but where did u call it in main and that the function in main u check whether it is always polling data or not
ram
 

janakiram.sistla said:
hi

I used pic 16f877 the problem what ur saying i understood i think u r doing some mistake in ur code itself u assigned the RCREG to a variable data but where did u call it in main and that the function in main u check whether it is always polling data or not
ram

thank you!
but why i can receive the data?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top