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

0 Members and 8 Guests are viewing this topic.

Offline Benta

  • Super Contributor
  • ***
  • Posts: 7176
  • Country: de
Re: Divide by 10 cct needed
« Reply #50 on: July 02, 2026, 07:05:07 pm »
Sad if you don't have coding skills at this point.

Don't worry. Z80, 6502, 6809, 68K, PowerPC. Been there done that.
But I do know when a hammer or a tweezer is the appropriate tool.
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 9065
  • Country: ca
Re: Divide by 10 cct needed
« Reply #51 on: July 02, 2026, 07:14:58 pm »
In the AVR code the 10 MHz signal does not go through a GPIO pin. Rather, it is used as the CPU clock and a timer is configured to toggle an output pin every 5 cycles.

Not an expert having never left theory to TEST performance, but using an MCU has the required flip-flop to consider. Example AVR ATmega328, the I/O clock clkI/O clocks both inputs, outputs, and timers.
"For an I/O port, the delay can be 0.5-1.5 clock cycles.
"The {timer} synchronization and edge detector logic introduces a delay of 2.5 to 3.5 system clock cycles from an edge has been applied to the T1/T0 pin to the counter is updated." {17.3}
 

Offline Manul

  • Super Contributor
  • ***
  • Posts: 1406
  • Country: lt
Re: Divide by 10 cct needed
« Reply #52 on: July 02, 2026, 07:27:18 pm »
IMO clocking a MCU with a signal to be divided is not very robust. Who knows what exactly might happen if this signal glitches, drops in amplitude or becomes dc. Is MCU guaranteed to correctly recover from these conditions without a reset? I don't know and it is hard to test. Logic IC will not have such issues, recovery is guaranteed. So as an universal and robust divider, logic IC would be much preffered by me.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 22432
  • Country: gb
  • 0999
Re: Divide by 10 cct needed
« Reply #53 on: July 02, 2026, 08:46:11 pm »
This is a silly debate.

Whether to go down the MCU route, or specialised IC, depends on, what one has available and whether it's just a one-off or a large production run. If it's one off, just use what's on hand, but if it's a large production run, go for the specialised IC of course. Also note that software is not free. It has costs associated with it: debugging, revision control, code reviews etc.
 
The following users thanked this post: PCB.Wiz, Benta

Online ledtester

  • Super Contributor
  • ***
  • Posts: 4169
  • Country: us
Re: Divide by 10 cct needed
« Reply #54 on: July 02, 2026, 10:56:05 pm »
In the AVR code the 10 MHz signal does not go through a GPIO pin. Rather, it is used as the CPU clock and a timer is configured to toggle an output pin every 5 cycles.

Not an expert having never left theory to TEST performance, but using an MCU has the required flip-flop to consider. Example AVR ATmega328, the I/O clock clkI/O clocks both inputs, outputs, and timers.
"For an I/O port, the delay can be 0.5-1.5 clock cycles.
"The {timer} synchronization and edge detector logic introduces a delay of 2.5 to 3.5 system clock cycles from an edge has been applied to the T1/T0 pin to the counter is updated." {17.3}

The 10 MHz signal does not go through a synchronizer.
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 9065
  • Country: ca
Re: Divide by 10 cct needed
« Reply #55 on: July 03, 2026, 05:24:22 am »
If you're referring to feeding the 10MHz reference oscillator in as the MCU clock, yes the input does not pass through a synchronizer and the timer/counter can use that I/O clock.
I see that is how the lastest Bluepill GPSDO designs are doing it. For those, I wasn't sure if it was due to not enough timer bits for 10M count.
 

Offline Picuino

  • Super Contributor
  • ***
  • Posts: 1464
  • Country: es
    • Picuino
Re: Divide by 10 cct needed
« Reply #56 on: July 03, 2026, 09:04:48 am »
This is a silly debate.

Whether to go down the MCU route, or specialised IC, depends on, what one has available and whether it's just a one-off or a large production run. If it's one off, just use what's on hand, but if it's a large production run, go for the specialised IC of course. Also note that software is not free. It has costs associated with it: debugging, revision control, code reviews etc.

It’s always the same story.
There are two technologies available, each with its own advantages and disadvantages. Therefore, one technology will make more sense to some people from their perspective, while another technology will make more sense to others from their perspective. Arguing over who is right—each from their own particular perspective—is quite self-centered.
The debate itself is a good thing. Presenting all points of view enriches everyone’s understanding. But presenting my point of view as the only valid one is like going through life with blinders on.

The most productive approach is to say: “I have this perspective, and from that perspective, this is better for such-and-such a reason and worse for such-and-such another reason.”

I've learned a few things from this discussion that I hadn't considered before. Please don't ruin it by trying to prove yourselves right.
 
The following users thanked this post: Someone

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 14126
Re: Divide by 10 cct needed
« Reply #57 on: July 03, 2026, 09:57:05 am »
The input and output frequencies are fixed.  Ignoring
tl;dr
my solution is a piece of wire + switch
since that analyzer is anyway running at internal 10MHz

One could simply use an injection locked oscillator.   I'm sure the gurus here can design one using ridiculously few transistors!
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 6464
  • Country: nz
Re: Divide by 10 cct needed
« Reply #58 on: July 03, 2026, 10:02:15 am »
This is a silly debate.

Whether to go down the MCU route, or specialised IC, depends on, what one has available and whether it's just a one-off or a large production run. If it's one off, just use what's on hand, but if it's a large production run, go for the specialised IC of course. Also note that software is not free. It has costs associated with it: debugging, revision control, code reviews etc.

It’s always the same story.
There are two technologies available, each with its own advantages and disadvantages. Therefore, one technology will make more sense to some people from their perspective, while another technology will make more sense to others from their perspective.

It's not a question of the perspective, it's a question of the situation. Some situations suit one solution and some situations suit another solution, and choosing between them is called "engineering". If you always reflexively choose the some solution then you're not doing engineering correctly.

Something it seems the "use 74-series counters and some gate logic to reset them at the right count" people don't seem to have considered is that the microcontroller solutions offered are doing EXACTLY THAT.  The MCUs have a bunch of binary counters and comparators — basically XORing the counter value with a fixed value and ORing all the bits together to check for equality. The actual work isn't being done by a program. All the dozen or so assembly language instructions are doing is wiring up the desired circuit using the available hardware. That happens in the first microsecond or two after power-on (or at least after the MCU starts running instructions) and then the CPU can just go to sleep. From that point on you are simply running sequential logic in hardware, exactly the same as you would by wiring together some 74xx chips, but all contained in a single chip that because it is made in huge volume is very very cheap ($0.10 for CH32V003 or PY32F002a).

If there were CPLDs or FPGAs in the less than $1 price range then those could be the go-to answer.

The Xilinx XC2C32A has 32 "macro cells", 750 gates, and runs up to 450 MHz with propagation delay as low as 3.8ns, and supports IO voltages from 1.5V to 3.3V, but it costs $5 even in quantity.

Some Lattice iCE40 FPGAs go as low as $2 with 384 LEs. They also support IO voltages between usually between 1.5V and 3.3V while the FPGA itself runs from 1.2V.

They're also not as easy to use, electrically.
 

Offline mr ed

  • Regular Contributor
  • *
  • Posts: 219
  • Country: ca
Re: Divide by 10 cct needed
« Reply #59 on: July 03, 2026, 12:23:17 pm »
Did you actually just try 10MHz ?  Sometimes its only an edge is used if the circuit is PLL based. Sometimes.
 

Online Gyro

  • Super Contributor
  • ***
  • Posts: 11165
  • Country: gb
Re: Divide by 10 cct needed
« Reply #60 on: July 03, 2026, 12:28:14 pm »
Just for interest, exactly the same question and resulting discussion in 2020... https://www.eevblog.com/forum/projects/easiest-way-to-divide-10mhz-to-1mhz/
Best Regards, Chris
 
The following users thanked this post: Someone, edavid, ledtester, Uunoctium

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 9065
  • Country: ca
Re: Divide by 10 cct needed
« Reply #61 on: July 03, 2026, 08:58:39 pm »
That old thread 11 posts to bring up the MCU solution. This thread only 3 posts to bring up the MCU solution. The trend is increasing  ::)

I think it's an interesting discussion regardless if it's overkill or not. Many times engineers go overboard on a design for the fun and learning instead of always being boxed in to the cheapest and simplest solution.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 7176
  • Country: de
Re: Divide by 10 cct needed
« Reply #62 on: July 03, 2026, 09:43:31 pm »
Many times engineers go overboard on a design for the fun and learning instead of always being boxed in to the cheapest and simplest solution.

That's not engineers. That's amateur hobbyists. An engineer would never do that. If he/she did that, I'd fire the nerd.

 
The following users thanked this post: Xena E

Online Gyro

  • Super Contributor
  • ***
  • Posts: 11165
  • Country: gb
Re: Divide by 10 cct needed
« Reply #63 on: July 03, 2026, 09:49:05 pm »
That old thread 11 posts to bring up the MCU solution. This thread only 3 posts to bring up the MCU solution. The trend is increasing  ::)

I think it's an interesting discussion regardless if it's overkill or not. Many times engineers go overboard on a design for the fun and learning instead of always being boxed in to the cheapest and simplest solution.

It contained a lot more on jitter data and discussion. The picDIV data would have been much more useful if it hadn't been plugged into a solderless breadboard though.
Best Regards, Chris
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 6464
  • Country: nz
Re: Divide by 10 cct needed
« Reply #64 on: July 04, 2026, 03:16:36 am »
Many times engineers go overboard on a design for the fun and learning instead of always being boxed in to the cheapest and simplest solution.

That's not engineers. That's amateur hobbyists. An engineer would never do that. If he/she did that, I'd fire the nerd.

How is minimising cost and board space by using a single tiny chip (e.g 8 pin or even smaller) instead of several chips "amateur"?
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3355
  • Country: au
Re: Divide by 10 cct needed
« Reply #65 on: July 04, 2026, 03:21:18 am »
How is minimising cost and board space by using a single tiny chip (e.g 8 pin or even smaller) instead of several chips "amateur"?

Where on earth does the gross exaggeration of 'several chips' come from ?  :palm: :-//
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 9065
  • Country: ca
Re: Divide by 10 cct needed
« Reply #66 on: July 04, 2026, 04:16:06 am »
Many times engineers go overboard on a design for the fun and learning instead of always being boxed in to the cheapest and simplest solution.

That's not engineers. That's amateur hobbyists. An engineer would never do that. If he/she did that, I'd fire the nerd.

I've worked with engineers that go overboard on a design because they are kinda bored. Or want to gain a new skill. Sometimes Product Marketing wants gimmick features to brag about.
Look at VW and Stellantis using the ECU with brushed motors for cabin climate control dampers. My Toyota has a cable. No drama at -30C.
Look at VW using ECU+stepper motor w/resin housing as the thermostat for precise engine coolant temp control. A friend paid several grand to fix that after it started leaking, which they all do.
My Toyota, wax pellet thermostat and aluminum housing, $30 and 20 minutes for me to replace it.
Agilent 34461A/34465A/34470A, three MCU's all different makes it a bit ridiculous unless you want to expand your repertoire. SPEar320 ARM926 333MHz 128MB Ext. FLASH+DDR,  LM3S1D21 ARM M3 80MHz 512KB FLASH, 8051 for the power switch lol, FPGA. Talk about overkill, it's a bench multimeter.
My point is KISS is obsolete lol.

How is minimising cost and board space by using a single tiny chip (e.g 8 pin or even smaller) instead of several chips "amateur"?

Where on earth does the gross exaggeration of 'several chips' come from ?  :palm: :-//

How you measure the "size" of the solution, it is many factors - # IC's, cost $, sweat equity, time to implement, amount of knowledge gained etc.

A single IC divider ('190, '390) does good on all of those - except learning I think.
For the discussion, it's good to know the limitations of fast clocking a timer/counter (metastability, Nyquist etc.) and the way around that.
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 6464
  • Country: nz
Re: Divide by 10 cct needed
« Reply #67 on: July 04, 2026, 04:27:20 am »
How is minimising cost and board space by using a single tiny chip (e.g 8 pin or even smaller) instead of several chips "amateur"?

Where on earth does the gross exaggeration of 'several chips' come from ?  :palm: :-//

Yes, all solutions suggested are either large chips or multiple chips.

CD74HC190: large (16 pin) chip, MIN/MAX output it hi for only one clock (not 50/50 duty cycle). Won't do 10 MHz.

CD4017: large (16 pin) chip. At least CO stays hi for 5 cycles.

74HC390: large (16 pin) chip. Can be configured for /5 then /2 for 50/50 duty cycle.

74HC4017: large (16 pin) chip. TC toggles every 5 cycles.

four D flip-flops (two dual D flip-flop ICs e.g. 74HC74): that's two 14 pin chips

All of AVR, Arm, RISC-V MCUs are available in 8 pin packages and all allow using a pure hardware solution once a very short program sets up the wiring of the internal hardware at power-on, while also being cheaper (at least for the Puya Arm and WCH RISC-V).

Or a $0.03 Padauk MCU where the PMS150C-U06 is a 6 pin package (SOT23-6 2.9x1.6 mm). I'm not sure it's fast enough though.
« Last Edit: July 04, 2026, 04:31:24 am by brucehoult »
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3355
  • Country: au
Re: Divide by 10 cct needed
« Reply #68 on: July 04, 2026, 06:10:11 am »
Yes, all solutions suggested are either large chips or multiple chips.
:palm:

Which is a big climb down from your own blanket claim of 'several chips' as the MCU alternative.
Reality is a single jelly bean logic part is the proctical alternative.
Tip: You harm your own cause with spurious nonsense claims.

I have looked at using MCU as logic myself, but never to replace such an ordinary and available part.
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 6464
  • Country: nz
Re: Divide by 10 cct needed
« Reply #69 on: July 04, 2026, 06:32:08 am »
Yes, all solutions suggested are either large chips or multiple chips.
:palm:

Which is a big climb down from your own blanket claim of 'several chips' as the MCU alternative.

It wasn't a blanket claim.

I also recall someone else suggesting a binary counter and some and gate(s) to generate a reset signal. Which is a more general solution than chips that put out a carry out exactly and only when 10 is reached.

Quote
Tip: You harm your own cause with spurious nonsense claims.

I don't have a cause. I consider all available solutions, unlike those here who rule out some solutions out of hand.

As far as I can tell, OP wanted a quick one-off solution to a current problem, they weren't designing something for mass production. I have a bag of CH32V003s on hand (and actually quite a few ATTiny85's too) and can whip up the solution using either one in 10 or 15 minutes. To use a CD4017, 74HC390, 74HC4017 I'd have to order one in and wait a few days.
 

Online negativ3

  • Frequent Contributor
  • **
  • Posts: 573
  • Country: th
Re: Divide by 10 cct needed
« Reply #70 on: July 04, 2026, 07:08:19 am »
Had a similar situation. I needed a toggle switch pressing once when 5V became present, then toggling again once when 5V was removed. A ~2000mS on-delay and a toggle switch press time of >300mS.

An attiny412 plus a 2n3904 were at hand and the job was done in 30 minutes.

Whats at hand determines a lot.
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 6464
  • Country: nz
Re: Divide by 10 cct needed
« Reply #71 on: July 04, 2026, 07:18:54 am »
Had a similar situation. I needed a toggle switch pressing once when 5V became present, then toggling again once when 5V was removed. A ~2000mS on-delay and a toggle switch press time of >300mS.

An attiny412 plus a 2n3904 were at hand and the job was done in 30 minutes.

Whats at hand determines a lot.

You could even whip that up in the Arduino IDE in a couple of minutes, and use ArduinoISP running on an Uno to program a bare chip.

That would really asplode a few heads here.

It's like playing "Stairway" in a guitar shop.
 
The following users thanked this post: negativ3

Online negativ3

  • Frequent Contributor
  • **
  • Posts: 573
  • Country: th
Re: Divide by 10 cct needed
« Reply #72 on: July 04, 2026, 07:27:47 am »
You could even whip that up in the Arduino IDE in a couple of minutes, and use ArduinoISP running on an Uno to program a bare chip.

That would really asplode a few heads here.

It's like playing "Stairway" in a guitar shop.

I did and dead-bugging it in place was the longer part of the job.
 

Offline eugene

  • Frequent Contributor
  • **
  • Posts: 600
  • Country: us
Re: Divide by 10 cct needed
« Reply #73 on: July 04, 2026, 11:58:00 am »
Anyone that, like me, spent the past couple of decades designing embedded systems would absolute not think that using a 6 pin ATtiny is overkill. I could write the program and flash the chip while the soldering iron is warming up.

OTOH, a decade counter I would have to order from DigiKey. As was stated in post #2 in this thread, the best one-off solution uses whatever you have on hand. As I stated several times in this thread, I don't care what solution anyone chooses, but shit-talking the solutions you don't understand is arrogant and not the kind of discussion I like to see here.
90% of quoted statistics are fictional
 

Offline G0HZU

  • Super Contributor
  • ***
  • Posts: 3747
  • Country: gb
Re: Divide by 10 cct needed
« Reply #74 on: July 04, 2026, 01:29:19 pm »
Quote
I could write the program and flash the chip while the soldering iron is warming up.

I had a soldering iron like that once.
 
The following users thanked this post: PA0PBZ, Gyro, PCB.Wiz, Benta, eugene, Manul, harerod, ME


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->