ATMEGA48-20AJ Atmel, ATMEGA48-20AJ Datasheet - Page 182

IC AVR MCU 4K 5V 20MHZ 32-TQFP

ATMEGA48-20AJ

Manufacturer Part Number
ATMEGA48-20AJ
Description
IC AVR MCU 4K 5V 20MHZ 32-TQFP
Manufacturer
Atmel
Series
AVR® ATmegar
Datasheets

Specifications of ATMEGA48-20AJ

Core Processor
AVR
Core Size
8-Bit
Speed
20MHz
Connectivity
I²C, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Number Of I /o
23
Program Memory Size
4KB (2K x 16)
Program Memory Type
FLASH
Eeprom Size
256 x 8
Ram Size
512 x 8
Voltage - Supply (vcc/vdd)
2.7 V ~ 5.5 V
Data Converters
A/D 8x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
32-TQFP, 32-VQFP
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Other names
ATMEGA48-24AJ
ATMEGA48-24AJ

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
ATMEGA48-20AJ
Manufacturer:
Atmel
Quantity:
10 000
19.7.3
182
ATmega48/88/168
Receive Compete Flag and Interrupt
Note:
The USART Receiver has one flag that indicates the Receiver state.
Assembly Code Example
C Code Example
USART_Receive:
USART_ReceiveNoError:
unsigned int USART_Receive( void )
{
}
; Wait for data to be received
sbis UCSRnA, RXCn
rjmp USART_Receive
; Get status and 9th bit, then data from buffer
in
in
in
; If error, return -1
andi r18,(1<<FEn)|(1<<DORn)|(1<<UPEn)
breq USART_ReceiveNoError
ldi
ldi
; Filter the 9th bit, then return
lsr
andi r17, 0x01
ret
unsigned char status, resh, resl;
/* Wait for data to be received */
while ( !(UCSRnA & (1<<RXCn)) )
/* Get status and 9th bit, then data */
/* from buffer */
status = UCSRnA;
resh = UCSRnB;
resl = UDRn;
/* If error, return -1 */
if ( status & (1<<FEn)|(1<<DORn)|(1<<UPEn) )
/* Filter the 9th bit, then return */
resh = (resh >> 1) & 0x01;
return ((resh << 8) | resl);
1.
return -1;
See ”About Code Examples” on page 7.
The receive function example reads all the I/O Registers into the Register File before any com-
putation is done. This gives an optimal receive buffer utilization since the buffer location read
will be free to accept new data as early as possible.
r18, UCSRnA
r17, UCSRnB
r16, UDRn
r17, HIGH(-1)
r16, LOW(-1)
r17
;
(1)
(1)
2545S–AVR–07/10

Related parts for ATMEGA48-20AJ