ChipCenter Questlink
SEARCH CHIPCENTER
Search Type:
Search for:




Knowledge Centers
Product Reviews
Data Sheets
Guides & Experts
News
International
Ask Us
Circuit Cellar Online
App Notes
NetSeminars
Careers
Resources
FAQ
EE Times Network
Electronics Group Sites

Listing

Listing 3-Transmitting a value using multidrop protocol is a two-stage operation. First, the drop address must be sent, then the character. The protocol for handling bus contentions is not given.

#define SENDMultiDropADDRESS 0x80	// Transmit using multidrop protocol
#define WRITEREADY 0x04
#define CLOCKED 0x08
void MultiDropSend(char value, char dropaddress) {
char temp;
ResetToMODE1( );	// Configure DUART to send 9-bit address
temp = *MODE1;	
ResetToMODE1( );
*MODE1 = temp | SENDMultiDropADDRESS;
while((TXDONE & WRITEREADY) != WRITEREADY)	// Wait till DUART can send
*TXHOLD = dropaddress;	/* Wait */ ;
while((*TXDONE & CLOCKED) != CLOCKED)	// Wait till value has been clocked out
/* Wait */ ;
ResetToMODE1( );	// Configure DUART to send 9-bit value
temp = *MODE1;
ResetToMODE1( );
*MODE1 = temp & ~ SENDMultiDropADDRESS;
while((*TXDONE & WRITEREADY) != WRITEREADY)	// Wait till DUART can send
/* Wait */ ;
* TXHOLD = value;
while((*TXDONE & CLOCKED) != CLOCKED)	// Wait till value has been clocked out
/* Wait */ ;
}
Click here to get your listing up.

Copyright © 2003 ChipCenter-QuestLink
About ChipCenter-Questlink  Contact Us  Privacy Statement   Advertising Information  FAQ