AT89LP51ED2-20AAU Atmel, AT89LP51ED2-20AAU Datasheet - Page 145

no-image

AT89LP51ED2-20AAU

Manufacturer Part Number
AT89LP51ED2-20AAU
Description
8-bit Microcontrollers - MCU 64KB 20MHz 2.4V-5.5V
Manufacturer
Atmel
Datasheet

Specifications of AT89LP51ED2-20AAU

Rohs
yes
Core
8051
Processor Series
AT89x
Data Bus Width
8 bit
Maximum Clock Frequency
20 MHz
Program Memory Size
64 KB
Data Ram Size
256 B
On-chip Adc
Yes
Operating Supply Voltage
2.4 V to 5.5 V
Operating Temperature Range
- 40 C to + 85 C
Package / Case
LQFP-44
Mounting Style
SMD/SMT
Data Rom Size
4 KB
Interface Type
2-Wire, SPI, UART
Number Of Programmable I/os
36
Number Of Timers
3
Program Memory Type
Flash
Factory Pack Quantity
160

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
AT89LP51ED2-20AAU
Manufacturer:
Atmel
Quantity:
10 000
Figure 19-10. Interfacing the Application to the TWI in a Typical Transmission
3714A–MICRO–7/11
TWI bus
1. Application writes
to SSCON to initiate
transmission of
START
START condition sent
Status code indicates
2. SI set.
START
3. Check SSCS to see if START was
sent. Application loads SLA+W into
SSDAT, and loads appropriate control
signals into SSCON, making sure that
SI is written to zero and
STA is written to zero.
interrupt request. If the TWE bit is cleared, the application must poll the SI flag in order to detect
actions on the TWI bus.
When the SI flag is asserted, the TWI has finished an operation and awaits application
response. In this case, the TWI Status Register (SSCS) contains a value indicating the current
state of the TWI bus. The application software can then decide how the TWI should behave in
the next TWI bus cycle by manipulating the SSCON and SSDAT registers.
Figure 19-10
this example, a Master wishes to transmit a single data byte to a Slave. This description is quite
abstract, a more detailed explanation follows later in this section. A simple code example imple-
menting the desired behavior is also presented.
1. The first step in a TWI transmission is to transmit a START condition. This is done by
2. When the START condition has been transmitted, the SI flag in SSCON is set, and
3. The application software should now examine the value of SSCS, to make sure that the
writing a specific value into SSCON, instructing the TWI hardware to transmit a START
condition. Which value to write is described later on. However, it is important that the SI
bit is cleared in the value written. The TWI will not start any operation as long as the SI
bit in SSCON is set. Immediately after the application has cleared SI, the TWI will initi-
ate transmission of the START condition.
SSCS is updated with a status code indicating that the START condition has success-
fully been sent.
START condition was successfully transmitted. If SSCS indicates otherwise, the appli-
cation software might take some special action, like calling an error routine. Assuming
that the status code is as expected, the application must load SLA+W into SSDAT.
Remember that SSDAT is used both for address and data. After SSDAT has been
loaded with the desired SLA+W, a specific value must be written to SSCON, instructing
the TWI hardware to transmit the SLA+W present in SSDAT. Which value to write is
described later on. However, it is important that the SI bit is cleared in the value written.
The TWI will not start any operation as long as the SI bit in SSCON is set. Immediately
after the application has cleared SI, the TWI will initiate transmission of the address
packet.
SLA+W
is a simple example of how the application can interface to the TWI hardware. In
Status code indicates
4. SI set.
SLA+W sent, ACK
received
A
AT89LP51RD2/ED2/ID2 Preliminary
5. Check SSCS to see if SLA+W was
sent and ACK received.
Application loads data into SSDAT,
and loads appropriate control signals
into SSCON, making sure that
SI is written to zero.
Data
data sent, ACK received
6. SI set.
Status code indicates
A
7. Check SSCS to see if data was sent
and ACK received. Application loads
appropriate control signals to send
STOP into SSCON, making sure that
SI is written to zero.
STOP
SI set
Indicates
145

Related parts for AT89LP51ED2-20AAU