Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Serial transmission/ reception using interrrup

Status
Not open for further replies.

JeffreyPeter

New Member
Hi, This is an serial interrupt code that should not execute while serial transmission but should execute while receiving data. It simulates fine in proteus but on actual hardware implementation, it hangs it is not transmitting data. Please help me debug this code.
Thanks in advance
Code:
void serial_receive() interrupt 4
{
	if(TI==0) // so that it does not execute while transmitting....
	{
		while(RI==0);// non zero character recived
		serial_get=1;
		RI=0;
	}
	
}
 
The only place it can hang is at the " while(RI == 0) " Since The interrupt has already occured, I should leave this out...

Only include "RI = 0;" at the end of the interrupt...
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top