Large Binary Counter Project - Page 1
Forum section: electronics / projects

author: Devin Black
author_rank: Contributor
timestamp: April 27, 2017, 07:39:01 am
content: For this project, I want to try and make a large binary count of around 50 LED's. So, in short I want to try and connect multiple cd4060 binary counters togther in order to make an extremely long chain of LED's flashing in a binary format. What is the best way to link them together. Can I link the IC's in series? Thanks.

author: Rerouter
author_rank: Super Contributor
timestamp: April 27, 2017, 07:54:07 am
content: You can link them in series, you would connect Q14 (/16384) output to the next chips clock input,So for 50 LED's you would have 5 chips, just know that its not a true binary clock as this chip doesnt make available /2, /4 or /8 meaning the previos stage would need to cycle 16 times to update the second stage,You would likely be better off with a 74HCT4040, which is just a bunch of flip flops in series, 12 per chip, so lets say 4 chips for 49-50 leds' swith this chip it would involve linking Q11 of the previous chip to CP of the next to series them,Just be aware, unless your input frequency is very high, you will never see the last LED toggle, for 50 stages, it would take 3.6 years with a 10MHz input.and you will likely want some local holdover power source because you cannot set it back as it was when a blackout occurs.

author: Dave
author_rank: Super Contributor
timestamp: April 27, 2017, 07:54:13 am
content: Quote from: Devin Black on April 27, 2017, 07:39:01 amYes.But why would you want a 50-bit counter? It means that you would be counting up to 1125899906842624 (not a typo). Even with the highest counting frequency (12 MHz), it would still take this thing 3 years to count through the whole range of values. What is the point?

author: matseng
author_rank: Frequent Contributor
timestamp: April 27, 2017, 08:02:11 am
content: The 4060 is not a good choice for this. It's a 14 bit binary counter but only 10 of the counter outputs are connected to a pin. The 1,2,3 and 11 outputs are missing so the LEDs will not be blinking in a pure binary pattern.

author: Devin Black
author_rank: Contributor
timestamp: April 27, 2017, 08:08:33 am
content: What would be the best ic to make a large binary counter like this?

author: daqq
author_rank: Super Contributor
timestamp: April 27, 2017, 08:37:24 am
content: QuoteAn FPGA/CPLD would to it in one ICThat said the 4040 (http://assets.nexperia.com/documents/data-sheet/74HC_HCT4040.pdf) IC would do what you want and you can link them together easily.

author: Paul Moir
author_rank: Frequent Contributor
timestamp: April 27, 2017, 09:06:22 am
content: You know if you clock that thing at around it's maximum 20MHz frequency, it'll be a couple of years before the 50th LED winks on right?

author: Devin Black
author_rank: Contributor
timestamp: April 27, 2017, 04:41:29 pm
content: What would be the benefit of using the 4040 over the 4060?

author: daqq
author_rank: Super Contributor
timestamp: April 27, 2017, 06:12:55 pm
content: The 4040 is a binary counter that has effectively a Divde by 2, 4, 8 output. The 4060 starts at Divide by 16.

author: Devin Black
author_rank: Contributor
timestamp: April 27, 2017, 06:44:32 pm
content: Why would it make it better for this case, is it more efficient, fast, looks nicer...?

author: ynfo
author_rank: Contributor
timestamp: April 27, 2017, 07:08:23 pm
content: Here is an analog equivalent I spotted at the the MIT museum.Twelve gears in series each with a 50:1 reduction. The input shaft turns at 200 rpm and the output shaft turns so infinitesimally slowly it can be fixed in concrete!

author: theatrus
author_rank: Frequent Contributor
timestamp: April 27, 2017, 10:10:13 pm
content: Clocks are fun gadget projects. I second the suggestion of not just using direct counters since setting the clock will be a lot harder.Electro-mechanical clocks using non-standard mechanisms are also fun - how about using peristaltic pumps for a water/oil clock?

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: April 27, 2017, 10:16:53 pm
content: Quote from: theatrus on April 27, 2017, 10:10:13 pm74LS193/74HC193 + a switch per bit á la Altair ?

author: DaJMasta
author_rank: Super Contributor
timestamp: April 27, 2017, 10:58:58 pm
content: I just did a project chaining 74HCT4040s and it's worked great, as mentioned you just use the output of the highest bit on the first counter into the clock on the next. If you are concerned with current draw, you can buffer the bits before driving your LEDs, but the outputs are plenty for low-brightness LEDs. Also the 74 series chips are usually rated for faster clocks, if that counts for anything in your design. I ran my 74HCT4040s at 32MHz, though there was a different manufacturer that only rated them to 32MHz at 6V. That said, there was a more expensive variant that could go up to 70 or 80MHz.The one thing to be careful is to be wary of 14 bit counters. Basically, they work fine, but they are put into packages that are too small to break all the outputs out, so generally bits 2 and 3 are missing and are only internal. If you're just concerned with the top end of the count, then it's fine, but if you want the detail in the lower end, there is no way to get that data without another chip or something. No idea why they fit them into the same package as the 12 bit counters, but they did, so if you want every bit exposed, you need to go with a 4040 instead of a 4060.

author: Devin Black
author_rank: Contributor
timestamp: April 28, 2017, 03:20:03 am
content: awesome, thank you guys so much, I will try and use all this information to make the counter. I think I am going to go with the 4040's.

author: danadak
author_rank: Super Contributor
timestamp: April 28, 2017, 12:15:21 pm
content: The 4040 does not have a spec on total allowed Vdd current. It does showdrive levels of a couple of mA, which may not be enough depending on yourLED requirements. So you would need buffers between LED and 4040. Lotsof chips.PSOC would be a one chip 50 bit counter solution, but you may still needbuffers as its limited to total Idd current and pin current. But would savea lot of chips. See attached pic.You re limited to 100 mA per port, so that might work since 8 pins / port,so you could drive ~ 12.5 mA per pin. Then no other buffers, just a 1part solution.Regards, Dana.

author: dr.diesel
author_rank: Super Contributor
timestamp: April 28, 2017, 12:33:55 pm
content: Quote from: ynfo on April 27, 2017, 07:08:23 pmI suspect inspired by Arthur Gansen's work, very cool stuff!

author: BrianHG
author_rank: Super Contributor
timestamp: April 28, 2017, 12:36:06 pm
content: Even running multiple 74HC4040s at 32Mhz, the 50'th bit will still take over half a year before it turns on, more than a year before it goes off...Since you need 5 of them anyways to pass 50 bits, why not extend your LEDs to the total 60 bits available anyways & wait out the thousand years to see that last bit go!

author: Ian.M
author_rank: Super Contributor
timestamp: April 28, 2017, 01:37:41 pm
content: Assuming a well maintained server grade fully redundant DC PSU fed by independent UPSes, a well maintained triply redundant clock source, and secure bench space for the lifetime of the circuit, how many stages do you have to have before the probability of the last stage toggling once within the expected lifetime of the circuit drops below 50%?

author: danadak
author_rank: Super Contributor
timestamp: April 28, 2017, 02:36:19 pm
content: Cleaned up schematic on PSOC design.Note resources not used after instantiating solution, lots of other stuff you can dowith PSOC part.Code:Resource Type : Used : Free : Max : % Used============================================================Digital Clocks : 2 : 6 : 8 : 25.00 %Analog Clocks : 0 : 4 : 4 : 0.00 %CapSense Buffers : 0 : 2 : 2 : 0.00 %Digital Filter Block : 0 : 1 : 1 : 0.00 %Interrupts : 0 : 32 : 32 : 0.00 %IO : 53 : 19 : 72 : 73.61 %Segment LCD : 0 : 1 : 1 : 0.00 %CAN 2.0b : 0 : 1 : 1 : 0.00 %I2C : 0 : 1 : 1 : 0.00 %USB : 0 : 1 : 1 : 0.00 %DMA Channels : 0 : 24 : 24 : 0.00 %Timer : 0 : 4 : 4 : 0.00 %UDB : : : :Macrocells : 55 : 137 : 192 : 28.65 %Unique P-terms : 53 : 331 : 384 : 13.80 %Total P-terms : 53 : : :Datapath Cells : 0 : 24 : 24 : 0.00 %Status Cells : 0 : 24 : 24 : 0.00 %Control Cells : 0 : 24 : 24 : 0.00 %Opamp : 0 : 4 : 4 : 0.00 %Comparator : 0 : 4 : 4 : 0.00 %Delta-Sigma ADC : 0 : 1 : 1 : 0.00 %LPF : 0 : 2 : 2 : 0.00 %SAR ADC : 0 : 2 : 2 : 0.00 %Analog (SC/CT) Blocks : 0 : 4 : 4 : 0.00 %DAC : : : :VIDAC : 0 : 4 : 4 : 0.00 %So in short I think you can do this with one part.Regards, Dana.