Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
11 years ago

DE2 115 : Trying to send/receive usb bulk data from ISP1362 to FTDI 232H chip

Hi everyone,

I'm trying to use the isp 1362(host mode) with nios2 to communicate with a FTDI 232H chip (bulk transfer mode supported only).

Everything is fine, i can get the descriptor of the FTDI chip and i'm connected in full speed mode . (VID, PID, MaxPacketSize etc..)

VID = 0x403

PID = 0x6014

MaxPckt = 0x40

There is a PTD.c file provided by Terasic with multiple methods to handle all 4 usb transfert modes which are :

-send_iso for isochronous

-send_int for interrupt

-send_control for control

-send_ptl (what is that?)

I just want to send a byte in bulk mode (ie 0xAA)

What is the right way to do this?

i would say i should make a ptd with "void make_ptd(int *rptr,char token,char ep,int max,char tog,char addr,char port)"

But what should i put in the rptr[4], rptr[5], rptr[6] and rptr[7]? Is there a special code to put next the ptd to do an OUT transfer like in Control transfer? Or should i just put the data after the ptd?

Well i'm quite lost for now...

If any got the solutions..

And thanks to you for your concern. :rolleyes:

Ps: it's mandatory for me to use the isp1362 with nios2

13 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    In answer to your questions:

    The USB standard does not require that all control operations be implemented. For example, a chip that has only one configuration probably won't implement get configuration because the answer would always be the same.

    The usage of each endpoint should be documented in the datasheet or users guide for the device. Some are documented in USB standards, i.e. endpoint 0 is for control.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi people,

    i suspended my studies on usb for some weeks but i'm back again, and unsurprisingly i got issues cause i'm not a good boy, hoping you will answer me :

    - My system waits 2 bytes of command from isp so i prepare an OUT ptd like this

    {x800; x2040; x402; x2; x240} the last word is the payload (command)

    As a response (ACK?), i get {x402;x2040;x402; x2; x240} (is this an acknowledge?i guess yes) Actual bytes transferred is @2, so it's nice

    - I want it to send me back awaited data so i prepare an IN ptd like this

    {x800; x1040; x804 ; x2} this time no payload but i need to tell him how many bytes i want to receive here 4 (i don't know if it's the right way)

    As a response, i get {x9402; x1040; x804; x2; x6031; F7EB}

    oh my god, what is that? code 9 is for underrun, 2 bytes received in the payload but 4 actually ? This is not what i want.

    -Ok let's toggle it and send back the IN ptd again. Oh no same things.

    -3rd time, toggle it again? Would you work please?

    Geez, i get {x8000; x1040; x804; x2; x6031; x3412}. x1234ABCD is the payload i wanted, but why this x6031 is still there? I looked after it on usb spec, is that a PID response?

    3 = DATA0

    1 = OUT

    6 = Not Acknowledge Yet

    0 = reserved

    I don't know....

    Tell me if i missed something important here. :-/