5.6.1 Data (Immediate) .................................................................................................................................15
5.6.2 Direct ...................................................................................................................................................15
14.1 Interrup t V e c to r s ............................. .. ................ .. ............... ................ .. ................ .. ....................24
•I/O ports
—Three GPIO ports (Port 0 to 2) capable of sinking 7 mA per pin (typical)
—An additional GPIO port (Port 3) capable of sinking 12 mA per pin (typical) for high current requirements: LEDs
—Higher current drive achievable by connecting multiple GPIO pins together to drive a common output
—Each GPIO port can be configure d as inputs with internal pull-ups or open drain outputs o r traditional CMOS outputs
—Maskable interrupts on all I/O pins
• 12-bit free-running timer with one microsecond clock ticks
• Watch Dog 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 7 (CY7C65013) or 4 (CY7C65113) 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 EMI
• Operating voltage from 4.0V to 5.5V DC
• Operating temperature from 0 to 70 degrees Celsius
• CY7C65013 available in 48-pin PDIP (-PC) or 48-pin SSOP (-PVC) packages
• CY7C65113 available in 28-pin SOIC (-SC) or 28-pin PDIP (-PC) packages
• Industry standard programmer support
2
C compatible Controller (100 kHz) enabled through General-Purpose I/O (GPIO) pins
5
CY7C65013
CY7C65113
2.0 Functional Overview
The CY7C65x13 devices are One Time Programmable 8-bit microcontrollers with a built-in 12-Mbps USB hub that supports up
to seven downstre am ports. The mi cro con trol ler instruction set has be en optimized speci fic al ly for USB opera tio ns, although the
microcontrollers can be used for a variety of non-USB embedded applications.
The CY7C65013 f eature s 22 GPIO pi ns to sup port USB and other applica tions . The I/O pins are gro uped into f o ur ports (P0[7:0],
P1[7:4,2:0], P2[7:3], P3[1:0]) where eac h port can be configured as inputs with internal pull-ups, ope n drain outputs , or trad itional
CMOS outputs. Ports 0 to 2 are rated at 7 mA per pin (typical) sink current. Port 3 pins are rated at 12 mA per pin (typical) sink
current, which allows these pins to drive LEDs. Multiple GPIO pins can be connected together to drive a single output for more
drive current cap ac ity. Additionally, each I/O pin can be used to gener a te a G PIO in terrupt to th e m ic roc ontro ll er. All of the GPIO
interrupts all share the same “GPIO” interrupt vector.
The CY7C65113 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.
The microcontroller uses an external 6-MHz crystal and an internal oscillator to provide a reference to an internal PLL-based
clock generator . This technolog y allows the custom er application to use an inexpensive 6-MHz fu nda me ntal c rystal that r edu ces
the clock-related noise emissions (EMI). A PLL clock generator provides the 6-, 12-, and 48-MHz clock signals for distribution
within the microcontroller.
The CY7C65013 and the CY7C65113 are offered with 8 KB of PROM.
These parts include power-on reset logic, a watch dog timer, and a 12-bit free-running timer. The Power-On Reset (POR) logic
detects when po wer is app lied to the de vice , resets the logic to a k nown state , and beg ins ex ecutin g instructions at PROM add ress
0x0000. The watch dog timer is used to ensure the microcon troller reco vers aft er a period of inactivity. The firmware may becom e
inactive f or a va riety of reasons, inclu ding errors in the co de or a hardware f ailure such as waiting f or an interrupt that n ev er occurs.
2
The microcontroller can communicate with external electronics through the GPIO pins. An I
dates a 100-kHz serial link with an external device.
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 in ternal register when the firmware rea ds the low er eight bits . A read from the upper f our 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.
The microcontroller supports 10 maskable interrupts in the vectored interrupt controller. Interrupt sources include the USB Bus
Reset interrupt, the 12 8-µs (bi t 6) an d 1.0 24-ms (bit 9 ) outpu ts from the free-runn ing ti mer, five USB endpoints, the USB hu b, the
GPIO ports, and the I
from LOW ‘0’ to HIGH ‘1’. The USB endpo ints interrupt after the USB host has written data to th e 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 tra nsi tio n po larity c an be programmed f o r eac h GP IO port as part of the port configuration. The in terrupt
polarity can be rising edge (‘0’ to ‘1’) or falling edge (‘1’ to ‘0’).
The CY7C65013 and CY7C65113 include 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 endpoint s) and a de vice address f or a compound device (three endpoints ). The SIE allow s the USB host to com municate
with the hub and funct ions integrate d into the microcontro ller. T he CY7C65113 part includes a 1 :4 hub repeater with one u pstream
port and four dow nstream ports, while the CY7C65013 pa rt includes a 1:7 hub repeater . The USB Hub allows po wer manage ment
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 singl e pair of po wer manag ement pins , or prov iding po wer mana gement f or eac h port with four
(CY7C65113) or seven (CY7C65013) pairs of power management pins.
2
C compatible master mode interface. The timer bits cause an interrupt (if enabled) when the bit toggles
C compatible in terface acc ommo-
6
.
Logic Block Diagram
CY7C65013
CY7C65113
6-MHz crys tal
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
USB
Transceiver
Repeater
P0[0]
P0[7]
D+[0]
Upstream
USB Port
D–[0]
Downstream USB Ports
USB
Transceiver
USB
Transceiver
USB
Transceiver
USB
Transceiver
CY7C65013 only
Power management under firmware
control using GPIO pins
D+[1]
D–[1]
D+[4]
D–[4]
D+[5]
D–[5]
D+[7]
D–[7]
Watch Dog
Timer
Power-On
Reset
GPIO
PORT 1
GPIO
PORT 1
GPIO
PORT 2
GPIO
PORT 3
I2C comp.
Interface
2
C Compatible interface enabled by firmware through
D+[0], D–[0]I/O7, 85, 6Upstream port, USB differential data.
D+[1], D–[1]I/O10, 117, 8Downstream Port 1, USB differential data.
D+[2], D–[2]I/O13, 149, 10Downstream Port 2, USB differential data.
D+[3], D–[3]I/O41, 4223, 24Downstream Port 3, USB differential data.
D+[4], D–[4]I/O38, 3921, 22Downstream Port 4, USB differential data.
D+[5], D–[5]I/O35, 36Downstream Port 5, USB differential data.
D+[6], D–[6]I/O31, 32Downstream Port 6, USB differential data.
D+[7], D–[7]I/O18, 19Downstream Port 7, USB differential data.
P0I/OP1[7:0]
P1I/OP1[7:4,2:0]
P2I/OP2[7:3]
P3I/OP3[1:0]
XTAL
IN
XTAL
OUT
V
PP
V
CC
GND9, 16, 34, 404, 20Ground.
V
REF
OUT116-MHz crystal out.
21, 25, 22, 26,
23, 27, 24, 28
5, 44, 4, 45;
46, 3, 47
20, 30, 17,
33, 15
6, 43
IN226-MHz crystal or external clock input.
2919Programming v oltage sup ply, tie to ground during no rmal operatio n.
4828V olta ge su ppl y.
IN12, 373External 3.3V supply voltage for the downstream differential data
P1[7:0]
11, 15, 12, 16,
13, 17, 14, 18
P1[2:0]
25, 27, 26
GPIO Port 0 capable of sinking 7 mA (typical).
GPIO Port 1 capable of sinking 7 mA (typical).
GPIO Port 2 capable of sinking 12 mA (typical).
GPIO Port 3, capable of sinking 12 mA (typical).
output buffers and the D+ pull up.
CY7C65013
CY7C65113
4.2I/O Register Summary
I/O registers are accessed via the I/O Read (IORD) and I/O Write (IOWR, IO WX) instructio ns. IORD reads data from the selected
port into the accumulator. IOWR performs the reverse; it writes da ta from the ac cum ulato r to the selec ted po rt. Indexed I/O Write
(IOWX) adds the contents of X t o the address in the instructi on to form the port address and writes data from the accumulat or 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 18
Port 1 Data0x01R/WGPIO Port 1 Data18
Port 2 Data0x02R/WGPIO Port 2 Data18
Port 3 Data0x03R/WGPIO Port 3 Data18
Port 0 Interrupt Enable0x04WInterrupt Enable for Pins in Port 020
Port 1 Interrupt Enable0x05WInterrupt Enable for Pins in Port 120
Port 2 Interrupt Enable0x06WInterrupt Enable for Pins in Port 220
9
CY7C65013
CY7C65113
Table 4-2. I/O Register Summary (continued)
Register NameI/O AddressRead/WriteFunctionPage
Port 3 Interrupt Enable0x07WInterrupt Enable for Pins in Port 320
GPIO Configuration0x08R/WGPIO Port Configurations19
2
C Configuration0x09R/WI2C Positi on Configuration21
I
USB Device Address A0x10R/WUSB Device Address A33
EP A0 Counter Register0x11R/WUSB Address A, Endpoint 0 Counter 35
EP A0 Mode Register0x12R/WUSB Address A, Endpoint 0 Configuration 34
EP A1 Counter Register0x13R/WUSB Address A, Endpoint 1 Counter 35
EP A1 Mode Register0x14R/WUSB Address A, Endpoint 1 Configuration 35
EP A2 Counter Register0x15R/WUSB Address A, Endpoint 2 Counter 35
EP A2 Mode Register0x16R/WUSB Address A, Endpoint 2 Configuration 35
USB Status & Control0x1FR/WUSB Upstream Port Traffic Status and Control32
Global Interrupt Enable0x20R/WGlobal Interrupt Enable 24
Endpoint Interrupt Enable0x21R/WUSB Endpoint Interrupt Enables24
Interrupt Vector0x23RPending Interrupt Vector Read/Clear25
Timer (LSB)0x24RLower 8 Bits of Free-running Timer (1 MHz)20
Timer (MSB)0x25RUpper 4 Bits of Free-running Timer 20
WDT Clear0x26WWatch Dog Timer Clear17
2
C Control & Status0x28R/WI2C Status and C ontrol22
USB Device Address B0x40R/WUSB Device Add r es s B (no t us ed in 5-endpoint mode) 33
EP B0 Counter Register0x41R/WUSB Address B, Endpoint 0 Counter35
EP B0 Mode Register0x42R/WUSB Address B, Endpoint 0 Configuration, or
EP B1 Counter Register0x43R/WUSB Address B, Endpoint 1 Counter35
EP B1 Mode Register0x44R/WUSB Address B, Endpoint 1 Configuration, or
Hub Port Connect Status0x48R/WHub Downstream Port Connect Status29
Hub Port Enable0x49R/WHub Downstream Ports Enable30
Hub Port Speed0x4AR/WHub Downstream Ports Speed29
Hub Port Control (Ports [4:1])0x4BR/WHub Downstream Ports Control (Ports [4:1])30
Hub Port Control (Ports [7:5])0x4CR/WHub Downstream Ports Control (Ports [7:5])30
Hub Port Suspend0x4DR/WHub Downstream Port Suspend Control31
Hub Port Resume Status0x4ERHub Downstream Ports Resume Status32
Hub Ports SE0 Status0x4FRHub Downstream Ports SE0 Status31
Hub Ports Data0x50RHub Downstream Ports Differential Data31
Hub Downstream Force Low0x51R/WHub Downstream Ports Force LOW (Ports [1:4])31
Hub Downstream Force High0x52R/WHub Downstream Ports Force HIGH (Ports [5:7])31
Processor Status & Control0xFFR/WMicroprocessor Status and Control Register23
USB Address A, Endpoint 3 in 5-endpoint mode
USB Address A, Endpoint 4 in 5-endpoint mode
34
35
10
CY7C65013
CY7C65113
4.3Instruction Set Summary
Refer to the CYASM Assembler User’s Guide for more details.
The 14-bit Program Counter (PC) allows access to up to 8 KB of PROM available with the CY7C65x13 architecture. The top
32 bytes of the R O M in th e 8K part are reserved for testing purposes. T he pr ogr am c ounter is cle ared du ring reset, s uch that th e
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 24).
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 sh ould be an XPAGE instruction. The assemb ler di rective “XPAGEON” causes the asse mb l er to insert
XPAGE instructions automatically. Because instructions can be either one or two bytes long, the assembler may occasionally
need to inse rt a NOP followed by an XPAGE to execute cor rectly.
The address of the next instructio n t o b e exec ute d, the c arry flag, a nd the zero flag are s aved as two bytes o n t he 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 in struction. 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.
12
5.1.1Program Memory Organization
after resetAddress
14-bit PC0x0000Program execution begins here after a reset
CY7C65013
CY7C65113
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
0x001A
I2C interrupt vector
Program Memory begins here
0x1FDF
Figure 5-1. Program Memory Space with Interrupt Vector Table
8 KB (-32) PROM ends here (CY7C65013, CY7C65113)
13
CY7C65013
CY7C65113
5.28-Bit Accumulator (A)
The accumulator is the general-purpose register for the microcontroller.
5.38-Bit Temporary Register (X)
The “X” register i s av ailable t o the firmware f or temp orary storage of intermediate resul ts. The mi crocontroller c an perf orm 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 st ored in the memory addressed b y the PSP, then the PSP is incre mented. The sec ond
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 b yte is restored fro m memory addressed b y the PSP. After the program counter
and flags ha v e been res tored from stac k, the interrupts are e nab led. Th e ov er all eff ec t is to res tore the p rogr am cou nter and flags
from the program stack, decrement the PSP by two, and re-enable interrupts.
The Call Subroutine (CALL) instruction st ores the program counter and flags on the program stack an d 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 CY7C65x13 microcontrollers provide 256 bytes of data RAM. Normally, the SRAM is partitioned into four areas: program
stack, user v ariab le s, da ta stac k, and U SB endpo int FIFOs . The f ollowi ng is on e e xampl e of wher e the prog ram stac k, data stac k,
and user variables areas could be located.
After resetAddress
8-bit DSP8-bit PSP0x00
(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 Tabl e 17 -1.
[1]
)
user selected
User variables
USB FIFO space for up to two Ad dresses and five endpo ints
0xFF
Program Stack Growth
Data Stack Growth
[2]
14
Loading...
+ 31 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.