| Electronic Components Datasheet Search |
|
AT90SCR100 Datasheet(PDF) 260 Page - ATMEL Corporation |
|
|
|||||||||||||||||||||||||||||
AT90SCR100 Datasheet(HTML) 260 Page - ATMEL Corporation |
|
260 / 433 page ![]() 260 TPR0327AY–SMS–30Jan09 AT90SCR100 can be used to check that the Transmitter has completed all transfers, and the RXC0 Flag can be used to check that there are no unread data in the receive buffer. Note that the TXC0 Flag must be cleared before each transmission (before UDR0 is written) if it is used for this purpose. The following simple USART initialization code examples show one assembly and one C func- tion that are equal in functionality. The examples assume polling (no interrupts enabled). The baud rate is given as a function parameter. For the assembly code, the baud rate parameter is assumed to be stored in the r17:r16 registers. 19.6 Data Transfer Using the USART in MSPI mode requires the Transmitter to be enabled, i.e. the TXEN0 bit in the UCSR0B register is set to one. When the Transmitter is enabled, the normal port operation of the TxD0 pin is overridden and given the function as the Transmitter's serial output. Enabling Assembly Code Example USART_Init: clr r18 out UBRR0H,r18 out UBRR0L,r18 ; Setting the XCK0 port pin as output, enables master mode. sbi XCK0_DDR, XCK0 ; Set MSPI mode of operation and SPI data mode 0. ldi r18, (1<<UMSEL01)|(1<<UMSEL00)|(0<<UCPHA0)|(0<<UCPOL0) out UCSR0C,r18 ; Enable receiver and transmitter. ldi r18, (1<<RXEN0)|(1<<TXEN0) out UCSR0B,r18 ; Set baud rate. ; IMPORTANT: The Baud Rate must be set after the transmitter is enabled! out UBRR0H, r17 out UBRR0L, r18 ret C Code Example void USART_Init( unsigned int baud ) { UBRR0 = 0; /* Setting the XCK0 port pin as output, enables master mode. */ XCK0_DDR |= (1<<XCK0); /* Set MSPI mode of operation and SPI data mode 0. */ UCSR0C = (1<<UMSEL01)|(1<<UMSEL00)|(0<<UCPHA0)|(0<<UCPOL0); /* Enable receiver and transmitter. */ UCSR0B = (1<<RXEN0)|(1<<TXEN0); /* Set baud rate. */ /* IMPORTANT: The Baud Rate must be set after the transmitter is enabled */ UBRR0 = baud; } |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |