Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21611 Discussions

Some issue on FT2232H in Synchronous FIFO

Altera_Forum
Honored Contributor II
2,455 Views

Hello everyone! 

I have some troubles with the FTDI chip.  

I use it in this way: FPGA+FT2232H on custom board and PC Application on the other side. All stuff using in Synchronous FIFO mode. So from now I’m trying to send a byte command from FPGA and catch it in the windows application. And here is the problem. I didn’t saw errors or warnings it just not working. Maybe someone have the same problem as I have. 

Well here is my VHDL code in the key of write operation(all ports have the same name as in the datasheet): 

WRITE_STR: process (CLK, TXE, RST) begin if (RST = '0' OR RD_CONTROL <= "00") then WR_CONTROL <= '1'; data_tx <= "00000000"; elsif ((CLK'EVENT) and (CLK='1')) then if (TXE = '0' and RD_CONTROL <= "11") then WR_CONTROL <= '0'; data_tx <= "01101011"; else WR_CONTROL <= '1'; end if; end if; WR <= WR_CONTROL; ADBUS <= data_tx; end process WRITE_STR; 

 

And it is simulating right as I see (pic 01.jpg). 

 

PC application. I use Visual C# 2010 i'm a new one here, so. 

Here is the settings after the chip is opened: 

ftStatus = myFtdiDevice.SetBitMode(0x00, FTDI.FT_BIT_MODES.FT_BIT_MODE_RESET); Thread.Sleep(10); ftStatus = myFtdiDevice.SetBitMode(0xFF, FTDI.FT_BIT_MODES.FT_BIT_MODE_SYNC_FIFO); if (ftStatus != FTDI.FT_STATUS.FT_OK) return false; ftStatus = myFtdiDevice.SetLatency(0x10); ftStatus = myFtdiDevice.InTransferSize(10000); ftStatus = myFtdiDevice.SetTimeouts(0, 0); ftStatus = myFtdiDevice.SetFlowControl(FTDI.FT_FLOW_CONTROL.FT_FLOW_RTS_CTS, 0x0, 0x0); ftStatus = myFtdiDevice.Purge(FTDI.FT_PURGE.FT_PURGE_RX); Thread.Sleep(10);  

I'll trying to change Flow Control to 0x11, 0x13 nothing happened. Change TheTransferSize and TimeOuts still the same. 

 

Here writting code by clicking on button, app must read one byte: 

private void button1_Click_1(object sender, EventArgs e) { FTDI.FT_STATUS ftStatus = FTDI.FT_STATUS.FT_OK; UInt32 RxBytes = 0; myFtdiDevice.GetRxBytesAvailable(ref RxBytes); if (ftStatus != FTDI.FT_STATUS.FT_OK) { textBox2.Text += "FTDI.GetRxBytesAvailable failed"; return; } Byte ByteRead = new Byte; UInt32 BytesRead = 0; myFtdiDevice.Read(ByteRead, RxBytes, ref BytesRead); if (ftStatus != FTDI.FT_STATUS.FT_OK) { textBox2.Text += "FTDI.Read failed"; return; } else { textBox2.Text += "Reading data is " + Encoding.UTF8.GetString(btRead) + " from FPGA" + Environment.NewLine; // well, for example }  

 

In the other hand if i use terminal in the Morph-IC-II Application after the FPGA is will be programmed and USB cable already plug in you can see pic 02.jpg. 

Can someone explane to me how does this happen?
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
1,274 Views

Check TXE and RXF on either edge, not only on rising edge 

 

http://electro-logic.blogspot.it/2014/03/fpga-comunicazione-ad-alta-velocita_1.html
0 Kudos
Altera_Forum
Honored Contributor II
1,274 Views

 

--- Quote Start ---  

Check TXE and RXF on either edge, not only on rising edge 

 

http://electro-logic.blogspot.it/2014/03/fpga-comunicazione-ad-alta-velocita_1.html 

--- Quote End ---  

 

Can you explain more about it? 

I didn't get
0 Kudos
Altera_Forum
Honored Contributor II
1,274 Views

Example: 

if ((CLK'EVENT) and (CLK='1')) then 

if (TXE = '0') ... 

end if 

 

shoud became 

 

if (TXE = '0') ... 

 

read the article..
0 Kudos
Reply