Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



USB - Firmware - bulksrc modified..
Moderator:
RSKV

Post Reply
Follow this topic



USB - Firmware - bulksrc modified..

Suresh Kumar Kavula posted on 18 May 2010 12:24 PM PST

1 Forum Post

Hi, I am trying implementing USB firmware to the application. My application generates 20 bytes of information every 10millisecond and transfers to XP Host PC. To try this option, took bulksrc example from demo kit and modified in following way:

 * For this example I am using EP8IN

 void TD_Init(void)             // Called once at startup

{

   // set the CPU clock to 48MHz

   CPUCS = ((CPUCS & ~bmCLKSPD) | bmCLKSPD1) ;

 

   // set the slave FIFO interface to 48MHz

   IFCONFIG |= 0x40;

 

// we are just using the default values, yes this is not necessary...

  EP1OUTCFG = 0xA0;

  EP1INCFG = 0xA0;

  SYNCDELAY;                    // see TRM section 15.14

  EP2CFG = 0xA2;

  SYNCDELAY;                   

  EP4CFG = 0xA0;

  SYNCDELAY;                   

  EP6CFG = 0xE2;

  SYNCDELAY;                    

  EP8CFG = 0xE0;

 

  // out endpoints do not come up armed

 

  // since the defaults are double buffered we must write dummy byte counts twice

  SYNCDELAY;                   

  EP2BCL = 0x80;                // arm EP2OUT by writing byte count w/skip.

  SYNCDELAY;                   

  EP2BCL = 0x80;

  SYNCDELAY;                   

  EP4BCL = 0x80;                // arm EP4OUT by writing byte count w/skip.

  SYNCDELAY;                    

  EP4BCL = 0x80;   

 

  // enable dual autopointer feature

  AUTOPTRSETUP |= 0x01;

}

 

 

 

 

 

 

 

 

void TD_Poll(void)              // Called repeatedly while the device is idle

{

static unsigned char txData = 0x41;

            for (i=0;i<20;i++)

     EP8FIFOBUF[i] = txData;

 

SYNCDELAY;

EP8BCH = 0x00;

            SYNCDELAY;

            EP8BCL = 0x04;

            txData++;

            if(txData >= 0x5A)

                        txData = 0x41;            

}

 

With this code I am able to simulate code successful under keil environment. After downloading hex file to EZ-USB controller, when I press “BulkTras” for pipe: 3:Endpoint 8 IN following results I will get:

 

0000  41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41

0010  41 41 41 41

Bulk IN Transfer

Bulk IN success.

Buffer Contents

0000  42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42

0010  42 42 42 42

Bulk IN Transfer

Bulk IN success.

Buffer Contents

0000  41 41 41 41 41 41 41 41 41 41 41 41 4A 4A 4A 4A

0010  4A 4A 4A 4A

Bulk IN Transfer

Bulk IN success.

Buffer Contents

0000  42 42 42 42 58 58 58 58 58 58 58 58 58 58 58 58

0010  58 58 58 58

Bulk IN Transfer

Bulk IN success.

Buffer Contents

0000  41 41 41 41 41 41 41 41 41 41 41 41 4F 4F 4F 4F

0010  4F 4F 4F 4F

Bulk IN Transfer

Bulk IN success.

Buffer Contents

0000  42 42 42 42 58 58 58 58 58 58 58 58 58 58 59 59

0010  59 59 59 59

Bulk IN Transfer

Bulk IN success.

Buffer Contents

0000  41 41 41 41 41 41 41 41 56 56 56 56 56 56 56 56

0010  56 56 56 56

Bulk IN Transfer

Bulk IN success.

Buffer Contents

0000  42 42 42 42 58 58 58 58 58 58 58 58 58 58 58 58

0010  58 58 58 58

Bulk IN Transfer

Bulk IN success.

Buffer Contents

0000  41 41 41 41 41 41 41 41 56 56 56 56 56 56 56 56

0010  56 56 56 58

Bulk IN Transfer

Bulk IN success.

Buffer Contents

0000  42 42 42 42 58 58 58 58 58 58 58 58 58 58 58 58

0010  58 58 58 48

Bulk IN Transfer

Bulk IN success.

Buffer Contents

0000  41 41 41 41 41 41 41 41 56 56 57 57 57 57 57 57

0010  57 57 57 57

Bulk IN Transfer

Bulk IN success.

Buffer Contents

0000  42 42 42 42 58 58 58 58 58 58 58 58 58 58 58 58

0010  58 58 58 50

Bulk IN Transfer

Bulk IN success.

Buffer Contents

0000  41 41 41 41 41 41 41 56 56 56 56 56 56 56 56 56

0010  56 56 56 56

Bulk IN Transfer

Bulk IN success.

Buffer Contents

0000  42 42 42 42 58 58 58 58 58 58 58 49 49 49 49 49

0010  49 49 49 49

 

As per my code for every “BulkTrans” press, I suppose to get 41, 42, 43, 44, 45, 46, 47…like each byte 20 times.

What’s wrong I am doing at TDPOLL() function?

 

Appreciate your quick help.







ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: KXP; Secondary Owner: VWA; Sunset Date: 01/01/20