AT89LP6440 Atmel Corporation, AT89LP6440 Datasheet - Page 115

no-image

AT89LP6440

Manufacturer Part Number
AT89LP6440
Description
Manufacturer
Atmel Corporation
Datasheet

Specifications of AT89LP6440

Flash (kbytes)
64 Kbytes
Max. Operating Frequency
20 MHz
Cpu
8051-1C
Max I/o Pins
38
Spi
1
Twi (i2c)
1
Uart
1
Adc Channels
8
Adc Resolution (bits)
10
Adc Speed (ksps)
153.8
Sram (kbytes)
4.25
Eeprom (bytes)
8192
Self Program Memory
IAP
Operating Voltage (vcc)
2.4 to 3.6
Timers
3
Isp
SPI/OCD
Watchdog
Yes

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
AT89LP6440-20AU
Manufacturer:
Cirrus
Quantity:
89
Part Number:
AT89LP6440-20AU
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
AT89LP6440-20JU
Manufacturer:
Atmel
Quantity:
103
Part Number:
AT89LP6440-20JU
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
AT89LP6440-20MU
Manufacturer:
Atmel
Quantity:
987
18.6
3706C–MICRO–2/11
Transmission Modes
Even though this example is simple, it shows the principles involved in all TWI transmissions.
These can be summarized as follows:
The TWI can operate in one of four major modes. These are named Master Transmitter (MT),
Master Receiver (MR), Slave Transmitter (ST) and Slave Receiver (SR). Several of these
modes can be used in the same application. As an example, the TWI can use MT mode to write
data into a TWI EEPROM, MR mode to read the data back from the EEPROM. If other masters
are present in the system, some of these might transmit data to the TWI, and then SR mode
would be used. It is the application software that decides which modes are legal.
The following sections describe each of these modes. Possible status codes are described
along with figures detailing data transmission in each of the modes. These figures contain the
following abbreviations:
S: START condition
Rs: REPEATED START condition
R: Read bit (high level at SDA)
W: Write bit (low level at SDA)
A: Acknowledge bit (low level at SDA)
A: Not acknowledge bit (high level at SDA)
Data: 8-bit data byte
P: STOP condition
6. When the data packet has been transmitted, the TWIF flag in TWCR is set, and TWSR
7. The application software should now examine the value of TWSR, to make sure that the
• When the TWI has finished an operation and expects application response, the TWIF flag is
• When the TWIF flag is set, the user must update all TWI registers with the value relevant for
• After all TWI Register updates and other pending application software tasks have been
set. The SCL line is pulled low until TWIF is cleared.
the next TWI bus cycle. As an example, TWDR must be loaded with the value to be
transmitted in the next bus cycle.
completed, TWCR is written. When writing TWCR, the TWIF bit should be cleared. The TWI
will then commence executing whatever operation was specified by the TWCR setting.
long as the TWIF bit in TWCR is set. Immediately after the application has cleared
TWIF, the TWI will initiate transmission of the data packet.
is updated with a status code indicating that the data packet has successfully been
sent. The status code will also reflect whether a slave acknowledged the packet or not.
data packet was successfully transmitted, and that the value of the ACK bit was as
expected. If TWSR indicates otherwise, the application software might take some spe-
cial action, like calling an error routine. Assuming that the status code is as expected,
the application must write a specific value to TWCR, instructing the TWI hardware to
transmit a STOP condition. Which value to write is described later on. However, it is
important that the TWIF bit is cleared in the value written. The TWI will not start any
operation as long as the TWIF bit in TWCR is set. Immediately after the application has
cleared TWIF, the TWI will initiate transmission of the STOP condition. Note that TWIF
is NOT set after a STOP condition has been sent.
AT89LP3240/6440
115

Related parts for AT89LP6440