Specifications
112
3706C–MICRO–2/11
AT89LP3240/6440
18.4 Register Overview
Table 18-1. TWCR – Two-Wire Control Register
TWCR Address = AAH Reset Value = X000 00XXB
Not Bit Addressable
–TWENSTA STO TWIF AA – –
Bit76543210
Symbol Function
TWEN Two-wire Serial Interface Enable. Set to enable the TWI. Clear to disable the TWI.
STA Start Flag. Set to send a START condition on the bus. Must be cleared by software.
STO Stop Flag. Set to send a STOP condition on the bus. Cleared automatically by hardware when the STOP occur
s.
TWIF
Two-wire Interface Interrupt Flag. Set by hardware when the TWI requests an interrupt. TWIF must be cleared by
software. While TWIF is set, the SCL low period is stretched. Note that clearing this flag starts the operation of the TWI,
so all accesses to the other TWI registers (TWAR, TWSR and TWDR) must be complete before clearing this flag.
AA
Assert Acknowledge Fla
g. Clear in master and slave receiver modes, to force a not acknowledge (high level on SDA).
Clear to disable SLA or GCA recognition. Set to recognize SLA or GCA (if GC set) for entering slave receiver or
transmitter modes. Set in master and slave receiver modes, to force an acknowledge (low level on SDA). This bit has no
effect when in master transmitter mode. By clearing AA to zero, the device can be virtually disconnected from the Two-
wire Serial Bus temporarily. Address recognition can then be resumed
by setting the AA bit to one again.
Table 18-2. TWSR – Two-Wire Status Register
TWSR Address = ABH Reset Value = 1111 1000B
Not Bit Addressable
TWS7TWS6TWS5TWS4TWS3000
Bit76543210
Symbol Function
TWS
7-0
Two-wire Interface Status. The current status code of the TWI logic and serial bus. See Table 18-6 through Table 18-10
for a description of the status codes. Note that the three least significant bits always read as zero. The Status code is
valid only while TWIF remains set.
Table 18-3. TWAR – Two-Wire Address Register
TWAR Address = ACH Reset Value = 1111 1110B
Not Bit Addressable
TWA6 TWA5 TWA4 TWA3 TWA2 TWA1 TWA0 GC
Bit76543210
Symbol Function
TWA
6-0
Two-wire Interface Slave Address. The TWI will only respond to slave addresses that match this 7-bit address.
GC
General Call Enable. Set to enable General Call address (00h) recognition. Clear to disable General Call address
recognition.