Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Read endpoint data using external logic

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



Read endpoint data using external logic
Moderator:
RSKV

Post Reply
Follow this topic



Read endpoint data using external logic

ragers posted on 06 Sep 2011 11:39 PM PST
Top Contributor
25 Forum Posts

HI

descreption:

I fill ep2 with 512 bytes with value of 05 using "cypress usb console" and "my own VS2008 program". it successfully writes data to ep2. following trm page 9-18 external logic(avr mega8535) checks flagc(empty) when is not asserted(high) it reads data and shows on LCD. after 512 reads empty flag will be asserted. 

 Problem:

1- The read data are not 05 they are 65-165-218-138-201-49-174-30-173-27-146 ....(they are not random because with defferent tries results are the same)

2- because only 2 writes are successful i think this external reads will not empty the fifo 

am I reading from wrong fifo OR an additional stage other than TRM page 9-18 should be done to empty fhe fifo?

regards




Re: Read endpoint data using external logic

PRJI posted on 06 Sep 2011 05:22 AM PST
Cypress Employee
333 Forum Posts

Hi,

     Can you upload your code?

Regards,

Prajith



Re: Read endpoint data using external logic

ragers posted on 06 Sep 2011 08:38 PM PST
Top Contributor
25 Forum Posts

the code is for bascom:

 



Re: Read endpoint data using external logic

ragers posted on 06 Sep 2011 09:20 PM PST
Top Contributor
25 Forum Posts

hardware: 3684 dvk 

the external logic contains a mega8535 (avr) porta of which is connected to 74ls245(data_buffer) and to fd0 to fd7

portd of avr is used for fifo control pins (sloe, slrd, fifoadr[0-1], ...) and connected to them through a 74ls245 (control_buffer), portc is connected to LCD 16*2 , portb.0 is connected to an led to blink to show the device is working.



Re: Read endpoint data using external logic

ragers posted on 06 Sep 2011 09:57 PM PST
Top Contributor
25 Forum Posts

sorry it may be a hardware problem!!!!!!!! 



Re: Read endpoint data using external logic

ragers posted on 07 Sep 2011 09:50 PM PST
Top Contributor
25 Forum Posts

Hi

it was not hardware problem!!!

I checked it with logic analyzer all the signals are passed correctly to the 3682 board but it still gives the same data.

dscr.a51 priph.c and usbGet.bas(program for external logic) are attached.

thanks in advance.



Re: Read endpoint data using external logic

ragers posted on 10 Sep 2011 08:41 PM PST
Top Contributor
25 Forum Posts

Dear Prajith

files attached is there any thing wrong? 



Re: Read endpoint data using external logic

PRJI posted on 12 Sep 2011 05:02 AM PST
Cypress Employee
333 Forum Posts

Hi,

     Are you using inverted IFCLK signal?

     Have you configured FLAGC as Empty flag?

     What is the configuration for EP6, 2x or 4x?

     Please try with the attached code. I used FLAGD for checking status (Empty) of EP2.

Regards,

Prajith



Re: Read endpoint data using external logic

ragers posted on 13 Sep 2011 03:21 AM PST
Top Contributor
25 Forum Posts

Dear Prajith 
 

I used your code and guidance just added a OUTPKTEND=0x82 after FIFOs reset.

flagc is Working currectly as empty flag.

Now it works great. thank you very much. 






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