Cypress CY7C65113C manual 12.0 I2C-compatible Controller, I2C Data Address, Ack, Arb

Page 21

CY7C65113C

12.0I2C-compatible Controller

The I2C-compatible block provides a versatile two-wire communication with external devices, supporting master, slave, and multi-master modes of operation. The I2C-compatible block functions by handling the low-level signaling in hardware, and issuing interrupts as needed to allow firmware to take appropriate action during transactions. While waiting for firmware response, the hardware keeps the I2C-compatible bus idle if necessary.

The I2C-compatible block generates an interrupt to the microcontroller at the end of each received or transmitted byte, when a stop bit is detected by the slave when in receive mode, or when arbitration is lost. Details of the interrupt responses are given in Section 14.8.

The I2C-compatible interface consists of two registers, an I2C Data Register (Figure 12-1) and an I2C Status and Control Register (Figure 12-2). The I2C Data Register is implemented as separate read and write registers. Generally, the I2C Status and Control Register should only be monitored after the I2C interrupt, as all bits are valid at that time. Polling this register at other times could read misleading bit status if a transaction is underway.

The I2C clock (SCL) is connected to bit 0 of GPIO port 1, and the I2C SDA data is connected to bit 1 GPIO port 1. The port selection is determined by settings in the I2C Port Configuration Register (Section 11.0). Once the I2C-compatible functionality is enabled by setting the I2C Enable bit of the I2C Status and Control Register (bit 0, Figure 12-2), the two LSB ([1:0]) of the corresponding GPIO port is placed in Open Drain mode, regardless of the settings of the GPIO Configuration Register. In Open Drain mode, the GPIO pin outputs LOW if the pin’s Data Register is ‘0’, and the pin is in Hi-Z mode if the pin’s Data Register is ‘1’. The electrical characteristics of the I2C-compatible interface is the same as that of GPIO port 1. Note that the IOL (max) is 2 mA @ VOL = 2.0V for port 1.

All control of the I2C clock (SCL) and data (SDA) lines is performed by the I2C-compatible block.

I2C Data

 

 

 

 

 

 

 

Address 0x29

Bit #

7

6

5

4

3

2

1

 

0

 

 

 

 

 

 

 

 

 

 

Bit Name

I2C Data 7

I2C Data 6

I2C Data 5

I2C Data 4

I2C Data 3

I2C Data 2

I2C Data 1

 

I2C Data 0

Read/Write

R/W

R/W

R/W

R/W

R/W

R/W

R/W

 

R/W

 

 

 

 

 

 

 

 

 

 

Reset

X

X

X

X

X

X

X

 

X

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 12-1. I2C Data Register

 

 

 

 

Bits [7..0]: I2C Data

Contains the 8-bit data on the I2C Bus.

I2C Status and Control

 

 

 

 

 

 

Address 0x28

Bit #

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

Bit Name

MSTR Mode

Continue/Bu

Xmit Mode

ACK

Addr

ARB

Received

I2C Enable

 

 

sy

 

 

 

Lost/Restart

Stop

 

Read/Write

R/W

R/W

R/W

R/W

R/W

R/W

R/W

R/W

 

 

 

 

 

 

 

 

 

Reset

0

0

0

0

0

0

0

0

Figure 12-2. I2C Status and Control Register

The I2C Status and Control register bits are defined in Table 12-1, with a more detailed description following.

Table 12-1. I2C Status and Control Register Bit Definitions

 

Bit

Name

Description

 

 

0

I2C Enable

When set to ‘1’, the I2C-compatible function is enabled. When cleared, I2C GPIO pins operate

 

 

 

normally.

 

 

1

Received Stop

Reads 1 only in slave receive mode, when I2C Stop bit detected (unless firmware did not ACK the

 

 

 

last transaction).

 

 

2

ARB Lost/Restart

Reads 1 to indicate master has lost arbitration. Reads 0 otherwise.

 

 

 

 

Write to 1 in master mode to perform a restart sequence (also set Continue bit).

 

 

3

Addr

Reads 1 during first byte after start/restart in slave mode, or if master loses arbitration.

 

 

 

Reads 0 otherwise. This bit should always be written as 0.

 

 

4

ACK

In receive mode, write 1 to generate ACK, 0 for no ACK.

 

 

 

 

In transmit mode, reads 1 if ACK was received, 0 if no ACK received.

 

 

5

Xmit Mode

Write to 1 for transmit mode, 0 for receive mode.

 

 

 

 

 

 

Document #: 38-08002 Rev. *D

Page 21 of 49

[+] Feedback

Image 21
Contents Cypress Semiconductor Corporation USB Hub with MicrocontrollerCY7C65113C 17.0 16.018.0 19.0List of Tables Features Gpio Functional OverviewI2C USBLogic Block Diagram Product Summary Tables Pin ConfigurationsPin Assignments Top View CY7C65113C 28-pin SoicI/O Register Summary Instruction Set Summary Instruction Set SummaryMnemonic Operand Opcode Cycles14-bit Program Counter Programming ModelKB -32 Prom ends here CY7C65113C Program Memory begins here8-bit Accumulator a 8-bit Temporary Register8-bit Program Stack Pointer PSP 8-bit Data Stack Pointer DSP Address ModesMOV A, Dspinit Clocking Power-on ResetXtalout XtalinWatchdog Reset Suspend ModeGeneral-purpose I/O Ports Port 0,1 Low IsinkPort 0 Data Address Gpio Configuration Address Gpio Configuration Port10.0 12-bit Free-Running Timer Gpio Interrupt Enable PortsPort 0 Interrupt Enable Timer LSB Address 11.0 I2C Configuration RegisterTimer MSB Address 2C Configuration AddressI2C Data Address 12.0 I2C-compatible Controller2C Status and Control Address ACKContinue/Busy Write 1 to indicate ready for next transaction Processor Status and Control Register Processor Status and Control Address 0xFFIRQ Global Interrupt Enable Register Address USB Endpoint Interrupt Enable AddressInterrupts Interrupt Vectors Interrupt Controller Function DiagramUSB Bus Reset Interrupt Timer InterruptInterrupt Latency USB Hub Interrupt USB Endpoint InterruptsGpio Interrupt 14.8 I2C InterruptUSB Serial Interface Engine SIE USB OverviewUSB Enumeration ACK/NAK/STALLConnecting/Disconnecting a USB Device USB HubHub Ports Connect Status Hub Ports Enable Register Hub Ports Enable Register AddressEnabling/Disabling a USB Device Hub Downstream Ports Status and ControlHub Downstream Ports Control Register Address 0x4B Hub Ports Force LowHub Ports SE0 Status Address 0x4F Hub Ports Data Downstream Port Suspend and ResumeHub Ports Data Register Hub Ports Suspend Address 0x4DUSB Upstream Port Status and Control Hub Ports Resume Address 0x4EUSB Status and Control Address 0x1F USB Device Addresses USB Serial Interface Engine OperationUSB Device Endpoints USB Device Address Device A, B Addresses 0x10A and 0x40BUSB Control Endpoint Mode Registers USB Device Endpoint Zero Mode A0, B0Size Label Start Address USB Non-control Device Endpoint Mode USB Non-control Endpoint Mode RegistersUSB Endpoint Counter Registers StallEndpoint Mode/Count Registers Update and Locking Mechanism SetupUpdate Data Update only if Fifo is WrittenSet Data SetSetup OUT USB Mode TablesDtog Dval Count Dtog Dval Count Endpoint Ports Register SummaryLOW Absolute Maximum Ratings Sample SchematicParameter Description Conditions Min Max Unit General Electrical CharacteristicsUSB Interface Upstream/Downstream PortUSB Full-speed Signaling10 Switching Characteristics fOSC = 6.0 MHzTimer Signals Parameter Description Min Max Unit Clock SourceOrdering Information Package DiagramOrdering Code Prom Size Package Type Operating Range CY7C65113C-SXCTIssue Date Orig. Description of Change Document HistoryREV ECN no