ATMEGA8U2-AU Atmel, ATMEGA8U2-AU Datasheet - Page 154
ATMEGA8U2-AU
Manufacturer Part Number
ATMEGA8U2-AU
Description
MCU AVR 8K FLASH 16MHZ 32TQFP
Manufacturer
Atmel
Series
AVR® ATmegar
Specifications of ATMEGA8U2-AU
Core Processor
AVR
Core Size
8-Bit
Speed
16MHz
Connectivity
SPI, UART/USART, USB
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Number Of I /o
22
Program Memory Size
8KB (4K x 16)
Program Memory Type
FLASH
Eeprom Size
512 x 8
Ram Size
512 x 8
Voltage - Supply (vcc/vdd)
2.7 V ~ 5.5 V
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
32-TQFP, 32-VQFP
Processor Series
ATmega
Core
AVR
Data Bus Width
8 bit
Data Ram Size
512 B
Interface Type
SPI, USART, USB
Maximum Clock Frequency
16 MHz
Number Of Programmable I/os
22
Number Of Timers
2
Operating Supply Voltage
5 V
Maximum Operating Temperature
+ 85 C
Mounting Style
SMD/SMT
3rd Party Development Tools
EWAVR, EWAVR-BL
Development Tools By Supplier
ATAVRDRAGON, ATSTK500, ATSTK600, ATAVRISP2, ATAVRONEKIT, AT90USBKEY, ATEVK525
Minimum Operating Temperature
- 40 C
Operating Temperature Range
- 40 C to + 85 C
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Data Converters
-
Lead Free Status / Rohs Status
Details
Available stocks
Company
Part Number
Manufacturer
Quantity
Price
Company:
Part Number:
ATMEGA8U2-AU
Manufacturer:
Atmel
Quantity:
2 772
Part Number:
ATMEGA8U2-AU
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
- Current page: 154 of 309
- Download datasheet (6Mb)
18.5
7799D–AVR–11/10
USART Initialization
The USART has to be initialized before any communication can take place. The initialization pro-
cess normally consists of setting the baud rate, setting frame format and enabling the
Transmitter or the Receiver depending on the usage. For interrupt driven USART operation, the
Global Interrupt Flag should be cleared (and interrupts globally disabled) when doing the
initialization.
Before doing a re-initialization with changed baud rate or frame format, be sure that there are no
ongoing transmissions during the period the registers are changed. The TXCn Flag can be used
to check that the Transmitter has completed all transfers, and the RXC Flag can be used to
check that there are no unread data in the receive buffer. Note that the TXCn Flag must be
cleared before each transmission (before UDRn 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 asynchronous operation using polling
(no interrupts enabled) and a fixed frame format. 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.
Note:
More advanced initialization routines can be made that include frame format as parameters, dis-
able interrupts and so on. However, many applications use a fixed setting of the baud and
control registers, and for these types of applications the initialization code can be placed directly
in the main routine, or be combined with initialization code for other I/O modules.
Assembly Code Example
C Code Example
USART_Init:
void USART_Init( unsigned int baud )
{
}
; Set baud rate
out
out
; Enable receiver and transmitter
ldi
out
; Set frame format: 8data, 2stop bit
ldi
out
ret
/* Set baud rate */
UBRRHn = (unsigned char)(baud>>8);
UBRRLn = (unsigned char)baud;
/* Enable receiver and transmitter */
UCSRnB = (1<<RXENn)|(1<<TXENn);
/* Set frame format: 8data, 2stop bit */
UCSRnC = (1<<USBSn)|(3<<UCSZn0);
1. See “Code Examples” on page 6.
UBRRHn, r17
UBRRLn, r16
r16, (1<<RXENn)|(1<<TXENn)
UCSRnB,r16
r16, (1<<USBSn)|(3<<UCSZn0)
UCSRnC,r16
(1)
(1)
ATmega8U2/16U2/32U2
154
Related parts for ATMEGA8U2-AU
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
Part Number:
Description:
IC AVR MCU 8K 16MHZ 5V 32TQFP
Manufacturer:
Atmel
Datasheet:
Part Number:
Description:
IC AVR MCU 8K 16MHZ 5V 32-QFN
Manufacturer:
Atmel
Datasheet:
Part Number:
Description:
IC AVR MCU 8K 16MHZ 5V 28DIP
Manufacturer:
Atmel
Datasheet:
Part Number:
Description:
IC AVR MCU 8K 16MHZ COM 32-TQFP
Manufacturer:
Atmel
Datasheet:
Part Number:
Description:
IC AVR MCU 8K 16MHZ IND 32-TQFP
Manufacturer:
Atmel
Datasheet:
Part Number:
Description:
IC AVR MCU 8K 16MHZ COM 28-DIP
Manufacturer:
Atmel
Datasheet:
Part Number:
Description:
IC AVR MCU 8K 16MHZ IND 28-DIP
Manufacturer:
Atmel
Datasheet:
Part Number:
Description:
IC AVR MCU 8K 16MHZ COM 32-QFN
Manufacturer:
Atmel
Datasheet:
Part Number:
Description:
MCU AVR 8KB FLASH 16MHZ 32QFN
Manufacturer:
Atmel
Datasheet:
Part Number:
Description:
IC AVR MCU 8K 16MHZ IND 32-QFN
Manufacturer:
Atmel
Datasheet:
Part Number:
Description:
IC MCU AVR 8K 5V 16MHZ 32-TQFP
Manufacturer:
Atmel
Datasheet:
Part Number:
Description:
IC MCU AVR 8K 5V 16MHZ 32-QFN
Manufacturer:
Atmel
Datasheet:
Part Number:
Description:
IC MCU AVR 8K 5V 16MHZ 28-DIP
Manufacturer:
Atmel
Datasheet: