Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

FTDI FIFO mode, software control

Status
Not open for further replies.

peter.m

Newbie level 4
Joined
Oct 28, 2012
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,339
Hello,

I have a problem with controll my device through FT2232H. I use Visual C# and FTD2XX_NET.dll to set it in Synchronous FIFO mode. My app works. I can send data to my board (there is FPGA, not uC, but I see here is the biggest amount of people using FTDI chips).

My problem is to separate some command data generated when user press button GUI from real valid data that should be sent to device.
I thought about some frames. Command are always 9 bytes long. Then is always a lot of data. I use:
Code:
FTD2XX_NET.FTDI.Write(System.Byte[],System.UInt32,System.UInt32@)
function to write data with the fisrt argument: 16384 bytes data buffer, because this setting seems to be the most efficient in speed sense.

How do you do such a things? Should I set always the first 9 of 16384 bytes reserve for command value? Or that frame should be shorter/longer (because of USB frames split)? And then on device side I should count received bytes?

I thought also about something like: send 9 bytes of command --> send all the data --> if there is nothing more incoming for "some time", the next incoming 9 bytes are the next command. But is it possible to predict this "some time"? I suppose there are some small breaks even when one data chunk (16384 bytes) is sent, that means when Write function is once executed. And then breaks between that executions... Isn't it to primiive solution?

I have never made anything like this. No idea which way I should try to solve such a problem. Any hints are welcomed.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top