ATmega164P Atmel Corporation, ATmega164P Datasheet - Page 177

no-image

ATmega164P

Manufacturer Part Number
ATmega164P
Description
Manufacturer
Atmel Corporation
Datasheets

Specifications of ATmega164P

Flash (kbytes)
16 Kbytes
Pin Count
44
Max. Operating Frequency
20 MHz
Cpu
8-bit AVR
# Of Touch Channels
16
Hardware Qtouch Acquisition
No
Max I/o Pins
32
Ext Interrupts
32
Usb Speed
No
Usb Interface
No
Spi
3
Twi (i2c)
1
Uart
2
Graphic Lcd
No
Video Decoder
No
Camera Interface
No
Adc Channels
8
Adc Resolution (bits)
10
Adc Speed (ksps)
15
Analog Comparators
1
Resistive Touch Screen
No
Temp. Sensor
No
Crypto Engine
No
Sram (kbytes)
1
Eeprom (bytes)
512
Self Program Memory
YES
Dram Memory
No
Nand Interface
No
Picopower
Yes
Temp. Range (deg C)
-40 to 85
I/o Supply Class
1.8 to 5.5
Operating Voltage (vcc)
1.8 to 5.5
Fpu
No
Mpu / Mmu
no / no
Timers
3
Output Compare Channels
6
Input Capture Channels
1
Pwm Channels
6
32khz Rtc
Yes
Calibrated Rc Oscillator
Yes

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
ATmega164P-15AT
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
ATmega164P-15AT1
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
ATmega164P-15AZ
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
ATmega164P-20AQ
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
ATmega164P-20AQ
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ATmega164P-20AQR
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
ATmega164P-20AU
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ATmega164P-20MU
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ATmega164P-A15AZ
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ATmega164P-A15MZ
Manufacturer:
ATMEL
Quantity:
263
Part Number:
ATmega164P-A15MZ
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
16.7
8011O–AVR–07/10
Data Transmission – The USART Transmitter
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.
The USART Transmitter is enabled by setting the Transmit Enable (TXEN) bit in the UCSRnB
Register. When the Transmitter is enabled, the normal port operation of the TxDn pin is overrid-
den by the USART and given the function as the Transmitter’s serial output. The baud rate,
mode of operation and frame format must be set up once before doing any transmissions. If syn-
chronous operation is used, the clock on the XCKn pin will be overridden and used as
transmission clock.
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 “About Code Examples” on page 8.
UBRRHn, r17
UBRRLn, r16
r16, (1<<RXENn)|(1<<TXENn)
UCSRnB,r16
r16, (1<<USBSn)|(3<<UCSZn0)
UCSRnC,r16
(1)
(1)
ATmega164P/324P/644P
177

Related parts for ATmega164P