ATMEGA323-8AI Atmel, ATMEGA323-8AI Datasheet - Page 109

IC AVR MCU 32K 8MHZ IND 44TQFP

ATMEGA323-8AI

Manufacturer Part Number
ATMEGA323-8AI
Description
IC AVR MCU 32K 8MHZ IND 44TQFP
Manufacturer
Atmel
Series
AVR® ATmegar
Datasheet

Specifications of ATMEGA323-8AI

Core Processor
AVR
Core Size
8-Bit
Speed
8MHz
Connectivity
I²C, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Number Of I /o
32
Program Memory Size
32KB (16K x 16)
Program Memory Type
FLASH
Eeprom Size
1K x 8
Ram Size
2K x 8
Voltage - Supply (vcc/vdd)
4.5 V ~ 5.5 V
Data Converters
A/D 8x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
44-TQFP, 44-VQFP
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
Other names
ATMEGA3238AI
Slave Receiver Mode
1457G–AVR–09/03
After a repeated START condition (state $10), the Two-wire Serial Interface may switch
to the Master Transmitter mode by loading TWDR with SLA+W or access a new Slave
as Master Receiver or Transmitter.
Assembly code illustrating operation of the Master Receiver mode is given at the end of
the TWI section.
In the Slave Receiver mode, a number of data bytes are received from a Master Trans-
mitter (see Figure 57). To initiate the Slave Receiver mode, TWAR and TWCR must be
initialized as follows:
The upper seven bits are the address to which the Two-wire Serial Interface will respond
when addressed by a Master. If the LSB is set, the Two-wire Serial Interface will
respond to the general call address ($00), otherwise it will ignore the general call
address.
TWEN must be set to enable the Two-wire Serial Interface. The TWEA bit must be set to
enable the acknowledgement of the device’s own slave address or the general call
address. TWSTA and TWSTO must be cleared.
When TWAR and TWCR have been initialized, the Two-wire Serial Interface waits until
it is addressed by its own slave address (or the general call address if enabled) followed
by the Data Direction bit which must be “0” (write) for the Two-wire Serial Interface to
operate in the Slave Receiver mode. After its own slave address and the write bit have
been received, the Two-wire Serial Interface Interrupt Flag is set and a valid status code
can be read from TWSR. The status code is used to determine the appropriate software
action. The appropriate action to be taken for each status code is detailed in Table 42.
The Slave Receiver mode may also be entered if arbitration is lost while the Two-wire
Serial Interface is in the Master mode (see states $68 and $78).
If the TWEA bit is reset during a transfer, the Two-wire Serial Interface will return a “Not
Acknowledge” (“1”) to SDA after the next received data byte. While TWEA is reset, the
Two-wire Serial Interface does not respond to its own slave address. However, the Two-
wire Serial Bus is still monitored and address recognition may resume at any time by
setting TWEA. This implies that the TWEA bit may be used to temporarily isolate the
Two-wire Serial Interface from the Two-wire Serial Bus.
In ADC Noise Reduction mode, Power-down mode, and Power-save mode, the clock
system to the Two-wire Serial Interface is turned off. If the Slave Receive mode is
enabled, the interface can still acknowledge a general call and its own slave address by
using the Two-wire Serial Bus clock as a clock source. The part will then wake up from
sleep and the Two-wire Serial Interface will hold the SCL clock will low during the wake
up and until the TWINT Flag is cleared.
Note that the Two-wire Serial Interface Data Register – TWDR does not reflect the last
byte present on the bus when waking up from these sleep modes.
Assembly code illustrating operation of the Slave Receiver mode is given at the end of
the TWI section.
TWAR
Value
TWCR
Value
TWA6
TWINT
0
TWA5
TWEA
1
TWA4
Device’s Own Slave Address
TWSTA
0
TWA3
TWSTO
0
TWA2
TWWC
0
ATmega323(L)
TWEN
TWA1
1
TWA0
0
TWGCE
TWIE
X
109

Related parts for ATMEGA323-8AI