Author Topic: DIY bitcoin miner for Avalon A3255-Q48 chips  (Read 59184 times)

0 Members and 1 Guest are viewing this topic.

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 7374
  • Country: nl
  • Current job: ATEX product design
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #25 on: January 13, 2014, 03:38:39 pm »
shop even claims it is in-stock and they don't do pre-orders anymore (says the FAQ), but would be really expensive, because of the minimum quantity of 2,500 pieces.
If I see it correctly, you can buy a reel for 15 bitcoin, which has the potential to generate the same amount of bitcoin in 22 days. Maybe I should investigate this more closely.
 

Offline vleo

  • Newbie
  • Posts: 5
  • Country: ru
    • Vleo's Blog
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #26 on: January 13, 2014, 04:23:11 pm »
... The cgminer source code for the avalon driver is more recent:

https://github.com/ckolivas/cgminer/blob/master/driver-avalon.c

Compared to the BFGminer source code, it has some additional #ifdefs for AVALON_A3255, for example for the nonce offset. I wonder if this works, because the datasheet says the offset is 0x180 and not 0xc0. And looks like it doesn't send the A0-A2 and E0-E2 words as mentioned in the datasheet. I wonder how this could work, or maybe the datasheet is wrong? Of course, the miner doesn't send it to directly the ASIC, but it is some USB device in between, maybe this does some more calculations and data conversions.
Thank you for the cgminer ref.
Not sure about the offset, but 0xC0 << 1 is 0x180 i.e. 1 bit shift... Now, in above mentioned thread about A3255 protocol, it's confirmed that:

"Received nonce is shifted about 0xC0"

The reference design schematics has only USB <-> serial port there, connected to FPGA. I hope they are not using FPGA for a0-a2,e0-e2 calculation. but in 15K LEs that could be done of course.
« Last Edit: January 13, 2014, 04:30:06 pm by vleo »
--- Vassili
 

Offline vleo

  • Newbie
  • Posts: 5
  • Country: ru
    • Vleo's Blog
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #27 on: January 14, 2014, 06:21:57 am »
I got a word from a developer of A3255-q48 based system (link above):

LSB (first bit, byte, word) [8B - Clock Config] , [12B - data], [4B a1],[4B a0],[4B e2],[4B e1],[4B e0], [32B midstate], [4B a2], [4B nonce - 0x00000000 - 1 Avalon chip]
"yes its correct for a3255-q48 each."
"Golden nonce for a3255 is received nonce - 0x180 , tested, work fine for me."

I think he will answer couple more meaningful questions if need be.

I still don't have a prototype board, doing the big board layout, will get to prototype (single chip test) after big one goes to manufacturing. I'm pretty sure A3255-q48 works fine, only have to figure out how :-)
--- Vassili
 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 7374
  • Country: nl
  • Current job: ATEX product design
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #28 on: January 14, 2014, 12:20:47 pm »
If I see it correctly, you can buy a reel for 15 bitcoin, which has the potential to generate the same amount of bitcoin in 22 days. Maybe I should investigate this more closely.

By the time you get them and build some hardware that will likely be months or even years. The difficulty is rising fast now.

We need Litecoin ASICs.

Well, years is a bit excessive. I mean the hardware is not complicated, it is basically 4 pins+pwer. Connect all 4 to an FPGA, conenct the FPGA to a serial-USB module, put a (some) POL module on the PCB, manufacture it on a four layer board. As I see, one chip only consumes 3-4W, so cooling with a 25K/W heatsink is easyliy done. I'm not sure about the leadtime of the ASIC, but everything else is doable in 1-2 month. If the FPGA development is concurrently made, you can mine in 2 months.
The bigger problem is that it requires full time commitment, and indeed, you can only mine so much bitcoin before it is not worth it anymore.
 

Offline FrankBussTopic starter

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #29 on: January 14, 2014, 11:44:42 pm »
I think he will answer couple more meaningful questions if need be.
This would be helpful. Not much more information so far than what is written in the datasheet. He says he has tested it. A full example would be very useful: "getwork" input, the calculated byte array which were sent to the chip and the returned nonce as a byte array. This would help to bugfix my source code. And with a known working byte array and expected nonce I could test the chip as well, maybe it is just broken.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline vleo

  • Newbie
  • Posts: 5
  • Country: ru
    • Vleo's Blog
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #30 on: January 15, 2014, 12:34:34 pm »
This would be helpful. Not much more information so far than what is written in the datasheet. He says he has tested it. A full example would be very useful: "getwork" input, the calculated byte array which were sent to the chip and the returned nonce as a byte array. This would help to bugfix my source code. And with a known working byte array and expected nonce I could test the chip as well, maybe it is just broken.

It seems that it would be better to present that getwork input, code that transforms it into the byte array sent, and then the byte array received with code that shows why it's incorrect and ask which stage input-output is incorrect.
--- Vassili
 

Offline FrankBussTopic starter

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #31 on: January 19, 2014, 01:34:28 am »
Ok, I found the problem, the new code is in the Github repository. The problem was that the sample code in the datasheet to calculate a0-a2 and e0-e2 needed the second SHA256 chunk, which of course you can only calculate, if you have already calculated the first chunk, which is needed for the midstate anyway. So this is a test vector, to check if an Avalon chip works, clock settings included, for 0.3 A:

Code: [Select]
22600017, 00000000, f1fc122b, c7f5d74d, f2b9441a, 2eb9cc59, ddc34729, db8ae7e1, 6cb85659, 9a431c20, 9524c593, 05c56713, 16e669ba, 2d2810a0, 07e86e37, 2f56a9da, cd5bce69, 7a78da2d, 41bda849, 42a14495

Each 32 bit word is sent lowest byte and lowest bit first. This was calculated from the following getwork "data":

Code: [Select]
00000001ab02cd818b9e567ee21793cddef299feb29ad444a41b85b8000008a300000000c2b620e3758dfcff8bdb2304ae42b91e1e950e71aff797d7b09288fc2b12fcf14dd7f5c71a44b9f200000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000

The Avalon chip should respond immediately with 0x42a14815 (and after 3 seconds and 17 seconds with two other values). You have to subtract 0x180 and then do a little-endian/big-endian swap to get the expected right nonce 0x9546A142.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline GiskardReventlov

  • Frequent Contributor
  • **
  • Posts: 598
  • Country: 00
  • How many pseudonyms do you have?
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #32 on: January 19, 2014, 07:35:21 pm »
According to that many ASIC miners are already worthless, incapable of ever breaking even if difficulty continues to rise at the predicted rate.

As mentioned, free electricity makes it profitable.
 

Offline GiskardReventlov

  • Frequent Contributor
  • **
  • Posts: 598
  • Country: 00
  • How many pseudonyms do you have?
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #33 on: January 19, 2014, 08:01:59 pm »
This is an interesting project, I've been watching bitcoin since end of 2011, I have a small amount from then. I used a de0-nano and a modified version of this https://github.com/progranism/Open-Source-FPGA-Bitcoin-Miner.  I recall I had overheat problems and had to tweak the VHDL but it was much more interesting than blinking lights on and off.

Thanks for sharing your work and process.

Maybe you can provide heat for your home from the bitcoin miner and if so it might be not as big of a losing proposition.
 

Offline FrankBussTopic starter

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #34 on: January 19, 2014, 08:47:22 pm »
Where do these chips come on this chart?

http://bitcoinwisdom.com/bitcoin/calculator
A miner with 25 Avalon chips would be like the "BitFury Starter Kit Oct", because of the 1 GH/s for one Avalon chip, but @2W per chip, so change the Watts field to maybe 60, and if you manage to produce it for EUR 170, it would be profitable in just 140 days, according to the table on the bottom right.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline FrankBussTopic starter

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #35 on: January 20, 2014, 02:40:55 am »
Mining works! I ported the example Python bitcoin miner to Python 3 and simplified and modified it a bit to use with the Avalon chip. The new source code is in the Github repository. I increased the clock to 250 MHz and added a small heatsink. Then I tried it with a mining pool:



It didn't generate the 0.001 BTC, this was from my CPU mining experiments years ago. At this rate I'll get 0.0001 BTC per day, or 0.05 EUR :)
Next step will be to finish the Eagle schematic, to use more chips in parallel at max. speed with a bigger heatsink and fan. Then maybe enhancing the miner for getblocktemplate, or just implementing a driver for cgminer.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline GiskardReventlov

  • Frequent Contributor
  • **
  • Posts: 598
  • Country: 00
  • How many pseudonyms do you have?
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #36 on: January 21, 2014, 02:05:50 am »
The latest estimate for change in difficulty is Sept. 2016, so call it a space heater that makes "0.0001 BTC per day, or 0.05 EUR" and Bob's yer uncle.
 

Offline GRA

  • Newbie
  • Posts: 7
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #37 on: February 05, 2014, 07:54:57 am »
PCB for DIY - BitCoin miner on ASIC Avalon Gen 2 A3255-Q48, PCB for16 chips - 26GHs.
Hurry up, now  you can buy a PCB

1 pcs -$69,
10 pcs - $49/1 pcs (or equivalent amount in BitCoin).
Pay now WebMoney Z276373925574 or BitCoin(Write My E-mail: grisha.dbf@gmail.com )
Buy PCB and DIY - BitCoin miner and get performance - 26GHs NOW! Additional you get documentation about assembling.
Now it is easy to make in 1000 GHs, you only need 40 pcs of this PCB.
PCB is worldwide shipping by DHL or FedEX.
My E-mail: grisha.dbf@gmail.com
 

Offline scientist

  • Frequent Contributor
  • **
  • !
  • Posts: 317
  • Country: 00
  • User banned.
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #38 on: February 05, 2014, 09:24:42 am »
According to that many ASIC miners are already worthless, incapable of ever breaking even if difficulty continues to rise at the predicted rate.

As mentioned, free electricity makes it profitable.

Who gets free electricity?
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9013
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #39 on: February 05, 2014, 02:30:55 pm »
Who gets free electricity?
Most college dorms and a few apartments do. It's not "free" per se but rather "fixed cost". There are also a few utility plans where electricity is free at night. And of course, those who have alternative energy at home.
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.
 

Offline FrankBussTopic starter

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #40 on: February 05, 2014, 02:54:14 pm »
Most college dorms and a few apartments do. It's not "free" per se but rather "fixed cost". There are also a few utility plans where electricity is free at night. And of course, those who have alternative energy at home.
I guess if you draw constantly 2 kW for a modern bitcoin miner, the landlord might not like it and show you some fine print for fair use.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9013
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #41 on: February 05, 2014, 03:16:12 pm »
I guess if you draw constantly 2 kW for a modern bitcoin miner, the landlord might not like it and show you some fine print for fair use.
That's no different than leaving the A/C or heater running. That would indeed be problematic in dorms that generally do not allow such items, so you can't do it on too big of a scale. And if heating is electric (very common in apartments), there would be basically no change in winter time electricity use. Those who live in cold climates and are stuck with electric heat would always benefit from Bitcoin mining. (i.e. the value of the Bitcoins mined "subsidizes" the electricity used.)
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.
 

Offline Legit-Design

  • Frequent Contributor
  • **
  • Posts: 562
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #42 on: February 05, 2014, 03:50:46 pm »
there would be basically no change in winter time electricity use. Those who live in cold climates and are stuck with electric heat would always benefit from Bitcoin mining. (i.e. the value of the Bitcoins mined "subsidizes" the electricity used.)

Heaters work with thermostats, when desired temperature is reached heating is turned off. Computers doing calculations produce more or less the same heat all the time. 2kW in fairly winter insulated house will get toasty really quick.
 

Offline GiskardReventlov

  • Frequent Contributor
  • **
  • Posts: 598
  • Country: 00
  • How many pseudonyms do you have?
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #43 on: February 05, 2014, 07:21:51 pm »
Who gets free electricity?

People that ask nicely.

Think geothermal.
 

Offline GiskardReventlov

  • Frequent Contributor
  • **
  • Posts: 598
  • Country: 00
  • How many pseudonyms do you have?
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #44 on: February 05, 2014, 07:26:24 pm »
2kW in fairly winter insulated house will get toasty really quick

Open the window? Heat the basement, the greenhouse, pipe it to your neighbor's place (but charge them half of utility rates). Maybe bake bread.
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9013
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #45 on: February 05, 2014, 09:42:50 pm »
Heaters work with thermostats, when desired temperature is reached heating is turned off. Computers doing calculations produce more or less the same heat all the time. 2kW in fairly winter insulated house will get toasty really quick.
Apartments usually aren't very well insulated. A single mining unit is going to be 1.5kW or less, since that's the (sustained) limit of a common 15A circuit.
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.
 

Offline FrankBussTopic starter

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #46 on: February 06, 2014, 12:38:59 pm »
Ok, back on-topic. I'm planning the schematic. My idea would be to use modules of 10 Avalon chips and one controller board. Each module has its own 0.9V and 3.3V power supply regulator and a 12V Molex connector to connect a standard PC power supply. I think each Avalon module should have a small microcontroller (maybe a PIC) with a SPI interface. So there will be a data connector for each module with CS/MISO/MOSI/CLK for the microcontroller, the 25 MHz clock signal, CONFIG_PI/NI (should do the FPGA on the controller board for exact timing, not the PIC) and the open collector REPORT_NI/PI signals. An Avalon board will have the following components:
  • up to 10 Avalon chips
  • MCP41HVX1 digital potentiometer to adjust the 0.9V core voltage for overclocking
  • TC74 temperature sensor in TO220-5, for mounting on the heatsink
  • Molex connector for 12V input
  • 0.9V/20A voltage regulator (maybe a bit more ampere for overclocking)
  • 3.3V voltage regulator
  • microcontroller to read the temperature sensor, control the digital potentiometer, power enable of the core voltage, and controlling the RSTN line of the Avalon chips
The CS is for the SPI interface with the microcontroller, but it will gate the CONFIG_PI/NI signals as well. Then the controller board just needs to provide all signals once, and only different CS signals for each connected Avalon module. I plan to use the LCMXO2-4000HC TQFP 144 FPGA, which has 115 usable IO lines. There are 8 common lines required for all Avalon module (maybe buffered for each board) and 4 lines for a SPI interface to the Raspberry Pi. This means 103 lines are left. Maybe a good idea to leave 3 spare lines, so we have 100 chip selects for up to 100 Avalon modules. This would allow to build a 1000 GH/s bitcoin miner with one controller board and one Raspberry Pi.

With this many chips, the REPORT_N/I signals could be a problem, because the chances are higher, that two chips send reports in parallel. And maybe there could be a problem with 100 open collector connections. Maybe the local microcontroller is fast enough to receive the reports and to send the config data. Then there would be no need for an FPGA on the controller board. The Raspberry Pi would control all Avalon modules with SPI, and chip select could be generated with a few 7490 decade counters, or a smaller CPLD. I think I should try to implement the CONFIG/REPORT protocol for a PIC to test it.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline Towger

  • Super Contributor
  • ***
  • Posts: 1645
  • Country: ie
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #47 on: February 06, 2014, 05:36:19 pm »
I think it would be easier to write a 'company' screensaver which performs the calculations in the background. As per Seti At Home and role it out...
 

Offline FrankBussTopic starter

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #48 on: February 06, 2014, 05:53:26 pm »
This wouldn't make sense. The average company PC has a low end graphics card, maybe 100 MH/s if you are lucky, for cheap on-board cards or CPU mining maybe 10 MH/s (see https://en.bitcoin.it/wiki/Mining_hardware_comparison ). One Avalon chip with 2 W would be 10 to 100 times faster. And if someone would try to hide it in a screensaver, it would be classified as malware fast.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline GiskardReventlov

  • Frequent Contributor
  • **
  • Posts: 598
  • Country: 00
  • How many pseudonyms do you have?
Re: DIY bitcoin miner for Avalon A3255-Q48 chips
« Reply #49 on: February 06, 2014, 08:11:58 pm »
Ok, back on-topic. I'm planning the schematic.

You're over my head but I'm enjoying watching along.  With 10 avalon chips per module, what's the plan if one chip fails? Will the chip be replaced or the entire module? How easy will it be to swap modules?

Here's my very high-level understanding of your rig so far:

1,000 avalon chips, with 10 chips per module for 100 modules.

Will it be stacked, spread out flat or side-by-side or ?

What about fire supression?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf