Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/16/00 17:44
Read: times


 
#6560 - RE: Communication via UART in C
This is a better transmit scheme. The first was incomplete and has a logical bad. (I typed before thinking)
The Xmit_in_progress bit allows you to know in your interrupt if you should keep transmitting or not. After you transmit the last character you clear Xmit_in_progress. After the hardware sends the byte you will get one more interrupt. With Xmit_in_progress cleared you will just leave the interrupt without further action.

Allen

//this bit should be set by
//the function initiating the
//message transmission
extern bit Xmit_in_progress;

if(TI)
{
if(Xmit_in_progress)
{
//Send out a message from an array
SBUF = Xmt_Buffer[Tbuff_Ptr++];
if(Xmt_Buffer[Tbuff_Ptr] == ENDOFMESSAGE)
{
Tbuff_Ptr = 0;
Xmit_in_progress = 0;

}
}end if(Xmit_in_progress)
}//end if(TI)


List of 8 messages in thread
TopicAuthorDate
Communication via UART in C            01/01/70 00:00      
RE: Communication via UART in C            01/01/70 00:00      
RE: Communication via UART in C            01/01/70 00:00      
RE: Communication via UART in C            01/01/70 00:00      
RE: Communication via UART in C            01/01/70 00:00      
RE: Communication via UART in C            01/01/70 00:00      
RE: Communication via UART in C            01/01/70 00:00      
RE: Communication via UART in C            01/01/70 00:00      

Back to Subject List