Advice for fpga programming - Page 1
Forum section: electronics / general

author: adige777
author_rank: Newbie
timestamp: April 04, 2018, 08:37:26 am
content: Hello everybodyI am newbee for fpga programming ,trying to make a project and I would like to use Artix-7 cmod 35T kit, vhdl and vivado.My goal is getting all required data from PC side over uart rx save datas bram or any other memory unit. After that I have to convert that received data as parallel format and send it via gpio pins. But this process must be very quick .To achieve this my plan is:1- Add a microblaze processor2- Uart lite module3- Add a bram module4- Add a axi gpio moduleGetting requied data from pc via uartlite module,write that received data to bram via microblaze. But after this stage I don't need to microblaze anymore. And I want to write received datas to gpio pinsas soon as possible. Is there a way to send datas in bram to axi gpio sequentially without using microblaze? Or can you advice me any other quick way to achive this purpose?Best regards

author: asmi
author_rank: Super Contributor
timestamp: April 04, 2018, 02:15:03 pm
content: I'm not exactly sure what are you trying to achieve. "UART" and "very quick" doesn't live well in a single sentence as UART is incredibly slow by FPGA standards.If it's some sort of bridge, I would implement it straight in the code without using any softcores or pre-made components, as it's very simple. Using softcore sounds like a total overkill in this case - unless I'm missing something. Not sure what would you need BRAM for thoughGive us some more details on what exactly you're trying to implement, and how quick is "very quick".

author: jamiechi
author_rank: Contributor
timestamp: April 04, 2018, 05:12:49 pm
content: Sounds like you are using an Arty board from Digilent. If I wanted to download serial data at high speed to my FPGA project, then I might use the EZ-USB FX3 devboard from Cypress. It has io pins that you could connect directly to your FPGA dev board and transfer the data at high speed. The board is currently available at Cypress and other distributers for around 50$ US.

author: NorthGuy
author_rank: Super Contributor
timestamp: April 04, 2018, 05:26:43 pm
content: When people who are somehow familiar with CPU/MCU are getting into FPGA, they tend to hold to want they know, so they build MicroBlaze, use the FPGA as MCU and feel good about it. However, FPGA is not MCU and to figure out what it is, the best way is to get rid of MicroBlaze or anything which remotely reminds you of MCUs, and start working with FPGA as with FPGA (as opposed to FPGA as MCU). Start from writing VHDL or Verilog code to blink a LED. UART to parallel is just few steps from LED blinking, however the link between PC and FPGA through FTDI chip is very slow, so leave all hope of making it quick.

author: asmi
author_rank: Super Contributor
timestamp: April 04, 2018, 05:28:58 pm
content: Quote from: jamiechi on April 04, 2018, 05:12:49 pmHe said he's usingcmod 35TQuote from: jamiechi on April 04, 2018, 05:12:49 pmThat is extremely wasteful way of doing this. FT601 is only about $10 and requires no programming of the chip. But that is if you need USB 3 speed. If USB 2 FS is good enough (and it certainly is for UART speeds), there is enough very cheap USB->UART ICs. My personal favourite is FT234XD because it's quite cheap (about $2 for single quantity) and is specialized to this specific function, meaning there is nothing to set up, pre-program, etc., and it's in tiny 3x3 mm 0.45 mm pitch DFN package. Or, if it's too small for you, FT230X is essentially same thing (and the price is the same too) with some more GPIOs exposed, and it's available in more "conventional" SSOP-16 and QFN-16 packages.

author: asmi
author_rank: Super Contributor
timestamp: April 04, 2018, 05:32:53 pm
content: Quote from: NorthGuy on April 04, 2018, 05:26:43 pmIt depends on how quick is "very quick"Quite a number of MCU folks I know think that 1Mbps is "very quick"FT-X'es I mentioned above support up to 3Mbps which is certainly quick for UART.

author: SiliconWizard
author_rank: Super Contributor
timestamp: April 04, 2018, 05:41:26 pm
content: Yeah define quick.FTDI's UART connection supports up to 3Mbps without a hitch.With asynchronous parallel mode, high-speed, you'll get ~8 MBytes/s.With synchronous parallel mode, high-speed, you'll get ~30 MBytes.s.I have no experience with USB 3.0, super-speed FTDI chips, but you may be able to get like 10 times this. Isn't that fast enough?As a note, to get that kind of speed out of a super-speed FTDI chip on an FPGA, it takes a seasoned HDL designer. Certaintly not for the beginner. But asynchronous parallel mode on a FT232H/FT2232H is reasonably easy.

author: asmi
author_rank: Super Contributor
timestamp: April 04, 2018, 06:15:23 pm
content: Quote from: SiliconWizard on April 04, 2018, 05:41:26 pmI have done some tests with FT601 and Artix-7 on my board - in 1 IN/1 OUT configuration I was getting about 330 MBytes/s of real bandwidth - meaning that was a rate I was actually getting the data from FTDI API, with all overheads are already factored in. So your assumption is about right.

author: NorthGuy
author_rank: Super Contributor
timestamp: April 04, 2018, 08:20:52 pm
content: You can easily do 3Mbaud on PIC16F1454, 6Mbaud is also possible to accomplish. Theoretically you can do 12Mbaud, but practically it is not very easy - I guess you might be able to do it in one direction (TX easier than RX, of course), but it would be a hard work.A solid MCU with DMA can probably go up to 50Mbaud or so.I think the FT2232H chip on the OP's board is only wired for UART which is spec'ed at 12Mbaud, so the best speed the UART can accomplish could be characterized as slightly above PIC16 levels.Of course, it's always possible to use exposed pins for a custom interfaces - then you can go much faster.