ATMEGA324P-A15MZ Atmel, ATMEGA324P-A15MZ Datasheet - Page 147

MCU AVR 32KB FLASH 15MHZ 44-VQFN

ATMEGA324P-A15MZ

Manufacturer Part Number
ATMEGA324P-A15MZ
Description
MCU AVR 32KB FLASH 15MHZ 44-VQFN
Manufacturer
Atmel
Series
AVR® ATmegar
Datasheet

Specifications of ATMEGA324P-A15MZ

Package / Case
44-VQFN Exposed Pad
Voltage - Supply (vcc/vdd)
2.7 V ~ 5.5 V
Operating Temperature
-40°C ~ 125°C
Speed
16MHz
Number Of I /o
32
Eeprom Size
1K x 8
Core Processor
AVR
Program Memory Type
FLASH
Ram Size
2K x 8
Program Memory Size
32KB (32K x 8)
Data Converters
A/D 8x10b
Oscillator Type
Internal
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Connectivity
I²C, SPI, UART/USART
Core Size
8-Bit
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Data Transmission
– The USART
Transmitter
Sending Frames with
5 to 8 Data Bit
2503N–AVR–06/08
The USART Transmitter is enabled by setting the Transmit Enable (TXEN) bit in the UCSRB
Register. When the Transmitter is enabled, the normal port operation of the TxD 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 synchro-
nous operation is used, the clock on the XCK pin will be overridden and used as transmission
clock.
A data transmission is initiated by loading the transmit buffer with the data to be transmitted. The
CPU can load the transmit buffer by writing to the UDR I/O location. The buffered data in the
transmit buffer will be moved to the Shift Register when the Shift Register is ready to send a new
frame. The Shift Register is loaded with new data if it is in idle state (no ongoing transmission) or
immediately after the last stop bit of the previous frame is transmitted. When the Shift Register is
loaded with new data, it will transfer one complete frame at the rate given by the Baud Register,
U2X bit or by XCK depending on mode of operation.
The following code examples show a simple USART transmit function based on polling of the
Data Register Empty (UDRE) Flag. When using frames with less than eight bits, the most signif-
icant bits written to the UDR are ignored. The USART has to be initialized before the function
can be used. For the assembly code, the data to be sent is assumed to be stored in Register
R16
Note:
The function simply waits for the transmit buffer to be empty by checking the UDRE Flag, before
loading it with new data to be transmitted. If the Data Register Empty Interrupt is utilized, the
interrupt routine writes the data into the buffer.
Assembly Code Example
C Code Example
USART_Transmit:
void USART_Transmit( unsigned char data )
{
}
; Wait for empty transmit buffer
sbis UCSRA,UDRE
rjmp USART_Transmit
; Put data (r16) into buffer, sends the data
out
ret
/* Wait for empty transmit buffer */
while ( !( UCSRA & (1<<UDRE)) )
/* Put data into buffer, sends the data */
UDR = data;
1. See
UDR,r16
;
“About Code Examples” on page
(1)
(1)
7.
ATmega32(L)
147

Related parts for ATMEGA324P-A15MZ