Cypress EZ-USB FX2LP Getting Started

Cypress EZ-USB FX2LP Getting Started

Hide thumbs Also See for EZ-USB FX2LP:

Advertisement

Quick Links

AN65209
Getting Started with FX2LP™

About this document

Scope and purpose
AN65209 introduces you to the EZ-USB
build a project for FX2LP and explore its various development tools, and then guides you to the appropriate
documentation to accelerate in-depth learning about FX2LP.
Associated part family
CY7C68013A/14A/15A/16A/53
Associated project
Yes
Software version
None
More code examples? We heard you.
To access a variety of FX2LP code examples, please visit our
To access USB 3.0 product family, please visit our

Table of contents

About this document ....................................................................................................................... 1
Table of contents ............................................................................................................................ 1
1
Introduction .......................................................................................................................... 3
1.1
Bulkloop_FX2LP Project .......................................................................................................................... 3
1.1.1
VS_Control Center .............................................................................................................................. 3
1.1.2
Bulkloop_VCS ..................................................................................................................................... 3
1.1.3
Windows Driver and Library ............................................................................................................... 3
2
USB 2.0 ................................................................................................................................. 4
3
FX2LP Introduction ................................................................................................................ 5
3.1
FX2LP Features ........................................................................................................................................ 5
3.1.1
USB Interface ...................................................................................................................................... 5
3.1.2
Parallel interfaces .............................................................................................................................. 6
3.1.2.1
3.1.2.2
3.2
Serial interfaces ....................................................................................................................................... 8
3.3
CPU and Memory ..................................................................................................................................... 8
3.3.1
8051 .................................................................................................................................................... 8
3.3.2
Boot Options ...................................................................................................................................... 8
3.3.2.1
Application Note
FX2LP
Slave FIFO ...................................................................................................................................... 6
General Programmable Interface ................................................................................................. 7
Package Choices ........................................................................................................................... 8
Please read the Important Notice and Warnings at the end of this document
USB 2.0 device controller. This application note helps you
USB High-Speed Code Examples
USB 3.0 Product Family
webpage.
webpage.
001-65209 Rev.*I
2021-03-19

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the EZ-USB FX2LP and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Cypress EZ-USB FX2LP

  • Page 1: Table Of Contents

    AN65209 Getting Started with FX2LP™ About this document Scope and purpose   AN65209 introduces you to the EZ-USB FX2LP USB 2.0 device controller. This application note helps you build a project for FX2LP and explore its various development tools, and then guides you to the appropriate documentation to accelerate in-depth learning about FX2LP.
  • Page 2 Cypress Libraries ........................... 28 Summary ..........................30 Appendix A: FX2LP Development Kit (DVK) ................31 Firmware Example Projects ........................31 Appendix B: Additional USB Hi-Speed Devices from Cypress............34 Appendix C: Third-Party Development Kits and SDKs ..............35 10.1 Third-party SDKs ........................... 35 Appendix D: Application Notes and Reference Designs...............
  • Page 3: Introduction

    Center. This application is used to download the FX2LP code (a hex file) into the FX2LP Development Kit. The executable is provided for instant use and the source code is provided for reference. It uses the Cypress .NET library, demonstrating the use of many of its high-level functions.
  • Page 4: Usb 2.0

    The USB 3.0 specification, released in 2008, further increased the signaling rate to 5 Gbps, calling it SuperSpeed. The Cypress FX3 family supports this speed. The subject of this application note is the Cypress FX2LP, which operates at Hi-Speed and Full-speed. Appendix lists other Hi-Speed devices available from Cypress.
  • Page 5: Fx2Lp Introduction

    Getting Started with FX2LP™ FX2LP Introduction FX2LP Introduction FX2LP integrates a USB 2.0 transceiver, a smart serial interface engine (SIE), large data buffers, an enhanced 8051 microcontroller, and a programmable peripheral interface in a single chip. A simplified FX2LP block diagram is shown in Figure Figure 1...
  • Page 6: Parallel Interfaces

    A physical bus interface (PHY) containing a USB 2.0 transceiver that supports Hi-Speed and Full Speed USB • transfers. A Smart serial interface engine (SIE). The SIE translates PHY signals into bytes. All Cypress USB SIEs add logic • to handle low-level USB details, such as error correction and Packet ID (PID) synchronization, relieving the programmer of these tasks.
  • Page 7: General Programmable Interface

    Getting Started with FX2LP™ FX2LP Introduction The Slave FIFO interface: Provides a data bus that is 8 or 16 bits wide. • Operates either asynchronously (no clock) or synchronously (with clock). • Accepts an external clock or uses an internal FX2LP 30-/48-MHz clock (in synchronous mode), which it makes •...
  • Page 8: Serial Interfaces

    Getting Started with FX2LP™ FX2LP Introduction Serial interfaces In addition to the USB and peripheral interfaces, FX2LP contains: • An I C master (only) which operates at 100 or 400 kHz. • Two standard 8051 USARTs. These are standard UARTs with a synchronous option. The USART interface pins •...
  • Page 9 Getting Started with FX2LP™ FX2LP Introduction Single Chip GPIF Slave FIFO PD[7:0] FIFO Data FIFO Data PB[7:0] XTALIN XTALOUT RDY0 IORDY SLRD RDY1 DMARQ SLWR DPLUS CTL0 DMINUS PRGFLAG CTL1 INFULL DMACK CTL2 OUTEMPTY ←INTRQ INT0#/PA0 ←INT0 →DA0 PA1/DA0 ←INT1 RESET# →DA1 ←SLOE...
  • Page 10: Example Applications Of Fx2Lp

    C bus 3.4.2 Further Reading Cypress provides a reference design for a “TV Dongle”, documented at FX2LP DMB-T / H TV Dongle Reference Design. If an external chip does not exactly map to the FX2LP Slave FIFO signals, as in...
  • Page 11: Booting An Fpga From Fx2Lp

    Getting Started with FX2LP™ FX2LP Introduction 3.4.3 Booting an FPGA from FX2LP FX2LP is all about efficient system integration. Figure 7 Figure 8 illustrate another way FX2LP can save external logic. FPGA FX2LP Bitstream Boot Memory Figure 7 FPGA Boots from External Memory At power-on, an FPGA boots its configuration bitstream using an external memory (Figure Figure 8...
  • Page 12: Cypress Design Resources

    Getting Started with FX2LP™ Cypress Design Resources Cypress Design Resources Cypress FX2LP design resources include datasheets, application notes, evaluation kits, reference designs, firmware examples, and software tools. The resources are summarized in Table Table 2 FX2LP Resource Summary Design Available Resources...
  • Page 13 Getting Started with FX2LP™ Cypress Design Resources Design Available Resources Where To Find Resources FX2LP Technical Reference Manual http://www.cypress.com/?rID=38232 Application Notes http://www.cypress.com/?id=193&rtID=76 Reference Designs http://www.cypress.com/?id=193&rtID=201 Knowledge Base Articles http://www.cypress.com/?id=193&rtID=118 Material on USB 2.0 http://www.beyondlogic.org/usbnutshell/usb1.shtml AN57294 - USB 101: An Introduction to Universal Serial Bus 2.0 Third-party Development Kits http://www.ztex.de/usb-fpga-1...
  • Page 14: Fx2Lp Development Tools

    GPIF Designer section. 2. Develop the FX2LP firmware with the help of the firmware framework provided by Cypress. Integrate the .c file that was exported from step 1. Build the firmware project using the Keil uVision2 IDE. This step generates .hex and .iic file. The .hex file is for programming the RAM of FX2LP and the .iic file is for programming the EEPROM that is connected to FX2LP.
  • Page 15: Fx2Lp Development Board

    Figure 11 FX2LP Development Kit and Windows Driver The FX2LP Development Kit is available at: http://www.cypress.com/?rID=14321. Also included with this kit (and available for free download) is the development software package including a free version of the Keil uVision2 IDE (limited in object size to 4 kilobytes) and C compiler. More details about the...
  • Page 16: Running The Bulkloop Demo

    (ReNumeration ). If the loaded hex file has custom Vendor ID (VID) and Product ID (PID) then you need to add these values to the Cypress .inf file. bulkloop.hex Cypress Driver: cyusb.sys Figure 13 USB Control Center Loads Hex Files into the FX2LP Development Board.
  • Page 17 2. Now you are ready to load the FX2LP firmware bulkloop.hex (AN65209\FX2LP Bulkloop Firmware) on to the FX2LP DVK. Click on the Cypress device entry to highlight it, and then select Program FX2 > RAM. Open the FX2LP Bulkloop Firmware folder and select the bulkloop.hex file. After the code loads, the FX2LP Development Kit disconnects itself from USB and reconnects as the device created by the loaded firmware bulkloop.hex...
  • Page 18 Getting Started with FX2LP™ FX2LP Development Tools Figure 16 shows the interaction between USB Control Center and the FX2LP Development Board loaded with the bulkloop.hex file. The bulkloop firmware enumerates as a Full Speed or Hi-Speed device depending on the PC connection and copies (loops) BULK data it receives from OUT Endpoint 2 into an IN Endpoint 6 buffer for transmission back to the PC.
  • Page 19: Using Bulkloop_Vcs

    Getting Started with FX2LP™ FX2LP Development Tools Figure 18 Successful BULK-OUT Transfer 1. Click the Transfer Data-OUT button again. The PC dispatches a second packet to FX2LP, and the 7-segment readout increments to 2. 2. Highlight the Bulk in endpoint (0x86) entry. The Transfer button label now indicates -IN. Clicking this button leads to the following: 512 bytes transfer from FX2LP to the host, which it displays as hexadecimal values.
  • Page 20: Fx2Lp Firmware Development

    Keil uVision2 The Cypress FX2LP DVK includes a free demonstration version of the Keil uVision2 tools for the 8051. This IDE is fully featured, but limited in code size to 4096 bytes. Cypress demo projects, such as bulkloop.uv2, fit under this limit so you can study and modify the code.
  • Page 21 Getting Started with FX2LP™ FX2LP Development Tools dscr.a51 is an assembly language file containing the data necessary to enumerate the USB device. The file • comprises table data in the form of .db (define byte) statements. You edit this file to customize items such as VID/PID and descriptive strings for your design.
  • Page 22: Td_Init

    Getting Started with FX2LP™ FX2LP Development Tools imply store the Set values sent by the host and echo them back when the host issues the Get requests. For more complex configurations, you can use these DR calls (“hooks”) to change camera resolutions or route requests to two different interfaces.
  • Page 23: Interrupt Service Routines

    Getting Started with FX2LP™ FX2LP Development Tools In other words, EP2 has a packet, and EP6 has room for a packet. Doing the test this way handles any packet size and takes the double-buffering into account. 5.3.2.3 Interrupt Service Routines The bulkloop.c file contains ISR functions for every USB interrupt source.
  • Page 24: Building The Bulkloop Project

    Getting Started with FX2LP™ FX2LP Development Tools The ISR_Ures(USB Reset) code designates the Full Speed descriptor as the current speed descriptor, and the • Hi-Speed descriptor as the other speed descriptor. If plugged into a full-speed port, no further action is required.
  • Page 25: Gpif Designer

    FX2LP and outside peripherals, such as disk drives or image sensors. For this purpose, the GPIF provides a fast and flexible interface to outside systems. This section highlights AN66806 - Getting Started with EZ-USB FX2LP GPIF, which gives step-by-step instructions for using the Cypress GPIF Designer tool.
  • Page 26 Getting Started with FX2LP™ FX2LP Development Tools As you define waveform transitions, GPIF Designer automatically creates states in the top line—in this example, the four states S0 through S3. This waveform is designed to repeat endlessly as it is designed to produce the clock outputs.
  • Page 27: The Windows Side

    The Cypress USB driver (CyUSB.sys) is a robust high-performance Windows driver used for host communication with a USB-connected target. This driver is installed on the host PC as part of the EZ-USB FX2LP DVK installation, and in the accompanying zip file in the Windows Driver folder. The driver comes in binary form and can be distributed with your FX2LP-based devices.
  • Page 28: Cypress Libraries

    Detailed View of How Cypress Libraries Communicate with Applications The Bulkloop_VCS application is an example of the software architecture used for any Windows-to-FX2LP communication using the Cypress .NET library. A C# language program makes library calls that access the Cypress driver to communicate with FX2LP (see Figure 28).
  • Page 29 Communicating with USB devices using this high-level model is a great improvement over multiple Win32 API calls such as DeviceIOControl. An excellent way to gain familiarity with the Cypress library is to open the Bulkloop_VCS solution using Microsoft Visual C# Express edition, and inspect the code.
  • Page 30: Summary

    Summary Summary The Cypress FX2LP is designed to meet your USB 2.0 Hi-Speed design requirements. Cypress provides an extensive suite of support collateral to help with each step of your design cycle. This application note first introduced FX2LP, then introduced Cypress hardware, firmware, and software tools by stepping through the design, creation and testing of a BULK transfer example.
  • Page 31: Appendix A: Fx2Lp Development Kit (Dvk)

    EEPROM. When developing hardware for USB 2.0 Hi-Speed devices, board layout and design are critical to the success of the project. To help developers avoid common layout errors, Cypress provides several resources to help design a new board. Application notes...
  • Page 32 Getting Started with FX2LP™ Appendix A: FX2LP Development Kit (DVK) speed devices. The USB Frameworks simplify and accelerates custom firmware development by using Cypress code for common operations, such as FX2LP chip initialization, USB standard device request handling, and USB suspend-resume power management.
  • Page 33 Getting Started with FX2LP™ Appendix A: FX2LP Development Kit (DVK) Note: These software resources are continuously improved. Therefore, Cypress recommends downloading the latest software from the Cypress website. Application Note 33 of 42 001-65209 Rev.*I 2021-03-19...
  • Page 34: Appendix B: Additional Usb Hi-Speed Devices From Cypress

    AT2LP is perfect for mass storage type applications and enables quick time to market without custom firmware. AT2LP supports all ATA/ATAPI-6 compliant mass storage devices. NX2LP-Flex: Cypress’s EZ-USB NX2LP-Flex™ (CY7C68033/34) is a low-power programmable USB to SLC • NAND controller. Its programmability allows designers to include special features in the controller along with NAND device support, an advantage over fixed controllers.
  • Page 35: Appendix C: Third-Party Development Kits And Sdks

    FPGA + FX2LP board from Opal Kelly: More details of this board can be found in the following location: http://www.opalkelly.com/products/xem6010/ Features: Hi-Speed USB 2.0 interface (Cypress FX2LP - CY68013A) for downloading and control • Xilinx Spartan-6 (XC6SLX45-2FGG or XC6SLX150-2FGG) • 32-Mib serial flash (Numonyx M32P25) •...
  • Page 36: Appendix D: Application Notes And Reference Designs

    This application note explains how to implement an 8-bit parallel MPEG2-TS interface using the Slave FIFO mode. The example code uses the EZ-USB FX2LP at the receiver end and a data generator as the source for the data stream. Hardware connections and example code are included.
  • Page 37 This application note discusses how to configure the General Programmable Interface (GPIF) and slave FIFOs in EZ-USB FX2LP in both manual mode and auto mode to implement an 8-bit asynchronous parallel interface. This application note is tested with two FX2LP development kits connected back-to-back; the first one operating in master mode and the second operating in slave mode.
  • Page 38 Appendix D: Application Notes and Reference Designs This reference design kit is based on the Cypress FX2LP and Legend Silicon’s chipset. A captured and demodulated RF signal converted to an MPEG2 TS stream by the Legend Silicon chipset is sent to the PC through an FX2LP.The PC plays these streams using a media player.
  • Page 39: Appendix E: Adding Custom Vid And Pid To The .Inf File

    FX2LP firmware project and if they are not already listed in the .inf file, then you need to add those values to allow your device to be recognized by Cypress development tools such as the USB Control Center. The following steps show how to add custom VID and PID values to cyusbfx1_fx2lp.inf.
  • Page 40 Getting Started with FX2LP™ Appendix E: Adding Custom VID and PID to the .inf File Figure 33 Custom FX2LP device listed in USB Control Center Application Note 40 of 42 001-65209 Rev.*I 2021-03-19...
  • Page 41: Revision History

    Date of release Description of changes version 2010-11-24 New application note. 2011-04-12 Updated template according to current Cypress standards. Removed references to obsolete documents. 2012-10-10 Re-written the application note. 2013-04-22 Added Table 2 to list all the available design resources Added a section to list popular applications of FX2LP Added “Before You Start”...
  • Page 42: Www.infineon.com

    Infineon The data contained in this document is exclusively Go to www.cypress.com/support Technologies, Infineon Technologies’ products may intended for technically trained staff. It is the not be used in any applications where a failure of the responsibility of customer’s technical departments...

Table of Contents

Save PDF