Manual Cypress AN6077

23 pages 0.23 mb
Download

Go to site of 23

Summary
  • Cypress AN6077 - page 1

    February 19, 2008 Document No. 001-15342 Rev . ** 1 with FX2LP Implementing an 8-Bit Asynchronous Interface Application Note Abstract This application note discusses how to configure the General Programmable Interface (GPIF) and slave FIFOs of the EZ-USB FX2LP™ to implement an 8-bit asynchronous interface. The GPIF is a prog ramma ble 8 or 1 6-bi ...

  • Cypress AN6077 - page 2

    February 19, 2008 Document No. 001-15342 Rev . ** 2 AN6077 GPIF Master Pin Descriptions The GPIF pin names, descriptions, an d their uses are dis- cussed in this section. RDYn Input s RDY[5:0] are ‘ready’ inputs that can be sampled and allow a transaction to wait (inserting wa it states), continue, or repeat until the signal is at the appr opri ...

  • Cypress AN6077 - page 3

    February 19, 2008 Document No. 001-15342 Rev . ** 3 AN6077 Figure 2 shows the GPIF De signer view of the FIFO Read waveform. FIFOWR When creating the F IFOWR waveform the following timin g parameters must be met. tWR pwl - SL WR Pulse Wid th LO W = 50 ns (minimum) tWR pwh - SL WR Pulse Width HIGH = 50 ns (minimum) tSFD - SL WR to FIFO DA T A Setup ...

  • Cypress AN6077 - page 4

    February 19, 2008 Document No. 001-15342 Rev . ** 4 AN6077 Figure 4. FIFO Read Waveform in gpif.c Figure 5. FIFO Write W avefo rm in gpif.c 8051 Firmware Programming (Master) This section describes how to config ure the 8051 to support the interface on the master side (registe r se ttings and others) and discusses the firmware implemented to perfor ...

  • Cypress AN6077 - page 5

    February 19, 2008 Document No. 001-15342 Rev . ** 5 AN6077 The firmware uses the AUTO mode for both IN and OUT transfers. Th is means that the maximum size (512 bytes) packets are committed automat ical ly from the pe ripheral domain to the USB domai n for OUT transfers. For IN trans- fers, they are committed from USB to the peripheral doma in. The ...

  • Cypress AN6077 - page 6

    February 19, 2008 Document No. 001-15342 Rev . ** 6 AN6077 IOA = 0x80; xFIFOTC_OUT = ( ( EP2FIFOBCH << 8 ) + EP2FIFOBCL ); // setup GPIF transaction count SYNCDELAY; EP2GPIFTCH = EP2FIFOBCH; SYNCDELAY; EP2GPIFTCL = EP2FIFOBCL; // trigger FIFO write transaction(s) SYNCDELAY; GPIFTRIG = GPIFTRIGWR | GP IF_EP2; // once master (GPIF) drains OUT p ...

  • Cypress AN6077 - page 7

    February 19, 2008 Document No. 001-15342 Rev . ** 7 AN6077 if( EP68FIFOFLGS & 0x01 ) { // EP6FF=1, when fifo "full" } else { // EP6FF=0, when fifo "not full", fo r example, buffer available // setup GPIF transaction count SYNCDELAY; EP6GPIFTCH = 0x02; SYNCDELAY; EP6GPIFTCL = 0x00; // trigger FIFO read transaction(s), using S ...

  • Cypress AN6077 - page 8

    February 19, 2008 Document No. 001-15342 Rev . ** 8 AN6077 Code Listing for Master Side #pragma NOIV // D o not generate interrupt vectors #include "fx2.h" #include "fx2regs.h" #include "fx2sdly.h" // S YNCDELAY macro extern BOOL GotSUD; // R eceived setup data flag extern BOOL Sleep; extern BOOL Rwuen; extern BOOL Sel ...

  • Cypress AN6077 - page 9

    February 19, 2008 Document No. 001-15342 Rev . ** 9 AN6077 // EP4 and EP8 are not used in thi s implementation SYNCDELAY; // EP4CFG = 0x20; // c lear valid bit SYNCDELAY; // EP8CFG = 0x60; // c lear valid bit SYNCDELAY; // FIFORESET = 0x80; // a ctivate NAK-ALL to avoid race co nditions SYNCDELAY; // FIFORESET = 0x82; // r eset, FIFO 2 SYNCDELAY; / ...

  • Cypress AN6077 - page 10

    February 19, 2008 Document No. 001-15342 Rev . ** 10 AN6077 } #define GPIFTRIGWR 0 #define GPIFTRIGRD 4 #define GPIF_EP2 0 #define GPIF_EP4 1 #define GPIF_EP6 2 #define GPIF_EP8 3 void TD_Poll( void ) { // Called repeatedly while the dev ice is idle static WORD xFIFOTC_OUT = 0x0000; static WORD xFIFOTC_IN = 0x0000; // Registers which require a sync ...

  • Cypress AN6077 - page 11

    February 19, 2008 Document No. 001-15342 Rev . ** 1 1 AN6077 // setup GPIF transaction count SYNCDELAY; EP2GPIFTCH = EP2FIFOBCH; SYNCDELAY; EP2GPIFTCL = EP2FIFOBCL; // trigger FIFO write tran saction(s), using SFR SYNCDELAY; GPIFTRIG = GPIFTRIGWR | GP IF_EP2; // once master (GPIF) drai ns OUT packet, it (re)arms to us b domain // this path is alway ...

  • Cypress AN6077 - page 12

    February 19, 2008 Document No. 001-15342 Rev . ** 12 AN6077 // RDY0=1, when peripheral i s "not empty" // drive FIFOADDR lines OEA = 0xC0; IOA = 0x00; if( EP68FIFOFLGS & 0x01 ) { // EP6FF=1, when fifo "ful l" } else { // EP6FF=0, when fifo "not full", for example, buffer avai lable // setup GPIF transaction count S ...

  • Cypress AN6077 - page 13

    February 19, 2008 Document No. 001-15342 Rev . ** 13 AN6077 } BOOL TD_Suspend( void ) { // Called before the device goes i nto suspend mode return( TRUE ); } BOOL TD_Resume( void ) { // Called after the device resumes return( TRUE ); } //---------------------------------- -------------------------------- ----------- // Device Request hooks // The f ...

  • Cypress AN6077 - page 14

    February 19, 2008 Document No. 001-15342 Rev . ** 14 AN6077 { // Called when a Set Interface com mand is received EP0BUF[ 0 ] = AlternateSetting; EP0BCH = 0; EP0BCL = 1; return( TRUE ); // Handled by user code } BOOL DR_GetStatus( void ) { return( TRUE ); } BOOL DR_ClearFeature( void ) { return( TRUE ); } BOOL DR_SetFeature( void ) { return( TRUE ) ...

  • Cypress AN6077 - page 15

    February 19, 2008 Document No. 001-15342 Rev . ** 15 AN6077 EZUSB_IRQ_CLEAR( ); USBIRQ = bmURES; // Clear U RES IRQ } void ISR_Susp( void ) interrupt 0 { Sleep = TRUE; EZUSB_IRQ_CLEAR( ); USBIRQ = bmSUSP; } void ISR_Highspeed( void ) interrupt 0 { if ( EZUSB_HIGHSPEED( ) ) { pConfigDscr = pHighSpeedConfig Dscr; pOtherConfigDscr = pFullSpeedC onfigD ...

  • Cypress AN6077 - page 16

    February 19, 2008 Document No. 001-15342 Rev . ** 16 AN6077 } void ISR_Ep1pingnak( void ) interrup t 0 { } void ISR_Ep2pingnak( void ) interrup t 0 { } void ISR_Ep4pingnak( void ) interrup t 0 { } void ISR_Ep6pingnak( void ) interrup t 0 { } void ISR_Ep8pingnak( void ) interrup t 0 { } void ISR_Errorlimit( void ) interrup t 0 { } void ISR_Ep2piderr ...

  • Cypress AN6077 - page 17

    February 19, 2008 Document No. 001-15342 Rev . ** 17 AN6077 } void ISR_Ep8fflag( void ) interrupt 0 { } void ISR_GpifComplete( void ) interr upt 0 { } void ISR_GpifWaveform( void ) interr upt 0 { // FIFORd WF detected peripheral prematurely empty (less than max . pkt. size) GPIFABORT = 0xFF; // a bort to handle shortpkt INPKTEND = 0x06; SYNCDELAY; ...

  • Cypress AN6077 - page 18

    February 19, 2008 Document No. 001-15342 Rev . ** 18 AN6077 // PINFLAGSxx EPxFIFOIRQ // EPxFIFOIE GPIFIRQ // GPIFIE GPIFADRH:L // UDMACRCH:L EPxGPIFTRIG // GPIFTRIG SYNCDELAY; FIFORESET = 0x80; // a ctivate NAK-ALL to avoid race co nditions SYNCDELAY; // s ee TRM section 15.14 FIFORESET = 0x82; // r eset, FIFO 2 SYNCDELAY; // FIFORESET = 0x84; // r ...

  • Cypress AN6077 - page 19

    February 19, 2008 Document No. 001-15342 Rev . ** 19 AN6077 EP2FIFOCFG = 0x10; // A UTOOUT=1, WORDWIDE=0 SYNCDELAY; EP6FIFOCFG = 0x0C; // A UTOIN=1, ZEROLENIN=1, WORDWIDE=0 SYNCDELAY; } void TD_Poll( void ) { // Called repeatedly while the dev ice is idle // nothing to do;slave fifo's are in AUTO mode } BOOL TD_Suspend( void ) { // Called befo ...

  • Cypress AN6077 - page 20

    February 19, 2008 Document No. 001-15342 Rev . ** 20 AN6077 EP0BUF[ 0 ] = Configuration; EP0BCH = 0; EP0BCL = 1; return(TRUE); // Handled by user code } BOOL DR_SetInterface( void ) { // Called when a Set Interface com mand is received AlternateSetting = SETUPDAT[ 2 ]; return( TRUE ); // Handled by user code } BOOL DR_GetInterface( void ) { // Call ...

  • Cypress AN6077 - page 21

    February 19, 2008 Document No. 001-15342 Rev . ** 21 AN6077 USBIRQ = bmSOF; // Clear S OF IRQ } void ISR_Ures( void ) interrupt 0 { if ( EZUSB_HIGHSPEED( ) ) { pConfigDscr = pHighSpeedConfig Dscr; pOtherConfigDscr = pFullSpeedC onfigDscr; } else { pConfigDscr = pFullSpeedConfig Dscr; pOtherConfigDscr = pHighSpeedC onfigDscr; } EZUSB_IRQ_CLEAR( ); U ...

  • Cypress AN6077 - page 22

    February 19, 2008 Document No. 001-15342 Rev . ** 22 AN6077 } void ISR_Ep4inout( void ) interrupt 0 { } void ISR_Ep6inout( void ) interrupt 0 { } void ISR_Ep8inout( void ) interrupt 0 { } void ISR_Ibn( void ) interrupt 0 { } void ISR_Ep0pingnak( void ) interrup t 0 { } void ISR_Ep1pingnak( void ) interrup t 0 { } void ISR_Ep2pingnak( void ) interru ...

  • Cypress AN6077 - page 23

    AN6077 Cypress Semico nd uctor 198 Champi on Cou rt San Jose, CA 9513 4-1709 Phone: 408- 943-2600 Fax: 408-94 3-4730 http://www.cypr ess.com © Cypress S emiconducto r Corpora tion, 200 6-2008. The informati on contained herein is subject to chang e without notice. Cy press Semiconducto r Corporation a ssumes no resp onsibility for t he use of an y ...

Manufacturer Cypress Category Network Card

Documents that we receive from a manufacturer of a Cypress AN6077 can be divided into several groups. They are, among others:
- Cypress technical drawings
- AN6077 manuals
- Cypress product data sheets
- information booklets
- or energy labels Cypress AN6077
All of them are important, but the most important information from the point of view of use of the device are in the user manual Cypress AN6077.

A group of documents referred to as user manuals is also divided into more specific types, such as: Installation manuals Cypress AN6077, service manual, brief instructions and user manuals Cypress AN6077. Depending on your needs, you should look for the document you need. In our website you can view the most popular manual of the product Cypress AN6077.

Similar manuals

A complete manual for the device Cypress AN6077, how should it look like?
A manual, also referred to as a user manual, or simply "instructions" is a technical document designed to assist in the use Cypress AN6077 by users. Manuals are usually written by a technical writer, but in a language understandable to all users of Cypress AN6077.

A complete Cypress manual, should contain several basic components. Some of them are less important, such as: cover / title page or copyright page. However, the remaining part should provide us with information that is important from the point of view of the user.

1. Preface and tips on how to use the manual Cypress AN6077 - At the beginning of each manual we should find clues about how to use the guidelines. It should include information about the location of the Contents of the Cypress AN6077, FAQ or common problems, i.e. places that are most often searched by users in each manual
2. Contents - index of all tips concerning the Cypress AN6077, that we can find in the current document
3. Tips how to use the basic functions of the device Cypress AN6077 - which should help us in our first steps of using Cypress AN6077
4. Troubleshooting - systematic sequence of activities that will help us diagnose and subsequently solve the most important problems with Cypress AN6077
5. FAQ - Frequently Asked Questions
6. Contact detailsInformation about where to look for contact to the manufacturer/service of Cypress AN6077 in a specific country, if it was not possible to solve the problem on our own.

Do you have a question concerning Cypress AN6077?

Use the form below

If you did not solve your problem by using a manual Cypress AN6077, ask a question using the form below. If a user had a similar problem with Cypress AN6077 it is likely that he will want to share the way to solve it.

Copy the text from the picture

Comments (0)