Разработка, производство и продажа радиоэлектронной аппаратуры
|
Требуется программист в Зеленограде - обработка данных с датчиков; ColdFire; 40 тыс.
e-mail: jobsmp@pochta.ru
|
If 9-bit characters are used (UCSZ = 7), the ninth bit must be written to the TXB8 bit in
UCSRB before the low byte of the character is written to UDR. The following code
examples show a transmit function that handles 9 bit characters. For the assembly
code, the data to be sent is assumed to be stored in Registers R17:R16.void USART_Transmit( unsigned int data )
{
/* Wait for empty transmit buffer */
while ( !( UCSRA & (1<;
/* Copy 9th bit to TXB8 */
UCSRB &= ~(1<if ( data & 0x0100 )
UCSRB |= (1</* Put data into buffer, sends the data */
UDR = data;
}
Составить ответ | Вернуться на конференцию
Ответы