Interface FPGA woth laptop - Page 1
Forum section: electronics / general

author: gauravmp
author_rank: Regular Contributor
timestamp: June 23, 2016, 04:01:02 pm
content: Hi,I'm trying to interface an FPGA(MAX10) with my laptop so I could read data using something like putty.Could someone give me some pointers on how to do it? Say chips needed, and what might be the best protocol to follow. Stuff like that.Thanks

author: nctnico
author_rank: Super Contributor
timestamp: June 23, 2016, 04:03:06 pm
content: An easy way is to implement a UART and use an USB-UART converter to have a communication channel. From there you can make the actual communication as complicated (using a softcore CPU) or simple (using a statemachine) as you want.

author: rstofer
author_rank: Super Contributor
timestamp: June 23, 2016, 04:07:33 pm
content: How much data has to move and how long can it take?

author: gauravmp
author_rank: Regular Contributor
timestamp: June 23, 2016, 04:09:12 pm
content: thanks for the replies. I'm not looking to move a lot of data. Something like 5-6 bytes per second is good enough. I'm sure most protocols handle that.

author: legacy
author_rank: Super Contributor
timestamp: June 23, 2016, 04:12:03 pm
content: Quote from: gauravmp on June 23, 2016, 04:01:02 pmin order to do what?char oriented?stream oriented?

author: gauravmp
author_rank: Regular Contributor
timestamp: June 23, 2016, 04:15:19 pm
content: So i'll have a few components like ADCs hooked up to the FPGA and I'll want to read the data that is being put out by the ADCs on a laptop.

author: Scrts
author_rank: Frequent Contributor
timestamp: June 23, 2016, 06:21:41 pm
content: I'd offer FT2232:http://www.grigaitis.eu/?p=640

author: chickenHeadKnob
author_rank: Super Contributor
timestamp: June 23, 2016, 08:45:29 pm
content: Along the same lines as the FT2232 are cypress semi EZ-USB FX2 and FX3 which give a usb 2.0 and 3.0 connection to a parallel bus. Cypress gives some ap-notes . Note that usb can have good through-put but it is not so good for closed loop real-time latency with the laptop processor.cypress:http://www.cypress.com/products/superspeed-usb-peripherals

author: Scrts
author_rank: Frequent Contributor
timestamp: June 23, 2016, 09:01:15 pm
content: Quote from: chickenHeadKnob on June 23, 2016, 08:45:29 pmTo my understanding, you'd still need to write:1) FX2 or FX3 firmware2) Windows side softwareWhile with FT2232 you have 8bit bus with FIFO plus UART interface on Windows or Linux. It depends on the bandwidth though.

author: nctnico
author_rank: Super Contributor
timestamp: June 23, 2016, 09:04:39 pm
content: The OP wants to use Putty so using a UART is kind of mandatory to allow an easy connection (using existing drivers) on the PC side. Using an FPGA UART also solves quite a few clock domain crossing issues.

author: uncle_bob
author_rank: Unknown
timestamp: June 23, 2016, 11:59:46 pm
content: HiGet one of the FTDI or equivalent cables with a 0.1" header on it. Header connects to FPGA pins. USB end of the cable goes to the PC. FPGA implements a UART to get the data out to the FTDI serial in and serial out. As long as you have some sort of rational clock on the MAX 10 it is a pretty easy thing to do.Bob

author: chickenHeadKnob
author_rank: Super Contributor
timestamp: June 24, 2016, 02:06:45 am
content: Quote from: Scrts on June 23, 2016, 09:01:15 pmQuoteI have to to agree with you guys. For the original poster's low data rate requirements a usb to serial chip is a better fit, easier to implement and cheaper. The only frustrating constraint to a uart alone is that you are limited to the amount of out of band signaling you can effect through DTR/RTSpins. I suspect the FT2232 wins there with the extra interfaces, haven't used that chip.

author: Kalvin
author_rank: Super Contributor
timestamp: June 24, 2016, 10:19:59 am
content: Serial port is a simple interface, as others have already suggested. So, use a off-the-self USB-to-serial converter chip or USB-to-serial "cable" (RX, TX, GND, optional power supply). No special drivers needed for the popular operating systems, well known performance and low part count.Consider a freely available soft-core CPU inside the FPGA or an external CPU which handles the serial protocol. Check the Internet for reference solutions. The CPU solution will also give flexibility if you need some on-board data processing. Select a CPU that has a ready-to-use C toolchain, so you can get up and running fast.Of course you can implement the serial protocol and data processing on the FPGA using a state machines etc. if your application is straightforward and doesn't need to be changed often.

author: legacy
author_rank: Super Contributor
timestamp: June 24, 2016, 11:45:31 am
content: Quote from: chickenHeadKnob on June 23, 2016, 08:45:29 pmthis is interesting for my debug-engine, which is currently limited between 1 and 3Mbyte/sec over USB-serial and a custom protocol I have created in VHDL (the host side is linux, and it comes with C sources, common serial under Unix plus customized handlers and protocol)it would be cute to have a parallel approach which boosts the performances up to 10Mbyte/sec at least, in order to support a RAM emulatorprototypes ? costs ?

author: uncle_bob
author_rank: Unknown
timestamp: June 24, 2016, 01:00:28 pm
content: Quote from: Kalvin on June 24, 2016, 10:19:59 amHiFor a "data out of the FPGA" sort of application, there is no real need for a full CPU. A simple shift register is about all you need. Even if you want to do binary to hex, that's not much more work. Much easier to get up and running than a full soft core....Bob

author: Kalvin
author_rank: Super Contributor
timestamp: June 24, 2016, 01:20:16 pm
content: Quote from: uncle_bob on June 24, 2016, 01:00:28 pmYou are right, as the application is just as simple as glue or simple bridge between the ADC and PC.

author: gauravmp
author_rank: Regular Contributor
timestamp: June 24, 2016, 02:48:59 pm
content: Thanks a lot guys! I found an FTDI232 that worked for me for a PIC, so I'm trying to now get it to work for the MAX10

author: tszaboo
author_rank: Super Contributor
timestamp: June 24, 2016, 02:56:29 pm
content: But cannot you just do it with the programming interface? Which is already there?

author: nctnico
author_rank: Super Contributor
timestamp: June 24, 2016, 03:05:02 pm
content: Be sure to add a loop-back possibility to that FTDI232. It may not work if the driver thinks it is a fake so to save yourself a lot of trouble connect RX&TX on the FT232 to see if you receive the data you are transmitting.

author: chickenHeadKnob
author_rank: Super Contributor
timestamp: June 24, 2016, 07:25:22 pm
content: Quote from: legacy on June 24, 2016, 11:45:31 amFor the FX3 Cypress has the development board at US$ 395 and the more affordableexplorerkit at $49:http://www.cypress.com/documentation/development-kitsboards/cyusb3kit-003-ez-usb-fx3-superspeed-explorer-kitthey claim something like 320 Mbyte/sec sustained.

author: NiHaoMike
author_rank: Super Contributor
timestamp: June 27, 2016, 04:28:49 am
content: There's also the $30 Leap Motion that has a FX3 inside along with an infrared sensor array. The sensor is on its own board so it is easy to remove.But for 10MB/s, USB 2.0 will do. Or even 100Mb Ethernet. The cheapest option might be to take an old switch or router and reconnect the MII lines on the Ethernet controller to the FPGA. (Even a broken one can be used as long as the Ethernet part works.)