Author Topic: Divide by 10 cct needed  (Read 11132 times)

0 Members and 3 Guests are viewing this topic.

Offline METopic starter

  • Frequent Contributor
  • **
  • Posts: 687
  • Country: gb
Divide by 10 cct needed
« on: June 30, 2026, 08:30:22 pm »
Hi folks , I have a marconi 2995a coms test set , It has a bnc port for a 1 Mhz freq ref input , I also have a 10Mhz gpsdo , i need to divide the gpsdo 10 Mhz outut  down to 1 Mhz to feed the 1Mhz ref freq input on the marconi , Can anyone recomend a schematic of something i can homebrew for this?.
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 4187
  • Country: us
Re: Divide by 10 cct needed
« Reply #1 on: June 30, 2026, 09:12:30 pm »
Do you have any logic ICs on hand, like counters, flip-flops, etc.?

Usually the best solution is the one that uses components you already have on hand.

You could use an AVR (or perhaps other) microcontroller... use the 10 MHz signal as the clock for the mcu and set up one of the timers to toggle a gpio every 5 cycles. After setting that up the cpu itself just goes into while(1) loop.

Update, this code seems to work on a atmega328:

Code: [Select]
int main(void) {
    // Configure PB1 (OC1A) as output -- note this is atmega328 specific
    pinMode(9, OUTPUT);

    // Set up Timer1 for CTC mode
    TCCR1B |= (1 << WGM12); // CTC mode
    TCCR1B |= (1 << CS10);  // No prescaler (1 cycle per tick)

    // Set compare value to toggle every 5 cycles
    // Toggle occurs on compare match, so set OCR1A to 4 (0-4 is 5 cycles)
    OCR1A = 4;
    TCCR1A |= (1 << COM1A0); // Toggle OC1A on compare match

    while (1) { }
}
« Last Edit: June 30, 2026, 10:48:51 pm by ledtester »
 
The following users thanked this post: Picuino

Offline Benta

  • Super Contributor
  • ***
  • Posts: 7176
  • Country: de
Re: Divide by 10 cct needed
« Reply #2 on: June 30, 2026, 09:25:42 pm »
CD74HC190 from TI will do the job. Apart from a decoupling cap, nothing else is needed.
 
The following users thanked this post: Johnny B Good

Offline tom66

  • Super Contributor
  • ***
  • Posts: 8856
  • Country: gb
  • Professional HW / FPGA / Embedded Engr. & Hobbyist
Re: Divide by 10 cct needed
« Reply #3 on: June 30, 2026, 10:01:58 pm »
You could use an AVR (or perhaps other) microcontroller... use the 10 MHz signal as the clock for the mcu and set up one of the timers to toggle a gpio every 5 cycles. After setting that up the cpu itself just goes into while(1) loop.

Or you might even be able to write some tight assembler.  Toggling an IO might be possible in 5 cycles if the MCU has a TOG register (e.g. PICs have toggle-side-effect registers) or XOR instruction that can operate directly on memory mapped address (some ARM CPUs).
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 7176
  • Country: de
Re: Divide by 10 cct needed
« Reply #4 on: June 30, 2026, 10:20:57 pm »
Why would anyone want to do that, when a sub-$1, off-the-shelf device will do it directly? Talk about overkill...  :-//
 
The following users thanked this post: Someone, Solder_Junkie, TimFox

Offline themadhippy

  • Super Contributor
  • ***
  • Posts: 4568
  • Country: gb
Re: Divide by 10 cct needed
« Reply #5 on: June 30, 2026, 10:28:08 pm »
Quote
CD74HC190
If  74 series dont do it for you theres the ole trusty cd4017
 
The following users thanked this post: vk6zgo

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 4187
  • Country: us
Re: Divide by 10 cct needed
« Reply #6 on: June 30, 2026, 10:42:01 pm »
Why would anyone want to do that, when a sub-$1, off-the-shelf device will do it directly? Talk about overkill...  :-//

Like I said, sometimes the best solution depends on what you have on hand. If you already have an MCU available it might be the quickest and cheapest solution vs. having to place an order and wait for a chip to arrive.
 
The following users thanked this post: tom66

Offline Benta

  • Super Contributor
  • ***
  • Posts: 7176
  • Country: de
Re: Divide by 10 cct needed
« Reply #7 on: June 30, 2026, 10:46:55 pm »
Quote
CD74HC190
If  74 series dont do it for you theres the ole trusty cd4017

Won't work at 10 MHz. At least not below 10 V supply.

But the whole idea of throwing a full programming environment etc. at a simple digital divide-by-10 circuit as others suggested is simply ridiculous.

 
 
The following users thanked this post: Johnny B Good

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 4187
  • Country: us
Re: Divide by 10 cct needed
« Reply #8 on: June 30, 2026, 11:01:19 pm »
The idea's been around for a while:

From the early 2000's using a PIC:

http://www.leapsecond.com/pic/picdiv.htm
github: https://github.com/aewallin/PICDIV

More recently using a RPi Pico:

https://www.mail-archive.com/[email protected]/msg10057.html
github: https://github.com/dorsic/PicoDIV

 
The following users thanked this post: edavid

Offline Benta

  • Super Contributor
  • ***
  • Posts: 7176
  • Country: de
Re: Divide by 10 cct needed
« Reply #9 on: June 30, 2026, 11:26:45 pm »
I'll keep that in mind.

"I need a digital 3-to-8 decoder."

"Right. The first thing to do is to decide on an architecture. My suggestion would be ARM64. The newest versions should be fast enough for the job. 1 GB RAM should just about swing it"

 :-DD  :-DD
« Last Edit: June 30, 2026, 11:28:20 pm by Benta »
 
The following users thanked this post: Johnny B Good, Phil1977

Offline themadhippy

  • Super Contributor
  • ***
  • Posts: 4568
  • Country: gb
Re: Divide by 10 cct needed
« Reply #10 on: June 30, 2026, 11:57:13 pm »
Quote
Won't work at 10 MHz. At least not below 10 V supply.
D'oh
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 4187
  • Country: us
Re: Divide by 10 cct needed
« Reply #11 on: July 01, 2026, 12:20:09 am »
I'll keep that in mind.

"I need a digital 3-to-8 decoder."

"Right. The first thing to do is to decide on an architecture. My suggestion would be ARM64. The newest versions should be fast enough for the job. 1 GB RAM should just about swing it"

 :-DD  :-DD

What if I told you that people are implementing ROMs with MCUs:

PIOs Rock! - Blazingly fast retro ROM serving with no CPU and just 18 bytes of PIO code
https://youtu.be/Y8RODQZM2HY

The Pico needs to run at only 51 MHz in order to implement a ROM in a Commodore 64. This is actually a big improvement over a CPU-only based solution which needs to run at 117 MHz for the same performance.

The whole orchestration of DMA + PIO code is actually pretty cool. The video is definitely worth watching if you're interested in this kind of stuff.

Lots more on his channel: https://www.youtube.com/@piers_rocks
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 9073
  • Country: ca
Re: Divide by 10 cct needed
« Reply #12 on: July 01, 2026, 02:01:02 am »
Problem with using an MCU solution is TESTING it. Hopefully no missing counts, interrupts etc. despite the blogger fame and glory.

Several GPSDO designs use a divide by 10 (i.e. to feed slow 4046 PLL). Using 1/2 of 'LS390 example in Paul's DIY electronics blog GPSDO Version 4
 
The following users thanked this post: Johnny B Good

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3364
  • Country: au
Re: Divide by 10 cct needed
« Reply #13 on: July 01, 2026, 05:08:49 am »
..., i need to divide the gpsdo 10 Mhz outut  down to 1 Mhz to feed the 1Mhz ref freq input on the marconi , Can anyone recomend a schematic of something i can homebrew for this?.

In case the unit is duty cycle dependent you would be best to choose a /5 then /2 to get 50% duty output.
The 74HC390 mentioned above does that nicely.
 
The following users thanked this post: Johnny B Good

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 6464
  • Country: nz
Re: Divide by 10 cct needed
« Reply #14 on: July 01, 2026, 06:48:27 am »
Why would anyone want to do that, when a sub-$1, off-the-shelf device will do it directly? Talk about overkill...  :-//

I disagree.

AVRs generally cost over $1 and only run at 16 MHz which might be marginal, but 48 MHz RISC-V CH32V003 and Arm Cortex-M0 PY32F002a are $0.10 in 8 pin packages (or $0.20 in 20 pin) and can be turned to a huge number of applications so it's reasonable to buy 50 of them. Good luck getting a specialised 74-series for that price, especially if you only need one of that kind.

Toggling an output a 1 MHz is trivial. But you can also easily implement any function of 8 inputs (including degenerate cases such as "quad 2 input NAND") with a simple "read input port, index into 256 byte table in SRAM, write output port" loop. I haven't tested, but you might well be able to do that at 8 MHz rate (6 cycles per loop). 4 MHZ should be easy. Certainly not as fast as a real 74LS or 74HC (25 or 30 MHz) but good enough for many purposes.
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 6464
  • Country: nz
Re: Divide by 10 cct needed
« Reply #15 on: July 01, 2026, 06:50:48 am »
Problem with using an MCU solution is TESTING it. Hopefully no missing counts, interrupts etc. despite the blogger fame and glory.

It's pretty hard to go wrong with a 3 or 4 or 5 instruction program loop. Let alone with a hardware timer-based solution. No reason to enable interrupts.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 22446
  • Country: gb
  • 0999
Re: Divide by 10 cct needed
« Reply #16 on: July 01, 2026, 07:34:15 am »
Quote
CD74HC190
If  74 series dont do it for you theres the ole trusty cd4017
There's the 74HC4017, which will.
https://www.ti.com/lit/ds/symlink/cd74hc4017.pdf

Looking at the timing diagram, the terminal count (pin 12) will give a 50% duty cycle out.
 

Offline NNNI

  • Regular Contributor
  • *
  • Posts: 77
  • Country: de
    • YouTube channel
Re: Divide by 10 cct needed
« Reply #17 on: July 01, 2026, 08:41:01 am »
This can be done relatively easily using four D flip-flops (two dual D flip-flop ICs) in the following fashion: https://tinyurl.com/26xw7gb3
You can pick a logic family that fulfils the speed and drive requirements, so you have a lot of flexibility there. Some ICs have an inverted reset polarity, but that can be easily accounted for by connecting the reset input to !Q instead of Q.
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3364
  • Country: au
Re: Divide by 10 cct needed
« Reply #18 on: July 01, 2026, 08:56:04 am »
Good luck getting a specialised 74-series for that price, especially if you only need one of that kind.

A Divide by 10 is hardly a specialized 74 series.  :-//
You seem to completely skip over the cost to develop, store and track the software, and actually program the MCU, sadly those costs do not scale down as the software drops to a few bytes.

It would need a special case to use a MCU for something this simple, perhaps if size was paramount, and TSSOP16 was too large?
For one off bench test setup, clearly that is not the case. Instead KISS applies.
 

Offline neillnz

  • Regular Contributor
  • *
  • Posts: 54
  • Country: nz
Re: Divide by 10 cct needed
« Reply #19 on: July 01, 2026, 09:32:07 am »
There is another solution to consider. 

The 2955 internal OCXO is 10 MHz.

They do die and are awkward to replace.

So you could consider modyfing it to switch between OCXO and your ext 10 MHz with a physical switch....   
 
The following users thanked this post: Someone, ME

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 6464
  • Country: nz
Re: Divide by 10 cct needed
« Reply #20 on: July 01, 2026, 11:48:36 am »
Good luck getting a specialised 74-series for that price, especially if you only need one of that kind.

A Divide by 10 is hardly a specialized 74 series.  :-//

Of course it is. A 74HC4017 is a specialised function. So for that matter is 74HC74 (and you need TWO of them).

If you needed to divide by something weirder than 10 you'd need a whole different circuit, but a program would scarcely change ... probably just one constant.

I remember 43 years ago building an M6809 board and I needed a divide-by-208 to get 9600 bps from a 2 MHz clock. That's divide by 16 (easy) and then divide by 13 ... not too hard but I got it wrong the first time and ended up with divide by 12, which didn't work. Luckily it was an easy fix.

As shown by the size of the numbers after the 74LS or 74HC there are literally several hundred different chips. That's the very definition of specialised.

How many of those does the average hobbyist keep on hand?

I've got some 00, 04, 14, 86, and 165, 573, and 595. And not many of each. On the other hand I've got a couple of bags of 50 CH32V003 in 8 and 20 pin versions at a cost of IIRC from several years ago $5 and $7.

Quote
You seem to completely skip over the cost to develop, store and track the software, and actually program the MCU, sadly those costs do not scale down as the software drops to a few bytes.

Not at all!

It's not harder than, and in fact easier than designing a PCB and storing and tracking the various design files for that. Not to mention schematic diagrams, state diagrams for sequential logic. Truth tables. Logic minimisation diagrams.

Programming an MCU is basically trivial these days. I can knock out the kind of program described here in minutes, especially once there is a template code file for any one such logic.
 

Offline themadhippy

  • Super Contributor
  • ***
  • Posts: 4568
  • Country: gb
Re: Divide by 10 cct needed
« Reply #21 on: July 01, 2026, 12:16:28 pm »
Quote
If you needed to divide by something weirder than 10 you'd need a whole different circuit, but a program would scarcely change
regardless of the number a divide by n circuit  with logic will scarcely change  regardless the value of n,a simple binary counter with an  and gate or 3 thrown in,job done
 

Offline temperance

  • Super Contributor
  • ***
  • Posts: 1613
  • Country: 00
Re: Divide by 10 cct needed
« Reply #22 on: July 01, 2026, 12:37:29 pm »
Using a micro controller to devide by ten... and a 74HC4017 is a specialized component!

Current inventory:

Farnell: >6000
Mouser: >9000

Price 55 cent for one.

If you want a cheaper counter, try a 74HC390. Also available in >10 K quantities. They cost 40 cent and you only need one.
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 6464
  • Country: nz
Re: Divide by 10 cct needed
« Reply #23 on: July 01, 2026, 01:02:35 pm »
Using a micro controller to devide by ten... and a 74HC4017 is a specialized component!

Totally specialised — it steps through 10 output pins in sequence, one per clock (and a carry). And nothing else.

An MCU can do that and an infinite variety of other things,

Quote
Current inventory:

Farnell: >6000
Mouser: >9000

Price 55 cent for one.

CH32V003:

8 pin 14,250 in stock, $0.2194 each for 5+ https://www.lcsc.com/product-detail/C5346354.html

20 pin: 16,330 in stock, $0.2875 each for 5+ https://www.lcsc.com/product-detail/C5187096.html

General purpose, half the price of your 74HC4017, and if all you actually want is to put 10 MHz in and get 1 MHz out then the 8 pin version will do fine.

You don't mind having a few of them on hand because you can use them to do anything — as long as you don't want to step those 10 output pins at 40 or 50 MHz at least. But plenty of applications are slower speed than that.

You need to buy 100 of the 74HC4017 to match the CH32V003 price for 5. Unless you're a manufacturer you're never going to use 100 of a specialised chip like that.

By the way, your Farnell has an article about using the CH32V003: https://community.element14.com/technologies/embedded/b/blog/posts/low-cost-microcontrollers-using-a-ch32v003-risc-v-device
« Last Edit: July 01, 2026, 01:05:41 pm by brucehoult »
 

Offline themadhippy

  • Super Contributor
  • ***
  • Posts: 4568
  • Country: gb
Re: Divide by 10 cct needed
« Reply #24 on: July 01, 2026, 01:07:25 pm »
Quote
8 pin 14,250 in stock, $0.2194 each for 5+
plus at least £100 for something to get the program from yer brain into the chip.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->