Cypress CY7C65113C USB Non-control Endpoint Mode Registers, USB Endpoint Counter Registers, Stall

Page 36

CY7C65113C

Bits[6:0] of the endpoint 0 mode register are locked from CPU write operations whenever the SIE has updated one of these bits, which the SIE does only at the end of the token phase of a transaction (SETUP... Data... ACK, OUT... Data... ACK, or IN... Data...

ACK). The CPU can unlock these bits by doing a subsequent read of this register. Only endpoint 0 mode registers are locked when updated. The locking mechanism does not apply to the mode registers of other endpoints.

Because of these hardware locking features, firmware must perform an IORD after an IOWR to an endpoint 0 register. This verifies that the contents have changed as desired, and that the SIE has not updated these values.

While the SETUP bit is set, the CPU cannot write to the endpoint zero FIFOs. This prevents firmware from overwriting an incoming SETUP transaction before firmware has a chance to read the SETUP data. Refer to Table 17-1for the appropriate endpoint zero memory locations.

The Mode bits (bits [3:0]) control how the endpoint responds to USB bus traffic. The mode bit encoding is shown in Table 18-1. Additional information on the mode bits can be found in Table 18-2and Table 18-3.[5]

17.4USB Non-control Endpoint Mode Registers

The format of the non-control endpoint mode registers is shown in Figure 17-3.

USB Non-control Device Endpoint Mode

 

 

Addresses 0x14, 0x16, 0x44

Bit #

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

Bit Name

STALL

Reserved

Reserved

ACK

Mode Bit 3

Mode Bit 2

Mode Bit 1

Mode Bit 0

 

 

 

 

 

 

 

 

 

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 17-3. USB Non-control Device Endpoint Mode Registers

Bits[3..0] : Mode.

These sets the mode which control how the control endpoint responds to traffic. The mode bit encoding is shown in Table 18-1.

Bit 4 : ACK.

This bit is set whenever the SIE engages in a transaction to the register’s endpoint that completes with an ACK packet. Bits[6..5]: Reserved.

Must be written zero during register writes. Bit 7: STALL.

If this STALL is set, the SIE stalls an OUT packet if the mode bits are set to ACK-IN, and the SIE stalls an IN packet if the mode bits are set to ACK-OUT. For all other modes, the STALL bit must be a LOW.

17.5USB Endpoint Counter Registers

There are five Endpoint Counter registers, with identical formats for both control and non-control endpoints. These registers contain byte count information for USB transactions, as well as bits for data packet status. The format of these registers is shown in Figure 17-4.

USB Endpoint Counter

 

 

 

 

Addresses 0x11, 0x13, 0x15, 0x41, 0x43

Bit #

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

Bit Name

Data 0/1

Data Valid

Byte Count

Byte Count

Byte Count

Byte Count

Byte Count

Byte Count

 

Toggle

 

Bit 5

Bit 4

Bit 3

Bit 2

Bit 1

Bit 0

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 17-4. USB Endpoint Counter Registers

Bits[5..0]: Byte Count.

These counter bits indicate the number of data bytes in a transaction. For IN transactions, firmware loads the count with the number of bytes to be transmitted to the host from the endpoint FIFO. Valid values are 0 to 32, inclusive. For OUT or SETUP transactions, the count is updated by hardware to the number of data bytes received, plus two for the CRC bytes. Valid values are 2 to 34, inclusive.

Note:

5.The SIE offers an “Ack out – Status in” mode and not an “Ack out – Nak in” mode. Therefore, if following the status stage of a Control Write transfer a USB host were to immediately start the next transfer, the new Setup packet could override the data payload of the data stage of the previous Control Write.

Document #: 38-08002 Rev. *D

Page 36 of 49

[+] Feedback

Image 36
Contents USB Hub with Microcontroller Cypress Semiconductor CorporationCY7C65113C 16.0 17.018.0 19.0List of Tables Features Functional Overview GpioI2C USBLogic Block Diagram Pin Configurations Product Summary TablesPin Assignments Top View CY7C65113C 28-pin SoicI/O Register Summary Instruction Set Summary Instruction Set SummaryMnemonic Operand Opcode CyclesProgramming Model 14-bit Program CounterProgram Memory begins here KB -32 Prom ends here CY7C65113C8-bit Accumulator a 8-bit Temporary Register8-bit Program Stack Pointer PSP 8-bit Data Stack Pointer DSP Address ModesMOV A, Dspinit Power-on Reset ClockingXtalout XtalinSuspend Mode Watchdog ResetGeneral-purpose I/O Ports Port 0,1 Low IsinkPort 0 Data Address Gpio Configuration Port Gpio Configuration Address10.0 12-bit Free-Running Timer Gpio Interrupt Enable PortsPort 0 Interrupt Enable 11.0 I2C Configuration Register Timer LSB AddressTimer MSB Address 2C Configuration Address12.0 I2C-compatible Controller I2C Data Address2C 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 Controller Function Diagram Interrupt VectorsUSB Bus Reset Interrupt Timer InterruptInterrupt Latency USB Endpoint Interrupts USB Hub InterruptGpio Interrupt 14.8 I2C InterruptUSB Overview USB Serial Interface Engine SIEUSB Enumeration ACK/NAK/STALLConnecting/Disconnecting a USB Device USB HubHub Ports Connect Status Hub Ports Enable Register Address Hub Ports Enable RegisterEnabling/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 Downstream Port Suspend and Resume Hub Ports DataHub Ports Data Register Hub Ports Suspend Address 0x4DUSB Upstream Port Status and Control Hub Ports Resume Address 0x4EUSB Status and Control Address 0x1F USB Serial Interface Engine Operation USB Device AddressesUSB 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 Endpoint Mode Registers USB Non-control Device Endpoint ModeUSB Endpoint Counter Registers StallEndpoint Mode/Count Registers Update and Locking Mechanism SetupUpdate Update only if Fifo is Written DataSet Data SetUSB Mode Tables Setup OUTDtog Dval Count Dtog Dval Count Endpoint Register Summary PortsLOW Sample Schematic Absolute Maximum RatingsElectrical Characteristics Parameter Description Conditions Min Max Unit GeneralUSB Interface Upstream/Downstream PortSwitching Characteristics fOSC = 6.0 MHz USB Full-speed Signaling10Timer Signals Parameter Description Min Max Unit Clock SourcePackage Diagram Ordering InformationOrdering Code Prom Size Package Type Operating Range CY7C65113C-SXCTIssue Date Orig. Description of Change Document HistoryREV ECN no