Transaction Diagram Symbols
S
Sr
A
A
R
W
P
START condition
repeated START condition
STOP condition
Master driving bus
Slave driving bus
Either Master or Slave driving bus
Acknowledge (ACK)
Not Acknowledge (NACK)
Master Read
Master Write
Bus Driver
Special Bus Conditions
Data Package Direction
Acknowledge
'1'
'0'
'0'
'1'
34.6.2. Basic Operation
34.6.2.1. Initialization
The following registers are enable-protected, meaning they can be written only when the I
2
C interface is
disabled (CTRLA.ENABLE is ‘0’):
•
Control A register (CTRLA), except Enable (CTRLA.ENABLE) and Software Reset
(CTRLA.SWRST) bits
•
Control B register (CTRLB), except Acknowledge Action (CTRLB.ACKACT) and Command
(CTRLB.CMD) bits
•
Baud register (BAUD)
•
Address register (ADDR) in slave operation.
When the I
2
C is enabled or is being enabled (CTRLA.ENABLE=1), writing to these registers will be
discarded. If the I
2
C is being disabled, writing to these registers will be completed after the disabling.
Enable-protection is denoted by the "Enable-Protection" property in the register description.
Before the I
2
C is enabled it must be configured as outlined by the following steps:
1.
Select I
2
C Master or Slave mode by writing 0x4 or 0x5 to the Operating Mode bits in the CTRLA
register (CTRLA.MODE).
2.
If desired, select the SDA Hold Time value in the CTRLA register (CTRLA.SDAHOLD).
3.
If desired, enable smart operation by setting the Smart Mode Enable bit in the CTRLB register
(CTRLB.SMEN).
4.
If desired, enable SCL low time-out by setting the SCL Low Time-Out bit in the Control A register
(CTRLA.LOWTOUT).
5.
In Master mode:
5.1.
Select the inactive bus time-out in the Inactive Time-Out bit group in the CTRLA register
(CTRLA.INACTOUT).
5.2.
Write the Baud Rate register (BAUD) to generate the desired baud rate.
In Slave mode:
Atmel SAM L22G / L22J / L22N [DATASHEET]
Atmel-42402E-SAM L22G / L22J / L22N_Datasheet_Complete-07/2016
682