Product Specs

Table Of Contents
49 TWI I
2
C compatible two-wire interface
Page
526
To generate a repeated start after a read sequence, a second start task must be triggered instead of
the STOP task, that is, STARTRX or STARTTX. This start task must be triggered before the last byte is
extracted from RXD to ensure that the TWI master sends a NACK back to the slave before generating the
repeated start condition.
49.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.
49.8 Registers
Table 125: Instances
Base address
Peripheral
Instance
Description
Configuration
0x40003000
TWI
TWI0
Two-wire interface master 0
Deprecated
0x40004000
TWI
TWI1
Two-wire interface master 1
Deprecated
Table 126: Register Overview
Register
Offset
Description
TASKS_STARTRX
0x000
Start TWI receive sequence
TASKS_STARTTX
0x008
Start TWI transmit sequence
TASKS_STOP
0x014
Stop TWI transaction
TASKS_SUSPEND
0x01C
Suspend TWI transaction
TASKS_RESUME
0x020
Resume TWI transaction
EVENTS_STOPPED
0x104
TWI stopped
EVENTS_RXDREADY
0x108
TWI RXD byte received
EVENTS_TXDSENT
0x11C
TWI TXD byte sent
EVENTS_ERROR
0x124
TWI error
EVENTS_BB
0x138
TWI byte boundary, generated before each byte that is sent or received
EVENTS_SUSPENDED
0x148
TWI entered the suspended state
SHORTS
0x200
Shortcut register
INTENSET
0x304
Enable interrupt
INTENCLR
0x308
Disable interrupt
ERRORSRC
0x4C4
Error source
ENABLE
0x500
Enable TWI
PSELSCL
0x508
Pin select for SCL
PSELSDA
0x50C
Pin select for SDA
RXD
0x518
RXD register
TXD
0x51C
TXD register
FREQUENCY
0x524
TWI frequency
ADDRESS
0x588
Address used in the TWI transfer
49.8.1 SHORTS
Address offset: 0x200
Shortcut register
Bit number
Id
Reset 0x00000000
31 30
0 0
29
0
28
0
27
0
26
0
25
0
24
0
23 22 21 20
0 0 0 0
19
0
18
0
17
0
16
0
15
0
14
0
13
0
12
0
11
0
10
0
9
0
8
0
7
0
6
0
5
0
4
0
3
0
2
0
1
B
0
0
A
0
Id RW Field
Value Id
Value
Description
A RW BB_SUSPEND Shortcut between BB event and SUSPEND task