Product Specs

Table Of Contents
34 TWIS I
2
C compatible two-wire interface
slave with EasyDMA
Page
324
Figure 91: A repeated start sequence, where the TWI master writes two bytes followed by reading
four bytes from the slave
34.6 Terminating an ongoing TWI transaction
In some situations, e.g. if the external TWI master is not responding correctly, it may be required to terminate
an ongoing transaction.
This can be achieved by triggering the STOP task. In this situation a STOPPED event will be generated
when the TWI has stopped independent of whether or not a STOP condition has been generated on the TWI
bus. The TWI slave will release the bus when it has stopped and go back to its IDLE state.
34.7 Low power
When putting the system in low power and the peripheral is not needed, lowest possible power consumption
is achieved by stopping, and then disabling the peripheral.
The STOP task may not be always needed (the peripheral might already be stopped), but if it is sent,
software shall wait until the STOPPED event was received as a response before disabling the peripheral
through the ENABLE register.
34.8 Slave mode pin configuration
The SCL and SDA signals associated with the TWI slave are mapped to physical pins according to the
configuration specified in the PSEL.SCL and PSEL.SDA registers respectively.
The PSEL.SCL and PSEL.SDA registers and their configurations are only used as long as the TWI slave is
enabled, and retained only as long as the device is in ON mode. When the peripheral is disabled, the pins
will behave as regular GPIOs, and use the configuration in their respective OUT bit field and PIN_CNF[n]
register. PSEL.SCL and PSEL.SDA must only be configured when the TWI slave is disabled.
To secure correct signal levels on the pins used by the TWI slave when the system is in OFF mode, and
when the TWI slave is disabled, these pins must be configured in the GPIO peripheral as described in Table
77: GPIO configuration before enabling peripheral on page 324.
Only one peripheral can be assigned to drive a particular GPIO pin at a time. Failing to do so may result in
unpredictable behavior.
Table 77: GPIO configuration before enabling peripheral
TWI slave signal
TWI slave pin
Direction
Output value
Drive strength
SCL
As specified in PSEL.SCL
Input
Not applicable
S0D1
SDA
As specified in PSEL.SDA
Input
Not applicable
S0D1
ADDR
3
2
1
0
1
2
3
ADDR
1
0
STOP
NACK
ACK
ACK
ACK
ACK
READ
RESTART
ACK
ACK
ACK
WRITE
START
CPU Lifeline
TWI
RXD.MAXCNT = 2
RXD.PTR = 0x20000000
PREPARERX
WRITE
RXSTARTED
READ
SUSPEND
TXD.PTR = 0x20000010
TXD.MAXCNT = 4
PREPARETX
RESUME
TXSTARTED
STOPPED