5.6.1 Data (Immediate) ............................................................................................................................14
5.6.2 Direct ..............................................................................................................................................14
• Full Speed USB hub with an integrated microcontroller
• 8-bit USB optimized microcontroller
— Harvard architecture
— 6-MHz external clock source
— 12-MHz internal CPU clock
— 48-MHz internal hub clock
• Internal memory
— 256 bytes of RAM
— 8 KB of PROM
• Integrated Master/Slave I
• I/O ports
— Two GPIO ports (Port 0 to 2) capable of sinking 7 mA per pin (typical)
— Higher current drive achievable by connecting multiple GPIO pins together to drive a common output
— Each GPIO port can be configured as inputs with internal pull-ups or open drain outputs or traditional CMOS outputs
— Maskable interrupts on all I/O pins
• 12-bit free-running timer with one microsecond clock ticks
• Watchdog timer (WDT)
• Internal Power-on Reset (POR)
• USB Specification compliance
— Conforms to USB Specification, Version 1.1
— Conforms to USB HID Specification, Version 1.1
— Supports one or two device addresses with up to 5 user-configured endpoints
Up to two 8-byte control endpoints
Up to four 8-byte data endpoints
Up to two 32-byte data endpoints
— Integrated USB transceivers
— Supports four downstream USB ports
— GPIO pins can provide individual power control outputs for each downstream USB port
— GPIO pins can provide individual port over current inputs for each downstream USB port
• Improved output drivers to reduce electromagnetic interference (EMI)
• Operating voltage from 4.0V to 5.5V DC
• Operating temperature from 0° to 70° C
• Available in 28-pin SOIC (-SXC) package
• Industry-standard programmer support.
2
C-compatible Controller (100 kHz) enabled through General-purpose I/O (GPIO) pins
Document #: 38-08002 Rev. *DPage 5 of 49
CY7C65113C
2.0 Functional Overview
The CY7C65113C device is a one-time programmable 8-bit microcontroller with a built-in 12-Mbps USB hub that supports up to
four downstream ports. The microcontroller instruction set has been optimized specifically for USB operations, although the
microcontrollers can be used for a variety of non-USB embedded applications.
GPIO
The CY7C65113C has 11 GPIO pins (P0[7:0], P1[2:0]), both rated at 7 mA per pin (typical) sink current. Multiple GPIO pins can
be connected together to drive a single output for more drive current capacity.
Clock
The microcontroller uses an external 6-MHz crystal and an internal oscillator to provide a reference to an internal phase-locked
loop (PLL)-based clock generator. This technology allows the customer application to use an inexpensive 6-MHz fundamental
crystal that reduces the clock-related noise emissions (EMI). A PLL clock generator provides the 6-, 12-, and 48-MHz clock signals
for distribution within the microcontroller.
Memory
The CY7C65113C is offered with 8 KB of PROM.
Power-on Reset, Watchdog, and Free-running Timer
These parts include power-on reset logic, a Watchdog timer, and a 12-bit free-running timer. The POR logic detects when power
is applied to the device, resets the logic to a known state, and begins executing instructions at PROM address 0x0000. The
Watchdog timer is used to ensure the microcontroller recovers after a period of inactivity. The firmware may become inactive for
a variety of reasons, including errors in the code or a hardware failure such as waiting for an interrupt that never occurs.
2
I
C
The microcontroller can communicate with external electronics through the GPIO pins. An I
dates a 100-kHz serial link with an external device.
Timer
The free-running 12-bit timer clocked at 1 MHz provides two interrupt sources, 128-µs and 1.024-ms. The timer can be used to
measure the duration of an event under firmware control by reading the timer at the start of the event and after the event is
complete. The difference between the two readings indicates the duration of the event in microseconds. The upper four bits of
the timer are latched into an internal register when the firmware reads the lower eight bits. A read from the upper four bits actually
reads data from the internal register, instead of the timer. This feature eliminates the need for firmware to try to compensate if the
upper four bits increment immediately after the lower eight bits are read.
Interrupts
The microcontroller supports ten maskable interrupts in the vectored interrupt controller. Interrupt sources include the USB Bus
Reset interrupt, the 128-µs (bit 6) and 1.024-ms (bit 9) outputs from the free-running timer, five USB endpoints, the USB hub, the
GPIO ports, and the I
from LOW ‘0’ to HIGH ‘1’. The USB endpoints interrupt after the USB host has written data to the endpoint FIFO or after the USB
controller sends a packet to the USB host. The GPIO ports also have a level of masking to select which GPIO inputs can cause
a GPIO interrupt. Input transition polarity can be programmed for each GPIO port as part of the port configuration. The interrupt
polarity can be rising edge (‘0’ to ‘1’) or falling edge (‘1’ to ‘0’).
USB
The CY7C65113C includes an integrated USB Serial Interface Engine (SIE) that supports the integrated peripherals and the hub
controller function. The hardware supports up to two USB device addresses with one device address for the hub (two endpoints)
and a device address for a compound device (three endpoints). The SIE allows the USB host to communicate with the hub and
functions integrated into the microcontroller. The CY7C65113C part includes a 1:4 hub repeater with one upstream port and four
downstream ports. The USB Hub allows power management control of the downstream ports by using GPIO pins assigned by
the user firmware. The user has the option of ganging the downstream ports together with a single pair of power management
pins, or providing power management for each port with four pairs of power management pins.
2
C-compatible master mode interface. The timer bits cause an interrupt (if enabled) when the bit toggles
2
C-compatible interface accommo-
Document #: 38-08002 Rev. *DPage 6 of 49
Logic Block Diagram
CY7C65113C
6-MHz crystal
PLL
48 MHz
Clock
Divider
12 MHz
6 MHz
12-MHz
8-bit
CPU
PROM
8 KB
RAM
256 byte
12-bit
Timer
8-bit Bus
USB
SIE
Interrupt
Controller
GPIO
PORT 0
P0[0]
P0[7]
USB
Transceiver
Repeater
D+[0]
Upstream
USB Port
D–[0]
Downstream USB Ports
USB
Transceiver
USB
Transceiver
USB
Transceiver
USB
Transceiver
Power management under firmware
control using GPIO pins
D+[1]
D–[1]
D+[2]
D–[2]
D+[3]
D–[3]
D+[4]
D–[4]
Watchdog
Timer
Power-on
Reset
GPIO
PORT 1
I2C comp.
Interface
2
C-compatible interface enabled by firmware through
*I
P1[1:0]
P1[0]
P1[2]
SCLK
SDATA
Document #: 38-08002 Rev. *DPage 7 of 49
3.0 Pin Configurations
XTALOUT
XTALIN
V
REF
GND
D+[0]
D–[0]
D+[1]
D–[1]
D+[2]
D–[2]
P0[7]
P0[5]
P0[3]
P0[1]
Top View
CY7C65113C
28-pin SOIC
1
28
2
27
26
3
4
25
5
24
23
6
7
22
8
21
9
20
19
10
11
18
12
17
13
16
15
14
V
CC
P1[1]
P1[0]
P1[2]
D–[3]
D+[3]
D–[4]
D+[4]
GND
V
PP
P0[0]
P0[2]
P0[4]
P0[6]
CY7C65113C
4.0 Product Summary Tables
4.1Pin Assignments
Table 4-1. Pin Assignments
NameI/O28-pinDescription
D+[0], D–[0]I/O5, 6Upstream port, USB differential data.
D+[1], D–[1]I/O7, 8Downstream Port 1, USB differential data.
D+[2], D–[2]I/O9, 10Downstream Port 2, USB differential data.
D+[3], D–[3]I/O23, 24Downstream Port 3, USB differential data.
D+[4], D–[4]I/O21, 22Downstream Port 4, USB differential data.
P0I/OP1[7:0]
11, 15, 12, 16, 13, 17, 14, 18
P1I/OP1[2:0]
25, 27, 26
XTAL
XTAL
V
PP
V
CC
IN
OUT
IN26-MHz crystal or external clock input.
OUT16-MHz crystal out.
19Programming voltage supply, tie to ground during normal operation.
28Voltage supply.
GND4, 20Ground.
V
REF
IN3External 3.3V supply voltage for the downstream differential data output
GPIO Port 0 capable of sinking 7 mA (typical).
GPIO Port 1 capable of sinking 7 mA (typical).
buffers and the D+ pull-up.
Document #: 38-08002 Rev. *DPage 8 of 49
CY7C65113C
4.2I/O Register Summary
I/O registers are accessed via the I/O Read (IORD) and I/O Write (IOWR, IOWX) instructions. IORD reads data from the selected
port into the accumulator. IOWR performs the reverse; it writes data from the accumulator to the selected port. Indexed I/O Write
(IOWX) adds the contents of X to the address in the instruction to form the port address and writes data from the accumulator to
the specified port. Specifying address 0 (e.g., IOWX 0h) means the I/O register is selected solely by the contents of X.
All undefined registers are reserved. Do not write to reserved registers as this may cause an undefined operation or increased
current consumption during operation. When writing to registers with reserved bits, the reserved bits must be written with ‘0.’
Table 4-2. I/O Register Summary
Register NameI/O AddressRead/WriteFunctionPage
Port 0 Data0x00R/WGPIO Port 0 Data 17
Port 1 Data0x01R/WGPIO Port 1 Data17
Port 0 Interrupt Enable0x04WInterrupt Enable for Pins in Port 019
Port 1 Interrupt Enable0x05WInterrupt Enable for Pins in Port 119
GPIO Configuration0x08R/WGPIO Port Configurations18
2
C Configuration0x09R/WI2C Position Configuration20
I
USB Device Address A0x10R/WUSB Device Address A34
EP A0 Counter Register0x11R/WUSB Address A, Endpoint 0 Counter 36
EP A0 Mode Register0x12R/WUSB Address A, Endpoint 0 Configuration 35
EP A1 Counter Register0x13R/WUSB Address A, Endpoint 1 Counter 36
EP A1 Mode Register0x14R/WUSB Address A, Endpoint 1 Configuration 36
EP A2 Counter Register0x15R/WUSB Address A, Endpoint 2 Counter 36
EP A2 Mode Register0x16R/WUSB Address A, Endpoint 2 Configuration 36
USB Status & Control0x1FR/WUSB Upstream Port Traffic Status and Control33
Global Interrupt Enable0x20R/WGlobal Interrupt Enable 24
Hub Downstream Force Low0x51R/WHub Downstream Ports Force LOW (Ports [1:4])31
Processor Status & Control0xFFR/WMicroprocessor Status and Control Register23
4.3Instruction Set Summary
Refer to the CYASM Assembler User’s Guide for more details. Note that conditional jump instructions (i.e., JC, JNC, JZ, JNZ)
take five cycles if jump is taken, four cycles if no jump.
The 14-bit Program Counter (PC) allows access to up to 8 KB of PROM available with the CY7C65113C architecture. The top
32 bytes of the ROM in the 8K part are reserved for testing purposes. The program counter is cleared during reset, such that the
first instruction executed after a reset is at address 0x0000h. Typically, this is a jump instruction to a reset handler that initializes
the application (see Interrupt Vectors on page 25).
The lower eight bits of the program counter are incremented as instructions are loaded and executed. The upper six bits of the
program counter are incremented by executing an XPAGE instruction. As a result, the last instruction executed within a 256-byte
“page” of sequential code should be an XPAGE instruction. The assembler directive “XPAGEON” causes the assembler to insert
XPAGE instructions automatically. Because instructions can be either one or two bytes long, the assembler may occasionally
need to insert a NOP followed by an XPAGE to execute correctly.
The address of the next instruction to be executed, the carry flag, and the zero flag are saved as two bytes on the program stack
during an interrupt acknowledge or a CALL instruction. The program counter, carry flag, and zero flag are restored from the
program stack during a RETI instruction. Only the program counter is restored during a RET instruction.
The program counter cannot be accessed directly by the firmware. The program stack can be examined by reading SRAM from
location 0x00 and up.
Document #: 38-08002 Rev. *DPage 11 of 49
5.1.1Program Memory Organization
after resetAddress
14-bit PC0x0000Program execution begins here after a reset
CY7C65113C
0x0002USB Bus Reset interrupt vector
0x0004128-µs timer interrupt vector
0x00061.024-ms timer interrupt vector
0x0008USB address A endpoint 0 interrupt vector
0x000AUSB address A endpoint 1 interrupt vector
0x000CUSB address A endpoint 2 interrupt vector
0x000EUSB address B endpoint 0 interrupt vector
0x0010USB address B endpoint 1 interrupt vector
0x0012Hub interrupt vector
0x0014Reserved
0x0016GPIO interrupt vector
0x0018
0x001AProgram Memory begins here
I2C interrupt vector
0x1FDF(8 KB -32) PROM ends here (CY7C65113C)
Figure 5-1. Program Memory Space with Interrupt Vector Table
Note that
Document #: 38-08002 Rev. *DPage 12 of 49
the upper 32 bytes of the 8K PROM are reserved. Therefore, user’s program must not overwrite this space.
CY7C65113C
5.28-bit Accumulator (A)
The accumulator is the general-purpose register for the microcontroller.
5.38-bit Temporary Register (X)
The “X” register is available to the firmware for temporary storage of intermediate results. The microcontroller can perform indexed
operations based on the value in X. Refer to Section 5.6.3 for additional information.
5.48-bit Program Stack Pointer (PSP)
During a reset, the Program Stack Pointer (PSP) is set to 0x00 and “grows” upward from this address. The PSP may be set by
firmware, using the MOV PSP,A instruction. The PSP supports interrupt service under hardware control and CALL, RET, and
RETI instructions under firmware control. The PSP is not readable by the firmware.
During an interrupt acknowledge, interrupts are disabled and the 14-bit program counter, carry flag, and zero flag are written as
two bytes of data memory. The first byte is stored in the memory addressed by the PSP, then the PSP is incremented. The second
byte is stored in memory addressed by the PSP, and the PSP is incremented again. The overall effect is to store the program
counter and flags on the program “stack” and increment the PSP by two.
The Return From Interrupt (RETI) instruction decrements the PSP, then restores the second byte from memory addressed by the
PSP. The PSP is decremented again and the first byte is restored from memory addressed by the PSP. After the program counter
and flags have been restored from stack, the interrupts are enabled. The overall effect is to restore the program counter and flags
from the program stack, decrement the PSP by two, and re-enable interrupts.
The Call Subroutine (CALL) instruction stores the program counter and flags on the program stack and increments the PSP by
two.
The Return From Subroutine (RET) instruction restores the program counter but not the flags from the program stack and
decrements the PSP by two.
5.4.1Data Memory Organization
The CY7C65113C microcontrollers provide 256 bytes of data RAM. Normally, the SRAM is partitioned into four areas: program
stack, user variables, data stack, and USB endpoint FIFOs. The following is one example of where the program stack, data stack,
and user variables areas could be located.
After resetAddress
8-bit DSP8-bit PSP0x00Program Stack Growth
(Move DSP
8-bit DSP
Notes:
1. Refer to Section 5.5 for a description of DSP.
2. Endpoint sizes are fixed by the Endpoint Size Bit (I/O register 0x1F, Bit 7). See Table 17-1.
[1]
)
user selectedData Stack Growth
User variables
USB FIFO space for up to two Addresses and five endpoints
0xFF
[2]
Document #: 38-08002 Rev. *DPage 13 of 49
CY7C65113C
5.58-bit Data Stack Pointer (DSP)
The Data Stack Pointer (DSP) supports PUSH and POP instructions that use the data stack for temporary storage. A PUSH
instruction pre-decrements the DSP, then writes data to the memory location addressed by the DSP. A POP instruction reads
data from the memory location addressed by the DSP, then post-increments the DSP.
During a reset, the DSP is reset to 0x00. A PUSH instruction when DSP equals 0x00 writes data at the top of the data RAM
(address 0xFF). This writes data to the memory area reserved for USB endpoint FIFOs. Therefore, the DSP should be indexed
at an appropriate memory location that does not compromise the Program Stack, user-defined memory (variables), or the USB
endpoint FIFOs.
For USB applications, the firmware should set the DSP to an appropriate location to avoid a memory conflict with RAM dedicated
to USB FIFOs. The memory requirements for the USB endpoints are described in Section 17.2. Example assembly instructions
to do this with two device addresses (FIFOs begin at 0xD8) are shown below:
MOV A,20h; Move 20 hex into Accumulator (must be D8h or less)
SWAP A,DSP ; swap accumulator value into DSP register.
5.6Address Modes
The CY7C65113 microcontrollers support three addressing modes for instructions that require data operands: data, direct, and
indexed.
5.6.1Data (Immediate)
“Data” address mode refers to a data operand that is actually a constant encoded in the instruction. As an example, consider the
instruction that loads A with the constant 0xD8:
• MOV A, 0D8h.
This instruction requires two bytes of code where the first byte identifies the “MOV A” instruction with a data operand as the
second byte. The second byte of the instruction is the constant “0xD8.” A constant may be referred to by name if a prior “EQU”
statement assigns the constant value to the name. For example, the following code is equivalent to the example shown above:
• DSPINIT: EQU 0D8h
• MOV A, DSPINIT.
5.6.2Direct
“Direct” address mode is used when the data operand is a variable stored in SRAM. In that case, the one byte address of the
variable is encoded in the instruction. As an example, consider an instruction that loads A with the contents of memory address
location 0x10:
• MOV A, [10h].
Normally, variable names are assigned to variable addresses using “EQU” statements to improve the readability of the assembler
source code. As an example, the following code is equivalent to the example shown above:
• buttons: EQU 10h
• MOV A, [buttons].
5.6.3Indexed
“Indexed” address mode allows the firmware to manipulate arrays of data stored in SRAM. The address of the data operand is
the sum of a constant encoded in the instruction and the contents of the “X” register. Normally, the constant is the “base” address
of an array of data and the X register contains an index that indicates which element of the array is actually addressed:
•array: EQU 10h
•MOV X, 3
• MOV A, [X+array].
This would have the effect of loading A with the fourth element of the SRAM “array” that begins at address 0x10. The fourth
element would be at address 0x13.
Document #: 38-08002 Rev. *DPage 14 of 49
6.0 Clocking
XTALOUT
(pin 1)
CY7C65113C
XTALIN
(pin 2)
30 pF
Figure 6-1. Clock Oscillator On-Chip Circuit
The XTALIN and XTALOUT are the clock pins to the microcontroller. The user can connect an external oscillator or a crystal to
these pins. When using an external crystal, keep PCB traces between the chip leads and crystal as short as possible (less than
2 cm). A 6-MHz fundamental frequency parallel resonant crystal can be connected to these pins to provide a reference frequency
for the internal PLL. The two internal 30-pF load caps appear in series to the external crystal and would be equivalent to a 15-pF
load. Therefore, the crystal must have a required load capacitance of about 15–18 pF. A ceramic resonator does not allow the
microcontroller to meet the timing specifications of full speed USB and therefore a ceramic resonator is not recommended with
these parts.
An external 6-MHz clock can be applied to the XTALIN pin if the XTALOUT pin is left open. Grounding the XTALOUT pin when
driving XTALIN with an oscillator does not work because the internal clock is effectively shorted to ground.
To Internal PLL
30 pF
7.0 Reset
The CY7C65113C supports two resets: POR and WDR. Each of these resets causes:
• all registers to be restored to their default states
• the USB device addresses to be set to 0
• all interrupts to be disabled
• the PSP and DSP to be set to memory address 0x00.
The occurrence of a reset is recorded in the Processor Status and Control Register, as described in Section. Bits 4 and 6 are
used to record the occurrence of POR and WDR respectively. Firmware can interrogate these bits to determine the cause of a
reset.
Program execution starts at ROM address 0x0000 after a reset. Although this looks like interrupt vector 0, there is an important
difference. Reset processing does NOT push the program counter, carry flag, and zero flag onto program stack. The firmware
reset handler should configure the hardware before the “main” loop of code. Attempting to execute a RET or RETI in the firmware
reset handler causes unpredictable execution results.
7.1Power-on Reset
When VCC is first applied to the chip, the POR signal is asserted and the CY7C65113C enters a “semi-suspend” state. During
the semi-suspend state, which is different from the suspend state defined in the USB specification, the oscillator and all other
blocks of the part are functional, except for the CPU. This semi-suspend time ensures that both a valid VCC level is reached and
that the internal PLL has time to stabilize before full operation begins. When the V
the oscillator is stable, the POR is deasserted and the on-chip timer starts counting. The first 1 ms of suspend time is not
interruptible, and the semi-suspend state continues for an additional 95 ms unless the count is bypassed by a USB Bus Reset
on the upstream port. The 95 ms provides time for V
If a USB Bus Reset occurs on the upstream port during the 95 ms semi-suspend time, the semi-suspend state is aborted and
program execution begins immediately from address 0x0000. In this case, the Bus Reset interrupt is pending but not serviced
until firmware sets the USB Bus Reset Interrupt Enable bit (Bit 0, Figure 14-1) and enables interrupts with the EI command.
The POR signal is asserted whenever V
again. Behavior is the same as described above.
Document #: 38-08002 Rev. *DPage 15 of 49
drops below approximately 2.5V, and remains asserted until VCC rises above this level
CC
to stabilize at a valid operating voltage before the chip executes code.
CC
has risen above approximately 2.5V, and
CC
Loading...
+ 34 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.