Document # 001-20559 Rev. *D
297
I2C
28.2.2
Master Operation
To prepare for a Master mode transaction, the PSoC device
determines if the bus is free. This is done by polling the Bus-
Busy status. If busy, interrupts are enabled to detect a stop
condition. Once it is determined that the bus is available,
firmware writes the address byte into the I2C_DR register
and sets the Start Gen bit in the I2C_MSCR register.
If the slave sub-unit is not enabled, the block is in Master
Only mode. In this mode, the unit does not generate inter-
rupts or stall the I2C bus on externally generated start condi-
tions.
In a multi-master environment there are two additional out-
comes possible:
1. The PSoC device is too late to reserve the bus as a
master, and another master has generated a start and
sent an Address/RW byte. In this case, the unit as a
master fails to generate a start and is forced into Slave
mode. The start is pending and eventually occurs at a
later time when the bus becomes free.
When the interrupt occurs in Slave mode, the PSoC
device determines that the Start command was unsuc-
cessful by reading the I2C_MSCR register Start bit,
which is reset on successful start from this unit as mas-
ter. If this bit is still a ‘1’ on the Start/Address interrupt, it
means that the unit is operating in Slave mode. In this
case, the data register has the master’s address data.
2. If another master starts a transmission at the same time
as this unit, arbitration occurs. If this unit loses the arbi-
tration, the LostArb status bit is set. In this case, the
block releases the bus and switches to slave operation.
When the Start/Address interrupt occurs, the data regis-
ter has the winning master’s address data.
is a graphical representation of a typical data
transfer from the master perspective.
Figure 28-3. Master Operation
1
7
8
1
7
8
9
START
7-Bit Address
R/W
8-Bit Data
ACK/
NACK
STOP
A Start/Address compete
interrupt is generated.
The SCL line is held low.
1
7
8
8-Bit Data
STOP
SHIFTER
M8C writes a byte to
transmit I2C_DR
register.
9
SHIFTER
R
ea
d
(R
X)
W
rite
(T
X
)
M8C issues a
command to the
I2C_SCR register.
Master Transmitter/Receiver
ACK/
NACK
M8C issues TRANSMIT
command to the
I2C_SCR register.
M8C issues ACK/
NACK command to
the I2C_SCR
register.
M8C reads the
received byte from
I2C_DR register.
ACK = Slave
says OK to
receive more.
NACK =
Slave says no
more.
NACK = M8C
master indicates
end-of-data
ACK = M8C
master wants
more
SHIFTER
M8C writes address
byte to the I2C_DR
register.
M8C issues
Generate
START
command to
I2C_MCR.
An interrupt is generated
on completed reception
of the byte. The SCL line
is held low.
M8C issues STOP
command
Master wants
to send more
bytes.
An interrupt is generated
on completion of the byte
+ ACK/NACK. The SCL
line is held low.
9
ACK
Содержание PSoC CY8C23533
Страница 4: ...Contents Overview 4 Document 001 20559 Rev D Section G Glossary 385 Index 401 ...
Страница 16: ...Contents Overview 16 Document 001 20559 Rev D ...
Страница 24: ...24 Document 001 20559 Rev D Section A Overview ...
Страница 30: ...30 Document 001 20559 Rev D Pin Information ...
Страница 54: ...54 Document 001 20559 Rev D Supervisory ROM SROM ...
Страница 60: ...60 Document 001 20559 Rev D RAM Paging ...
Страница 68: ...68 Document 001 20559 Rev D Interrupt Controller ...
Страница 76: ...12 Document 001 20559 Rev D General Purpose IO GPIO ...
Страница 82: ...18 Document 001 20559 Rev D Internal Main Oscillator IMO ...
Страница 84: ...20 Document 001 20559 Rev D Internal Low Speed Oscillator ILO ...
Страница 90: ...26 Document 001 20559 Rev D External Crystal Oscillator ECO ...
Страница 94: ...30 Document 001 20559 Rev D Phase Locked Loop PLL ...
Страница 106: ...42 Document 001 20559 Rev D Sleep and Watchdog ...
Страница 228: ...164 Document 001 20559 Rev D Section D Digital System ...
Страница 234: ...170 Document 001 20559 Rev D Array Digital Interconnect ADI ...
Страница 278: ...214 Document 001 20559 Rev D Digital Blocks ...
Страница 296: ...232 Document 001 20559 Rev D Analog Interface ...
Страница 304: ...240 Document 001 20559 Rev D Analog Array ...
Страница 308: ...244 Document 001 20559 Rev D Analog Input Configuration ...
Страница 312: ...248 Document 001 20559 Rev D Analog Reference ...
Страница 338: ...274 Document 001 20559 Rev D Section F System Resources ...
Страница 354: ...290 Document 001 20559 Rev D Multiply Accumulate MAC ...
Страница 374: ...310 Document 001 20559 Rev D I2C ...
Страница 400: ...336 Document 001 20559 Rev D Section G Glossary ...