Read endpoint data using external logic

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

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

View solution in original post

0 Likes
8 Replies
Anonymous
Not applicable

Hi,

   

     Can you upload your code?

   

Regards,

   

Prajith

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

the code is for bascom:

0 Likes
Anonymous
Not applicable

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.

0 Likes
Anonymous
Not applicable

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

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

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.

0 Likes
Anonymous
Not applicable

Dear Prajith

   

files attached is there any thing wrong? 

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

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

0 Likes
Anonymous
Not applicable

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. 

0 Likes