I have a square signal (fixed but can be between 12MHz and up to 48MHz) and I would like to create every 8 clocks a pulse as brief as possible, no more than 1/4 of the period.

Pulse every 8 clocks

First, a couple of loose constraints: - voltage is at 1.8V but I could have a shift level up to 5V if needed. - I need the pulse every 8 times, but I would be fine with every 16 or every 32 times.

The key objective is to have the most SIMPLEST approach. Please avoid any answer suggesting a teraflop super computer!

Similarly, FPGA would really make sense but it's like killing a mosquito with a bazouka.

One option consists of using an Atmel 8-bit chip such as AtTiny85 but it's limited to 20MHz so I'm not sure if it could really work or not.

I have read this page with great interest: http://ued.udjat.nl/counter/ and I'm wondering if I could use a similar stratagem.

I prefer AtTiny because of the small package, then Atmel, then Cypress, then Microchip but I'm listening for any option. Is there any option to do something without a "micro processor"?


You can solve this problem with just a couple of parts. TI makes logic parts in their 74AC logic family that operate correctly down to 1.5V. Use a 4 bit counter as shown below to repeatedly count from 8 to 15. Use the RCO output, which is a one clock wide pulse to reload the counter and to also drive an R/C circuit to produce the narrow pulse that you require.

enter image description here

If you desire to produce the pulse for every 16 input cycles then just connect the D input to GND instead of being pulled up to the VCC rail.


If I understand you correctly, then what you want could be achieved using a simple counter IC and a couple of logic gates. You could use a similar strategy to the linked project.

For example, something like this 4-bit, 200MHz binary counter (or a similar chip) could be used with a couple of gates to check for every x111 state (i.e. 0111 and 1111) which happens every 8 cycles. The brief pulse can be created with an RC high pass filter to create the desired edge and another gate to square it up.

Of course many micros with a capture/compare peripheral would be suitable for this - off the top of my head I think the PIC16F1828 would probably be suitable. There are many faster options such as PIC32, Cortex-Mx, etc, but what to go for would depend on how much the uC would be used. You are right it would be overkill to use e.g. an FPGA or Cortex-M4 just for this task.

A more suitable IC might be the popular 4017 decade counter. With this you would not need any other chips (apart from the pulse shortening bit), you can set it to divide by N (i.e. divide by 2,3,4,5,6,7,8...) by simply connecting the appropriate output to the reset pin. Here are a few pages with info:

All About Circuits
4017 Datasheet
Doctronics 4017 page


A CPLD like an XC2C32 from Xilinx would be perfect.

  • Like an FPGA but much less complicated and powerful
  • Can run at up to 300MHz
  • 1.8V operation
  • Cheap (less than $2)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.