4.6.1 Data ........................................................................................................................................................9
4.6.2 Direct ......................................................................................................................................................9
Table 15-1. USB Register Mode Encoding ..........................................................................................23
Table 15-2. Decode tab le f or
Table 15-3
: “Details of M odes for Differing Traffic Conditions” .. ............24
Table 15-3. Details of Modes for Differing Traffic Conditions ..............................................................25
4
FOR
FOR
PRELIMINARY
CY7C63612/13
1.0 Features
• Low-cost solution for low-speed applications with low I/O requirements such as mice, gamepads, a nd joystick applications
• USB Specification Compliance
—Conforms to USB Specificat ion, Version 1.1
—Conforms to USB HID Specification, Version 1.1
—Supports 1 device address and 3 data endpoints
—Integrated USB transceiver
• 8-bit RISC microcontroller
—Harvard architecture
—6-MHz external ceramic resonator
—12-MHz internal CPU clock
• Internal memory
—256 bytes of RAM
—6 Kbytes of EPROM (CY7C63612)
—8 Kbytes of EPROM (CY7C63613)
• Interface can aut o-configure to operate as PS2 or USB
• I/O port
—12 General-Purpose I/O (GPIO) pins (Port 0 to 2) capable of sinking 7 mA per pin (t ypical)
—Four GPIO pins (Port 3) capable of sinking 12 mA per pin (typical) wh ich can drive LEDs
—Higher current drive is available by connecting multi ple GPIO pins together to drive an commo n output
—Eac h GPIO port can be configured as input s with internal pull- ups or open drain outputs or tradi tional CMOS outputs
—M askable interrupt s on all I/O pi ns
• 12-bit free-running timer with one microsecond clock ticks
• Watch D o g T i m e r (WDT )
• Internal Power-On Reset (POR)
• Improved output drivers to reduce EMI
• Operating voltage from 4.0V to 5.5V DC
• Operating temperature from 0 to 70 degrees Celsius
• CY7C63612/13 available in 24-pin SOIC packages for production
• Industry-sta ndard programmer support
5
FOR
FOR
PRELIMINARY
CY7C63612/13
2.0 Functional Overview
The CY7C63612/13 are 8-bit RISC One Time Programmable (OTP) microcontrollers. The instruction set has been optimized
specifica ll y for USB operation s, although the microcontrollers can be used for a variety of non-USB embedded applications .
The CY7C63612/13 features 16 General-Purpose I/O (GPIO) pins to support USB and other applications. The I/O pins are
grouped int o three ports (P ort 0, 1, and 3) wher e each port can be conf igure d as input s wit h internal pul l-up s, open dr ain out puts,
or tradi ti onal CMOS outputs . 12 GPIO pins (Ports 0 and 1) are rated at 7 mA typical sink current. There are 4 GPIO pins (Port 3)
which are rat ed at 12 mA typical sink current , which allows these pins to drive LEDs . Multiple GPIO pins ca n be connected toget her
to drive a single outp ut f or more driv e current capac ity. Addi tion ally, each I/O pin can be used to generate a GPIO interrupt to the
microcontroller. Note the GPIO interrupts all share the same “GPIO” interrupt vector.
The Cypress microc ontroll ers use an ex ternal 6-MHz cer amic resonato r to provide a re ferenc e to an internal clo ck generat or . This
clock generator reduces the clock-related noise emissions (EMI). The clock generator provides the 6- and 12-MHz clocks that
remain internal to the microcontroller.
The CY7C63612/13 are of fered with two EPROM options t o maximize f lexib ility and mini mize cost . The CY7C63612 has 6 Kb ytes
of EPROM. The CY7C63613 has 8 Kbytes of EPROM.
These parts include power-on reset logi c, a watch dog timer, a vect ored interrupt control ler, and a 12-bi t free-running timer. The
Po wer-On Reset (PO R) lo gic det ects when p ow er is app lied to th e de vi ce , res ets t he logi c to a k nown stat e, an d be gins e xecuting
instructions at EPROM address 0x0000h. The watch dog timer can be used to ensure the firmware never gets stalled for more
than approximately 8 ms. The firmware can get stalled for a variety of r easons, including errors in the code or a hardware failur e
such as waiting for an interrupt that never occurs. The firmware should clear the watchdog timer periodically. If the watch dog
timer is not cleared for approximately 8 ms, the microcontroller wil l generate a hardware wa tch dog reset.
The microcontr oller s upports eight maskab le inter rupts in th e vector ed interrupt c ontroll er. Interrupt sour ces incl ude the USB BusReset, the 128-µs and 1.024-ms outputs from the free-running timer, three USB endpoints, the DAC port, and the GPIO ports.
The timer bits cause an interrupt (if enabled) when the bit toggles from LOW “0” to HIGH “1”. The USB endpoints interrupt after
either the USB host or the USB controller sends a packet to the USB. The DAC ports have an additional level of masking that
allows the user to select which DAC inputs can cause a DAC interrupt. The GPIO ports also have a level of masking to select
which GPIO inputs can cause a GPIO interrupt. For additional flexibility, the input transition polarity that causes an interrupt is
programmable for each pin of the DAC port. Input transition polarity can be programmed for each GPIO port as part of the port
configuration. The interrupt polarity can be either rising edge (“0” to “1”) or falling edge (“1” to “0”).
The free-runn ing 12-bit tim er clocked at 1 MHz pro vides two int errupt sources as noted above (128-µs and 1.024-ms). The timer
can be used to measur e the dur ation of an ev ent under firmware control by read ing the timer twice: once at the start of the event ,
and once after the event is complete. The differ ence between the two readings indicates the duration of the event measured 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 t he u pper four bits actually reads dat a from t he internal r egist er , inst ead o f the timer. This feature elimi nat es the n eed
for fi rmware to attempt to compensate if the upper four bits happened to increment right aft er t he lower 8 bits are read.
The CY7C63612/13 include an integrated USB serial interface engine (SIE) that supports the integrated peripherals. The hardware supports one USB device address with three endpoints. The SIE allows the USB host to communicate with the function
integrated into the microcontroller.
Finally, the CY7C63612/13 support PS/2 operation . With appr opriate fi rmware the D+ and D– USB pins can al so be used as PS/
2 clock and data signals. Products u tilizing these devices can be used for USB and/or PS/2 operation with appropriate firmware.
1. CY7C63612/13 is not bonded out for all GPIO pins shown in Logic Block Diagram. Refer to pin configuration diagram for bonded out pins. See note on page 16
for firmware code needed for unused GPIO pins.
7
FOR
FOR
PRELIMINARY
CY7C63612/13
3.0 Pin Assignments
CY7C63613
NameI/O
D+, D–I/O1,2USB differential data; PS/2 clock and data signals
P0[7:0]
I/O
P1[3:0]
7,18,8,17,
9,16,10,15
5,20,6,19GPIO Port 1 capab le of sinking 7 mA (typical). P1[ 7:4] not bonded out on
I/O
P2
n/aGPIO Port 2 not bonded out on CY7C63612/13. See note on page 16 for firm-
I/O
P3[7:4]
3,22,4,21GPIO Port 3 capab le of sinking 12 mA (typical). P3[ 3:0] not bonded out on
I/O
DACI/On/aDAC I /O Port not bonded out on CY7C63612/13. See not e on page 16 for firm-
XTAL
XTAL
V
PP
V
CC
IN136-MHz ceramic resonator or external clock input
IN
OUT146-MHz ceramic resonator
OUT
11Pr ogramming voltage supply, ground for normal operation
24Voltage supply
Vss12,23Ground
Description24-Pin
GPIO port 0 capable of sinking 7 mA (typical)
CY7C63612/13. See not e on page 16 for f irmware code nee ded for unused pins .
ware code needed for unused pins.
CY7C63612/13. See not e on page 16 for f irmware code nee ded for unused pins .
ware code needed for unused pins.
4.0 Programming Model
4.114-bit Program Counter (PC)
The 14-bit Pr ogra m Counte r (PC) a llo ws acc ess f or up to 8 k ilob ytes of EPR OM usi ng the CY7 C636xx archi tectur e . The pr ogram
counter is cleare d during r ese t, suc h that the fi rst instruc tion ex ec uted af te r a res et is at addr ess 0 x0000h. T his i s typi call y a jump
instruction to a res et handler that initializes the application.
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 inc remented by executing an XPAGE instruction. As a result , the last i nstruction executed within a 256-b yte
“page” of sequential code should be an XPAGE instruction. The assembler directive “XPAGEON ” will cause the assembler to
insert XPAGE instructions automatically. As instructions can be either one or two bytes long, the assembler may occasionally
need to insert a NOP follow ed by an XPAGE for correct execution.
The program counte r of t he ne xt i nstruct ion t o be executed, carry flag, and zer o fla g are sa v ed a s two b ytes on the p rogr am st ack
during an interrupt acknowledge or a CALL instruction. The program counter, carry flag, and zero flag are restored from the
program stack only during a RETI instruction.
Please note the program counter cannot be accessed directly by the firmware. The program stack can be examined by reading
SRAM from location 0x00 and up.
4.28-bit Accumulator (A)
The accumulator is the general purpose, do everything register in the architecture where results are usually calculated.
4.38-bit Index Register (X)
The index regi ster “X” is av ailab le to the firmware as an auxi liary accumul ator . The X register also allows the processo r to perform
indexed operations by loading an inde x value into X.
4.48-bit Program Stac k Pointer ( PSP)
During a rese t, the Progr am Stack P ointer (PSP) is set to z ero. This means the program “stack ” starts at RAM address 0x00 and
“grows” upw ard from there . Note the progr am stac k pointe r is directl y address able unde r firmware control , using the MO V PSP,A
instruction. The PSP supports interrupt service under hardware control and CALL, RET, and RETI instructions under firmware
control.
During an interrupt ac knowledge, 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 program stack pointer, then the PSP is
8
FOR
FOR
PRELIMINARY
CY7C63612/13
incremented. The second byte is stored in memory addressed by the program stack pointer and the PSP is incremented again.
The net effect is to store the pro gram counter and flags on the program “stack” and increment the program stack pointer by tw o.
The Return From I nterrupt (RETI) instruct ion dec rements t he pro gram st ac k point er , then res tores t he second b yt e from memory
addressed by the PSP. The program stack pointer is decremented again and the first byte is restored from memory addressed
by the PSP. After the pr og ram cou nte r and flags ha v e be en r estor ed from st ac k, the inte rrupts are en ab led. The eff e ct i s to res tore
the program counter and flags from the program stack, decrement the program stack pointer b y two, and re-enable interrupts.
The Call Subrout ine (CALL) instruct ion stores the progr am counter and flags on t he program stac k and incremen ts the PSP by two .
The Return From Subroutine (RET) instruction restores the program counter, but not the flags, from program stack and decre-
ments the PSP by two .
4.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 wi ll pr e-decr ement the DSP, then write data t o the memory l ocatio n address ed b y the DSP. A POP instruction will read
data from the memory location addressed by the DSP, then post-increment the DSP.
During a reset, the Data Stack Pointer will be set to zero. A PUSH instruction when DSP equal zero will w r ite d a ta a t t h e to p of
the data RAM (address 0xFF). This would write data to the memory area reserved for a FIFO for USB endpoint 0. In non-USB
applications, this works fi ne and is not a problem. For USB applicati ons, it is strongly recommen ded that the DSP is loaded after
reset just below the USB DMA buffers .
4.6Address Modes
The CY7C63612/13 microcontrollers support three addressing modes for instructions that require data operands: data, direct,
and indexed.
4.6.1Data
The “Data” add res s mode refers to a data operand tha t is a ctual ly a con st ant encod ed i n the i nstruct ion. As an exa mple , cons ide r
the instruction that loads A with the constant 0xE8h:
• MOV A,0E8h
This instruction will require 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 will be the constant “0xE8h”. 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 0E8h
• MOV A,DSPINIT
4.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 0x10h:
• MOV A, [10h]
In normal usage, variable names are assigned to variable addresses using “EQU” statements to improve the readability of the
assembl er source code. As an example, the fol lowing code is equivalent to the exampl e shown above:
• buttons: EQU 10h
• MOV A,[buttons]
4.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. In normal usage, the constant will be the
“base” address of an array of data and the X register will contain 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 0x10h. The four th
element would be at add ress 0x13h.
9
Loading...
+ 21 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.