64-bit Timer - Page 1
Forum section: electronics / general

author: Md_Aslam
author_rank: Contributor
timestamp: September 15, 2022, 05:22:41 am
content: Can Anyone suggest me the 64-bit Timer/Counter IC, which can count the number of pulses of external signal say 10MHz?

author: ataradov
author_rank: Super Contributor
timestamp: September 15, 2022, 05:41:10 am
content: The easiest is any MCU and a combination of hardware/firmware counters. I doubt there is a standalone IC like this, there is literally zero market for it.

author: dietert1
author_rank: Super Contributor
timestamp: September 15, 2022, 06:45:56 am
content: Many years ago i designed a multichannel scaler for a high energy physics experiment. At the time we used a bank of counter chips (AM9513) that were 5x 16 bits counters, managed by a 68K processor. Overflows were handled by the firmware.Nowadays one could use a FPGA to implement this board on one chip. Any modern MCU with it's timers will do the same, but it may require a little effort to get a counting gate correct to 100 nsec.Regards, Dieter

author: SiliconWizard
author_rank: Super Contributor
timestamp: September 15, 2022, 06:38:19 pm
content: MCU, or smallest FPGA you can find.If you really want to do it with discrete logic though, you could use 4 cascaded 74LV8154 chips (16-bit counter, available.)These are actually dual 16-bit counters which can be configured as 32-bit counters, so in theory you'd need only 2 of these chips, but oddly enough, for each IC, while the first counter has a carry out that can be used to chain it to the second counter to get a 32-bit counter, the second internal counter doesn't have a carry out, so you could not chain it directly to get 64-bit. You'd have to use 4 of them chained (and not use the second internal counter on each.) Still pretty cheap. (About $1 each.)

author: FenTiger
author_rank: Regular Contributor
timestamp: September 15, 2022, 06:46:06 pm
content: 2^64 × 100ns ~= 58,500 years.Do you really need a 64 bit counter?

author: pcprogrammer
author_rank: Super Contributor
timestamp: September 15, 2022, 07:25:07 pm
content: Maybe he has a time machine and needs to check if his nuclear diamond battery really lasts that long

author: SiliconWizard
author_rank: Super Contributor
timestamp: September 15, 2022, 08:07:19 pm
content: 32-bit was probably not enough and he proably just thought of doubling it. Which suggests a mental approach of software, in which case using a MCU for this sounds like the most appropriate approach for the OP.Otherwise 48 bits will be about 325 days. Might or might not be enough. We don't know. If it is, then my suggested solution could be made with just 3 of the chips I mentioned instead of 4. About $3 and dead easy.

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: September 15, 2022, 08:33:15 pm
content: The Infineon XMC4000 series MCUs have 16-bit timers that you can cascade into 32-bit, 48-bit, and 64-bit timers.

author: kgavionics
author_rank: Regular Contributor
timestamp: September 16, 2022, 11:06:19 am
content: If there is not any 64bit counter on the market, probably there is no use for it! It must be an overkill for a firmware running on an MCU!

author: Md_Aslam
author_rank: Contributor
timestamp: September 19, 2022, 09:56:37 am
content: Quote from: FenTiger on September 15, 2022, 06:46:06 pmWith 32-bit counter, which I have2^32 x 100 = 429.4 SecondsI need a counter which can count up to a month at least.

author: Md_Aslam
author_rank: Contributor
timestamp: September 19, 2022, 10:02:40 am
content: Quote from: SiliconWizard on September 15, 2022, 08:07:19 pmYes You are right, 48-bit will work, thinking of doubling 32-bit is not logically correct, I will try cascading the 16-bit timer instead of looking for 64-bit Timer.

author: SiliconWizard
author_rank: Super Contributor
timestamp: September 19, 2022, 06:03:47 pm
content: Note that I overestimated the number of the required 16-bit counters mentioned above: for 48-bit, you'd only need 2 of these ICs (and 3 for 64-bit): the last one in the chain will provide the upper 32 bits since it's chainable internally. So 2 of these ICs for 48-bit, I think that's a simple and cheap enough solution.Also note that this IC has an 8-bit "data bus", so you read the counter value by 8-bit chunks. (But just read the datasheet.)

author: ejeffrey
author_rank: Super Contributor
timestamp: September 19, 2022, 08:14:07 pm
content: Quote from: kgavionics on September 16, 2022, 11:06:19 amThere exist cheap enough MCUs that they are very often the most efficient (both cost and number of parts) for things that would have been done with discrete logic even just a few years ago.

author: IDEngineer
author_rank: Super Contributor
timestamp: September 23, 2022, 07:15:02 am
content: A while back I cascaded a couple of hardware timer peripherals in an MCU by tying the output pin of one to the input pin of the next. Worked perfectly and didn't require firmware intervention except for the MSb rollover. I don't recall the MCU I was using, and obviously you'd have to pick an MCU that exposes the required signals, but this is a way to do it in a single chip that can be configured with code.

author: pcprogrammer
author_rank: Super Contributor
timestamp: September 23, 2022, 07:59:10 am
content: But then you also need the MCU being capable of taking a 10MHz signal as input to the timer.

author: brucehoult
author_rank: Super Contributor
timestamp: September 23, 2022, 10:00:01 am
content: Quote from: pcprogrammer on September 23, 2022, 07:59:10 amEven a 4 or 8 bit hardware counter with the overflow triggering an interrupt would be enough to let a $1 ATTiny or PIC handle the rest.

author: pcprogrammer
author_rank: Super Contributor
timestamp: September 23, 2022, 10:02:34 am
content: Only then it is no longer the single chip solution like IDEngineer referred to.Quote from: IDEngineer on September 23, 2022, 07:15:02 am

author: DavidKo
author_rank: Frequent Contributor
timestamp: September 23, 2022, 10:14:16 am
content: Quote from: Md_Aslam on September 19, 2022, 10:02:40 amThan you can use 3x16 bit counter or 2x 16 bit + 1x 8bit, if 40bits are enough. Depends what devices you have on your table. Maybe 5x8 bit for testing on breadboard will be good enough. At 5V SN74HC590A should handle 16MHz clock.

author: hgl
author_rank: Regular Contributor
timestamp: September 23, 2022, 10:21:27 am
content: The stm32Fxx family has enough 16/32 bit counters and an internal wiring matrix to connect counters in series. A single Chip and Software only for configuration.With a STM32F411 you can build e.g. a 32+32+16+16+16+16 = 128 bit counter. Have fun with testing

author: IDEngineer
author_rank: Super Contributor
timestamp: September 23, 2022, 01:35:30 pm
content: Quote from: pcprogrammer on September 23, 2022, 07:59:10 amA quick glance at the spec sheet for the PIC18F, which is in the project I'm working on at the moment, reveals its CCP module can handle 40nS input periods (25MHz) with a 16MHz crystal and prescaler of 1. Higher prescaler settings permit the same multiples of input speed. So 10MHz isn't hard at all.

author: pcprogrammer
author_rank: Super Contributor
timestamp: September 23, 2022, 01:48:01 pm
content: I was not saying it is hard, just that the MCU needs to be able to handle it. Have not checked but an Atmel AVR based MCU might not like this on its inputs.

author: ledtester
author_rank: Super Contributor
timestamp: September 23, 2022, 02:16:22 pm
content: Quote from: pcprogrammer on September 23, 2022, 01:48:01 pmFrom this app note:AVR205: Frequency Measurement Made Easy with Atmel tinyAVR and Atmel megaAVRhttps://ww1.microchip.com/downloads/en/Appnotes/doc8365.pdfthe maximum frequency that you can reliably drive the external clock is f_clk/2.5 - and that's for symmetric (50% duty cycle) signals.