Author Topic: Interface FPGA woth laptop  (Read 5023 times)

0 Members and 1 Guest are viewing this topic.

Offline gauravmpTopic starter

  • Regular Contributor
  • *
  • Posts: 77
  • Country: us
Interface FPGA woth laptop
« on: June 23, 2016, 04:01:02 pm »
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
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: Interface FPGA woth laptop
« Reply #1 on: June 23, 2016, 04:03:06 pm »
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.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 
The following users thanked this post: gauravmp

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Interface FPGA woth laptop
« Reply #2 on: June 23, 2016, 04:07:33 pm »
How much data has to move and how long can it take?
 
The following users thanked this post: gauravmp

Offline gauravmpTopic starter

  • Regular Contributor
  • *
  • Posts: 77
  • Country: us
Re: Interface FPGA woth laptop
« Reply #3 on: June 23, 2016, 04:09:12 pm »
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.
 

Offline legacy

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Interface FPGA woth laptop
« Reply #4 on: June 23, 2016, 04:12:03 pm »
read data

in order to do what?
char oriented?
stream oriented?
 

Offline gauravmpTopic starter

  • Regular Contributor
  • *
  • Posts: 77
  • Country: us
Re: Interface FPGA woth laptop
« Reply #5 on: June 23, 2016, 04:15:19 pm »
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.
 

Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: lt
Re: Interface FPGA woth laptop
« Reply #6 on: June 23, 2016, 06:21:41 pm »
 
The following users thanked this post: gauravmp

Offline chickenHeadKnob

  • Super Contributor
  • ***
  • Posts: 1055
  • Country: ca
Re: Interface FPGA woth laptop
« Reply #7 on: June 23, 2016, 08:45:29 pm »
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
 
The following users thanked this post: gauravmp

Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: lt
Re: Interface FPGA woth laptop
« Reply #8 on: June 23, 2016, 09:01:15 pm »
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

To my understanding, you'd still need to write:
1) FX2 or FX3 firmware
2) Windows side software

While with FT2232 you have 8bit bus with FIFO plus UART interface on Windows or Linux. It depends on the bandwidth though.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: Interface FPGA woth laptop
« Reply #9 on: June 23, 2016, 09:04:39 pm »
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.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline uncle_bob

  • Supporter
  • ****
  • Posts: 2441
  • Country: us
Re: Interface FPGA woth laptop
« Reply #10 on: June 23, 2016, 11:59:46 pm »
Hi

Get 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
 
The following users thanked this post: gauravmp

Offline chickenHeadKnob

  • Super Contributor
  • ***
  • Posts: 1055
  • Country: ca
Re: Interface FPGA woth laptop
« Reply #11 on: June 24, 2016, 02:06:45 am »
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

To my understanding, you'd still need to write:
1) FX2 or FX3 firmware
2) Windows side software

While with FT2232 you have 8bit bus with FIFO plus UART interface on Windows or Linux. It depends on the bandwidth though.

Quote
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.

I 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/RTS
pins. I suspect the FT2232 wins there with the extra interfaces, haven't used that chip.
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: Interface FPGA woth laptop
« Reply #12 on: June 24, 2016, 10:19:59 am »
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.
 

Offline legacy

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Interface FPGA woth laptop
« Reply #13 on: June 24, 2016, 11:45:31 am »
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

this 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 emulator :D

prototypes ? costs ?
 

Offline uncle_bob

  • Supporter
  • ****
  • Posts: 2441
  • Country: us
Re: Interface FPGA woth laptop
« Reply #14 on: June 24, 2016, 01:00:28 pm »
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.

Hi

For 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
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: Interface FPGA woth laptop
« Reply #15 on: June 24, 2016, 01:20:16 pm »
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.

Hi

For 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

You are right, as the application is just as simple as glue or simple bridge between the ADC and PC.
 

Offline gauravmpTopic starter

  • Regular Contributor
  • *
  • Posts: 77
  • Country: us
Re: Interface FPGA woth laptop
« Reply #16 on: June 24, 2016, 02:48:59 pm »
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
 

Online tszaboo

  • Super Contributor
  • ***
  • Posts: 7388
  • Country: nl
  • Current job: ATEX product design
Re: Interface FPGA woth laptop
« Reply #17 on: June 24, 2016, 02:56:29 pm »
But cannot you just do it with the programming interface? Which is already there?
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: Interface FPGA woth laptop
« Reply #18 on: June 24, 2016, 03:05:02 pm »
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.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 
The following users thanked this post: gauravmp

Offline chickenHeadKnob

  • Super Contributor
  • ***
  • Posts: 1055
  • Country: ca
Re: Interface FPGA woth laptop
« Reply #19 on: June 24, 2016, 07:25:22 pm »
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

this 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 emulator :D

prototypes ? costs ?

For the FX3 Cypress has the development board at US$ 395 and the more affordable explorer kit at $49:
http://www.cypress.com/documentation/development-kitsboards/cyusb3kit-003-ez-usb-fx3-superspeed-explorer-kit

they claim something like 320 Mbyte/sec sustained.
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9018
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Interface FPGA woth laptop
« Reply #20 on: June 27, 2016, 04:28:49 am »
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.)
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf