Own PCI(e) Module, where to start? - Page 1
Forum section: electronics / projects

author: Unknown
author_rank: Unknown
timestamp: August 13, 2013, 01:25:22 am
content: Lets assume i have an idea to build own hardware which will operate from PCI/PCIe bus.How does the communication between hardware and PCI works? Is there any FTDI-like chip, which handles the communication process? Should i also write my own drivers for windows?Does anyone did it before, or is it much more complicated then i think?=)

author: shant
author_rank: Newbie
timestamp: August 13, 2013, 01:50:00 am
content: if im not mistaken the pcie lanes are controlled either by the chipset of the motherboard or the south bridge, bios may have a role too, that again im not sure

author: lgbeno
author_rank: Frequent Contributor
timestamp: August 13, 2013, 01:52:06 am
content: I've done this beforeSent from my iPhone using Tapatalk 2

author: lgbeno
author_rank: Frequent Contributor
timestamp: August 13, 2013, 01:55:15 am
content: Quote from: lgbeno on August 13, 2013, 01:52:06 amsorry I bumped the send button while typing.There are some chips that do this bridging to different interfaces. I would say the easiest is to use an FPGA like Altera Cyclone IV GX. It has hardened pice gen 1 controller on it and bridges to the Avalon bus. From there you can memory map per upticks and talk to them using a driver software like jungo. Best thing is to by a dev kit though. PCIe layout isn't trivial.Sent from my iPhone using Tapatalk 2

author: Psi
author_rank: Super Contributor
timestamp: August 13, 2013, 02:01:05 am
content: Depends if you really need pcie bandwidth or you just need your device to be a card that will plug into the pcie socket?If the latter then you could quite easily use a pcie->usb chip connected to a FT232RL. (or maybe a pcie->com chip if you can find one)That way your PCIe card would communicate like a regular com port and the OS would have all the drivers already.

author: ovnr
author_rank: Frequent Contributor
timestamp: August 13, 2013, 02:06:16 am
content: First off, to clarify: For most intents and purposes, you can "easily" (dedicated chip, but all the same) convert between PCI and PCIe - it's just a different hardware layer. Unless you need the bandwidth advantages of PCIe, stay clear - unless you fancy laying out differential pairs running at up to 5 GHz, that is.(And yes, you will need to write your own drivers - and, if you plan to run it on x64 Win7 and above, get them signed)PCI itself is a reasonably simple 32-bit parallel bus (read morehere), and if your hardware already runs a 32-bit databus, attaching it should be acceptably easy - I imagine you could get by with a CPLD. There may be dedicated chips for this.If you're piddling along with an 8-bit micro, just forget it - there isn't a "PCI to SPI with happy fluffy bunny pins bridge" you can plop on there which takes care of everything. If you absolutely want to do a PCI card and don't actually require any of the PCI features (bandwidth, latency, etc), you could probably plop a PCI to serial/parallel converter chip on there, and take it from there. Note that getting one might be hard, and you may have to do creative things to accomplish it. (... like desolder parts from commercial boards)tl;dr - Unless you can say "Yes, PCI is something my project NEEDS and CANNOT do without", stick with something comparatively easy, like USB. If you just want an internal card and don't want to do volume production, just plug it onto one of the USB headers on your motherboard - you can still put a PCI slot on one end for mounting & power purposes.

author: marshallh
author_rank: Unknown
timestamp: August 13, 2013, 02:19:20 am
content: What are you bandwidth requirqements. Is this a one-off or production?

author: free_electron
author_rank: Super Contributor
timestamp: August 13, 2013, 02:40:05 am
content: SMSC has a number of PCI controllers that bring out basically a memory and address bus. you can do the same with several FPGA's.you will need to create a driver. the easiest way is using the Jungo toolchain. but its not free. costs quite a bit of money actually.PCI is not for beginners. the design criteria are pretty tight. board layout , termination etc is not easy. PCIx is even more critical.

author: Stonent
author_rank: Super Contributor
timestamp: August 13, 2013, 03:19:58 am
content: Seems to me that PLX has a number of chips for this.

author: lgbeno
author_rank: Frequent Contributor
timestamp: August 13, 2013, 04:15:44 am
content: When I looked into it, it seemed that drivers in Linux were pretty straight forward (we didn't go this direction though so I don't know all of the details).The win 7 + Jungo stuff was scary easy for a simple interface, it ended up costing more >5k. On a enterprise level, Jungo would pay itself back a 10x on the engineering costs though. Not really going to work for a hobbyist...I forget what the limitations are for trial, might be forgiving for 1 off projects, I can't remember...Plx seems very popular too, I see it a lot of industrial CAN cards and stuff like that. I just wonder if they are easy to purchase I. Small quantities.On the layout side, I guess it is not the worst, really the 1x interface is just a few diff pairs but then all of the other stuff that comes with like power supplies, crystals, etc starts to take its toll.This is the most basic pcie FPGA board that I've used:http://devboards.de/startseite/boards/produkte-details/article/db4cgx15/I think it is only available in Germany so we had to import it from our German office.Sent from my iPhone using Tapatalk 2

author: NiHaoMike
author_rank: Super Contributor
timestamp: August 13, 2013, 05:14:10 am
content: Best bet involves using a FPGA. Unless you really need the bandwidth, stick with USB.

author: Unknown
author_rank: Unknown
timestamp: August 13, 2013, 06:23:38 am
content: Well, i am just working in the lab, and all cool acquisition modules are working from PCI slot.SO i thought, how hard is it to design own module...now i see it is really hard:)

author: amyk
author_rank: Super Contributor
timestamp: August 13, 2013, 07:26:20 am
content: If you are curious about the protocol you can Google for the spec. PCI is parallel and not that much more complex than ISA.Here is someone who has managed to make a (not fully spec compliant, but works) PCI GPIO card from discretes:http://elm-chan.org/works/pci/report_e.html

author: Alexei.Polkhanov
author_rank: Frequent Contributor
timestamp: August 13, 2013, 05:48:45 pm
content: I looked at at some reference designs on Altera website. Hardware-wise I think it can be as simple as having to route differential I/O pin pairs (you can see them on pin planner) to pci card edge. Rest is Verilog coding.http://www.alterawiki.com/wiki/PCI_Express_in_Qsys_Example_Designs?GSA_pos=6&WT.oss_r=1&WT.oss=pci%20reference%20design. andhttp://www.altera.com/literature/hb/cyclone-iv/cyiv-52001.pdfI guess whole point of exercise is to implement DMM (Direct Memory Access) in the FPGA to get the maximum performance. Link to the Linux kernel module is provided at the bottom of first page.I would try to start with simple PCIe card and single Cyclone IV GX, and experiment with it. Altera has PCIe controller as part of QSYS. Unfortunately GX only comes in BGAAs far as I understand you only have to length match tracks that belong to same differential pair. AC coupling caps are needed. Signal integrity can be a problem but Cyclone appear to have way to tweak the parameters of diff transeivers afterwards programmatically. There is plenty of info on how to and not to route diff pairs for PCIe on internet.

author: nctnico
author_rank: Super Contributor
timestamp: August 13, 2013, 09:34:43 pm
content: A designed an FPGA based PCI interface about 10 years ago. I used the core from Xilinx but even with the core its pretty complex and I never got to getting the DMA to work because the guy who wrote the driver was too busy.The easiest way is using a PLX chip which offers a parallel bus. PLX also has chips to bridge PCIe to PCI so converting a legacy PCI design to PCIe is a piece of cake with one of those chips.

author: Stonent
author_rank: Super Contributor
timestamp: August 13, 2013, 11:02:17 pm
content: Pretty much any time that I've seen an old card converted to a new bus on a PC, I've seen a PLX chip.

author: Unknown
author_rank: Unknown
timestamp: August 14, 2013, 08:15:47 am
content: Hmm...then i'll take a look at this PLX