500
CY8C28xxx PSoC Programmable System-on-Chip TRM, Document No. 001-52594 Rev. *G
I
2
C
28.3.3
I2Cx_SCR Register
The I
2
C 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 I
2
C transfer, and control bits, for determining the
actions for the next byte transfer. At the end of each byte
transfer, the I
2
C hardware interrupts the M8C microcon-
troller and stalls the I
2
C 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 will continue.
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 I
2
C bus traffic. According to the I
2
C spec-
ification, all compatible devices must reset their interface on
a received Start or Stop. This is a natural thing to do in Slave
mode, because a Start will initiate an address reception and
a Stop will idle the slave. In the case of a master, this event
will force the master to release the bus and idle. However,
because 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,xxh
Bus Error
Lost Arb
Stop
Status
ACK
Address
Transmit
LRB
Byte
Complete
# : 00
LEGEND
# Access is bit specific. Refer to
for detailed bit descriptions.
Xx An “x” in the address field indicates that there are multiple instances of the register. For an expanded address listing of these registers,
refer to the
“System Resources Register Summary” on page 462
Note
2nd I
2
C block in CY8C28x03, CY8C28x23, CY8C28x43, and CY8C28x45 devices only.
Table 28-5. 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 will automatically clear 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 = NAK 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 will automatically clear 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 ACKed by the
receiver.
1 = Last transmitted byte was NAKed by the
receiver.
Any Start detect will automatically clear this bit.
Master/
Slave
0
RC
Byte Complete
Transmit Mode:
1 = 8 bits of data have been transmitted and an
ACK or NAK has been received.
Receive Mode:
1 = 8 bits of data have been received.
Any Start detect will automatically clear this bit.
Master/
Slave
Summary of Contents for CY8C28 series
Page 65: ...64 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G RAM Paging ...
Page 125: ...124 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G ...
Page 311: ...310 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G IDAC_CR0 1 FDh ...
Page 317: ...316 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G ...
Page 393: ...392 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G ...
Page 477: ...476 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G Digital Clocks ...
Page 561: ...560 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G ...