300
Document # 001-20559 Rev. *D
I2C
28.3.2
I2C_SCR Register
The I2C Status and Control Register (I2C_SCR) is used by
both master and slave to control the flow of data bytes and
to keep track of the bus state during a transfer.
This register contains status bits, for determining the state of
the current I2C transfer, and control bits, for determining the
actions for the next byte transfer. At the end of each byte
transfer, the I2C hardware interrupts the M8C microcon-
troller and stalls the I2C bus on the subsequent low of the
clock, until the PSoC device intervenes with the next com-
mand. This register may be read as many times as neces-
sary; but on a subsequent write to this register, the bus stall
is released and the current transfer continues.
There are six status bits: Byte Complete, LRB, Address,
Stop Status, Lost Arb, and Bus Error. These bits have Read/
Clear (R/C) access, which means that they are set by hard-
ware but may be cleared by a write of ‘0’ to the bit position.
Under certain conditions, status is cleared automatically by
the hardware. These cases are noted in
There are two control bits: Transmit and ACK. These bits
have RW access and may be cleared by hardware.
Bit 7: Bus Error.
The Bus Error status detects misplaced
start or stop conditions on the bus. These may be due to
noise, rogue devices, or other devices that are not yet syn-
chronized with the I2C bus traffic. According to the I2C
specification, all compatible devices must reset their inter-
face on a received start or stop. This is a natural thing to do
in Slave mode, because a start initiates an address recep-
tion and a stop idles the slave. In the case of a master, this
event forces the master to release the bus and idle. How-
ever, since a master does not respond to external start or
stop conditions, an immediate interrupt on this event allows
the master to continue to keep track of the bus state.
A bus error is defined as follows. A start is only valid if the
block is idle (master or slave) or a slave receiver is ready to
receive the first bit of a new byte after an ACK. Any other
timing for a start condition causes the Bus Error bit to be set.
A stop is only valid if the block is idle or a slave receiver is
ready to receive the first bit of a new byte after an ACK. Any
other timing for a stop condition causes the Bus Error bit to
be set.
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Access
0,D7h
Bus Error
Lost Arb
Stop
Status
ACK
Address
Transmit
LRB
Byte
Complete
# : 00
LEGEND
# Access is bit specific. Refer to
for detailed bit descriptions.
Table 28-4. I2C_SCR Status and Control Register
Bit
Access
Description
Mode
7
RC
Bus Error
1 = A misplaced start or stop condition was
detected.
This status bit must be cleared by firmware with
a write of ‘0’ to the bit position. It is never
cleared by the hardware.
Master
Only
6
RC
Lost Arb
1 = Lost Arbitration.
This bit is set immediately on lost arbitration;
however, it does not cause an interrupt. This
status may be checked after the following Byte
Complete interrupt.
Any start detect automatically clears this bit.
Master
Only
5
RC
Stop Status
1 = A stop condition was detected.
This status bit must be cleared by firmware with
a write of ‘0’ to the bit position. It is never
cleared by the hardware.
Master/
Slave
4
RW
ACK: Acknowledge Out
0 = NACK the last received byte.
1 = ACK the last received byte.
This bit is automatically cleared by hardware
on the following Byte Complete event.
Master/
Slave
3
RC
Address
1 = The transmitted or received byte is an
address.
This status bit must be cleared by firmware with
a write of ‘0’ to the bit position.
Master/
Slave
2
RW
Transmit
0 = Receive Mode.
1 = Transmit Mode.
This bit is set by firmware to define the direc-
tion of the byte transfer.
Any start detect automatically clears this bit.
Master/
Slave
1
RC
LRB: Last Received Bit
The value of the ninth bit in a transmit
sequence, which is the acknowledge bit from
the receiver.
0 = Last transmitted byte was ACK’ed by the
receiver.
1 = Last transmitted byte was NACK’ed by the
receiver.
Any start detect automatically clears this bit.
Master/
Slave
0
RC
Byte Complete
Transmit Mode:
1 = 8 bits of data have been transmitted and an
ACK or NACK has been received.
Receive Mode:
1 = 8 bits of data have been received.
Any start detect automatically clears this bit.
Master/
Slave
Summary of Contents for PSoC CY8C23533
Page 4: ...Contents Overview 4 Document 001 20559 Rev D Section G Glossary 385 Index 401 ...
Page 16: ...Contents Overview 16 Document 001 20559 Rev D ...
Page 24: ...24 Document 001 20559 Rev D Section A Overview ...
Page 30: ...30 Document 001 20559 Rev D Pin Information ...
Page 54: ...54 Document 001 20559 Rev D Supervisory ROM SROM ...
Page 60: ...60 Document 001 20559 Rev D RAM Paging ...
Page 68: ...68 Document 001 20559 Rev D Interrupt Controller ...
Page 76: ...12 Document 001 20559 Rev D General Purpose IO GPIO ...
Page 82: ...18 Document 001 20559 Rev D Internal Main Oscillator IMO ...
Page 84: ...20 Document 001 20559 Rev D Internal Low Speed Oscillator ILO ...
Page 90: ...26 Document 001 20559 Rev D External Crystal Oscillator ECO ...
Page 94: ...30 Document 001 20559 Rev D Phase Locked Loop PLL ...
Page 106: ...42 Document 001 20559 Rev D Sleep and Watchdog ...
Page 228: ...164 Document 001 20559 Rev D Section D Digital System ...
Page 234: ...170 Document 001 20559 Rev D Array Digital Interconnect ADI ...
Page 278: ...214 Document 001 20559 Rev D Digital Blocks ...
Page 296: ...232 Document 001 20559 Rev D Analog Interface ...
Page 304: ...240 Document 001 20559 Rev D Analog Array ...
Page 308: ...244 Document 001 20559 Rev D Analog Input Configuration ...
Page 312: ...248 Document 001 20559 Rev D Analog Reference ...
Page 338: ...274 Document 001 20559 Rev D Section F System Resources ...
Page 354: ...290 Document 001 20559 Rev D Multiply Accumulate MAC ...
Page 374: ...310 Document 001 20559 Rev D I2C ...
Page 400: ...336 Document 001 20559 Rev D Section G Glossary ...