Bitcoin Forum

Bitcoin => Hardware => Topic started by: makomk on April 26, 2012, 10:28:42 AM



Title: FPGA-to-USB interface for mining
Post by: makomk on April 26, 2012, 10:28:42 AM
For the past few weeks I've been mining by hooking my DE0-Nano up to my PC directly via USB - no JTAG or microcontrollers or USB-to-serial, just full speed native USB. The code to do this has actually been publicly available in my git repository for about that long too, but I'm not entirely happy with it for various reasons. The licensing on the USB function core from OpenCores it uses is a bit odd, the code quality isn't that great, and I'm interfacing the FPGA pins directly to the USB port when I should really be using something like a TUSB1106 chip (http://www.ti.com/product/tusb1106) for better reliability and to protect the FPGA from being damaged by shorts to +5V.

Anyway, if anyone's got a use for this the Quartus project is in the projects/DE0_nano_USB directory (http://www.makomk.com/gitweb/?p=Open-Source-FPGA-Bitcoin-Miner.git;a=shortlog;h=refs/heads/de0-nano-usb) of the de0-nano-usb branch, and the code to mine using this is in the usb-miner branch of afpgabm (http://www.makomk.com/gitweb/?p=afpgabm.git;a=shortlog;h=refs/heads/usb-miner). You'll need to connect USB ground directly to pin 30 of JP1 on the DE0-nano, D+ to pin 25 and D- to pin 23 through say 10 to 47 ohm resistors (not sure what the exact resistor value should be), and connect a 1.5k pull-up resistor from D+ to a source of 3.3V that's only enabled when the 5V USB power is on. Better yet, rip out the fake USB transceiver logic from fpgaminer_top.v and use a TUSB1106 or similar. Users of expensive Spartan-6 boards should always use a real transceiver chip, partly to stop your hardware getting damaged and partly because some of them run on non-USB-compatible IO voltages that need to be converted.


Title: Re: FPGA-to-USB interface for mining
Post by: dirtycat on April 26, 2012, 10:57:28 AM
how hot does the little de0 get.. hot enough to take off the plastics and add a heatsink?


Title: Re: FPGA-to-USB interface for mining
Post by: makomk on April 26, 2012, 12:47:14 PM
how hot does the little de0 get.. hot enough to take off the plastics and add a heatsink?
Definitely. Also, the power regulation circuitry on it's horribly inefficient and I'm not sure it can cope with full-speed mining - I'm actually running a modified board with an external power supply. To be honest, it's probably not worth the effort for mining on. The only reason I run one is for development purposes.


Title: Re: FPGA-to-USB interface for mining
Post by: abeaulieu on May 01, 2012, 12:58:40 PM
how hot does the little de0 get.. hot enough to take off the plastics and add a heatsink?
Definitely. Also, the power regulation circuitry on it's horribly inefficient and I'm not sure it can cope with full-speed mining - I'm actually running a modified board with an external power supply. To be honest, it's probably not worth the effort for mining on. The only reason I run one is for development purposes.

If you haven't already it probably would be pretty easy to modify the input to the 1.2V regulator powering the FPGA and give it something closer to the 1.2V that it wants. Right now it takes the input voltage -> 5V -> 3.3V -> 1.2V. And it's done with just regulators (so 1Amp of current from the 1.2V translates to 1Amp of current from the input voltage). [See page 25 of the user manual]


Title: Re: FPGA-to-USB interface for mining
Post by: makomk on May 01, 2012, 11:26:56 PM
If you haven't already it probably would be pretty easy to modify the input to the 1.2V regulator powering the FPGA and give it something closer to the 1.2V that it wants. Right now it takes the input voltage -> 5V -> 3.3V -> 1.2V. And it's done with just regulators (so 1Amp of current from the 1.2V translates to 1Amp of current from the input voltage). [See page 25 of the user manual]
Yeah, I considered that after noticing the handy removable jumpers on the inputs to the regulators (intended for current measurement, I believe) - ended up just disabling the 1.2V regulator totally and feeding it from an external buck converter board (http://www.makomk.com/2011/10/06/de0-nano-power-efficiency-mod/) though.