Forum Discussion

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

FTDI FT2232H Sync FIFO + FPGA

Hi guys,

I'm using Morph-IC II and i'm having problems establishing the usb-communication between my Cyclone 2 and the FTDI FT2232H.

My objective is to send a start/reset signal from PC->FPGA, then access the data from the FPGA till an end/reset signal.

My problem is now the combination of sending/receiving.

I configured the FTDI in Synchronous FIFO Mode(getting the 60MHz clk) and it works fine when i send only in 1 direction.

This task has not to be parallel,it should go like this:

PC->START->FPGA switch to read

FPGA->DATA->PC switch to write

PC->STOP->FPGA

(VHDL)

To achieve this I have a state machine for sending and one for receiving. These 2 are working fine when i only use one and comment out the other...

By the way,if I comment out only the line where i access the data it works also,but without data not very useful^^

I dont know exactly how i should switch between the write/read state machines...right now i react on RXF low,which indicates that the FTDI(PC)

has data to send,because the PC sends only start/stop/reset-commands,i prefer these.

On PC(C#) side I use the D2XX-drivers. Init the Module and use SetBitMode to go into Synchronous FIFO,then read/write with the FTDI-functions.

I've read something about configuring the data-pins as in/output with the SetBitMode-Mask,but i didn't made progress using this.

Has anyone of you done this before and can help me? Is it possible to serial read/write in this mode or only 1 direction possible?

Any hints are welcome :), if you need more informations,code,... just say

Thank you very much for help,

Best Regards,

Andreas

15 Replies

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

    --- Quote Start ---

    Hi JP,

    Sure. I'm in the process of writing a MATLAB .mex interface to the binary version of the protocol, which will allow the highest performance. Once I get that working, I was going to update the documentation, and make sure the _hw.tcl files worked independently of my revision system, eg., an unzipped version of the library could be used directly.

    If you want to use the current version of the code ASAP, just email me and I'll send you the code. If you want to wait until next week, I should have the code updated and documented. At that point, I'll post the code here, or on the Altera Wiki for all to use.

    Cheers,

    Dave

    --- Quote End ---

    Dear Dave Hawkins,

    let me first introduce myself.

    I am Michele Ricci, a master degree student in electronic engineering at Politecnico di MIlano. I am currently working on my master thesis and one of my tasks is to interface a spartan6 with a FT232H chip in a 245 synchronous style. I' ve found on a altera forum a thread about this topic and i've seen the notes that you posted about it. I was wondering if you mind sharing with me your vhdl/verilog code for the communication (basically the blocks described at page 24 of your notes), that could really make my work easier and, most of all, faster.

    Thank you in advance if you accept to do this, if not i must however thank you for the notes , wich i' ve found extremely detailed and clear.

    Best Regards,

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

    Hello Michele

    Have you seen http://electro-logic.blogspot.it/2014/03/fpga-comunicazione-ad-alta-velocita_99.html?m=1 (http://electro-logic.blogspot.it/2014/03/fpga-comunicazione-ad-alta-velocita_99.html?m=1)?

    Ciao!

    --- Quote Start ---

    Dear Dave Hawkins,

    let me first introduce myself.

    I am Michele Ricci, a master degree student in electronic engineering at Politecnico di MIlano. I am currently working on my master thesis and one of my tasks is to interface a spartan6 with a FT232H chip in a 245 synchronous style.I am wondering if you mind sharing with me your vhdl/verilog code for the communication (basically the blocks described at page 24 of your notes), that could really make my work easier and, most of all, faster.

    Thank you in advance if you accept to do this, if not i must however thank you for the notes , wich i' ve found extremely detailed and clear.

    Best Regards,

    MIchele Ricci

    --- Quote End ---

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

    great! very useful and detailed, there is also the pc_side part! really thank you! ciao!

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

    Ciao Michele, sentiti libero di contattarmi per qualunque cosa,

    Ciao