Synchronous TTL pulse/trigger box

Hi all,

I'm very new to the Arduino and have been trying to make a trigger box that will accept and/or generate a reference TTL pulse at a given frequency and produce two synchronous pulses with different frequencies and duty cycles. An example would be:

Reference/Input TTL pulse frequency: 30 Hz
Output 1: 15 Hz (input / 2)
Output 2: 3 Hz (input / 10)

I do not have extremely rigid values in mind for the input or output frequencies but I'd like Output 1 to trigger about 10-15 times a second and output 2 to fire about 3 or 4 times a second. The length of the trigger pulses needs to be relatively short ~5 ms. For the TTL pulses to act as triggers I believe I'd need them to have a peak voltage of 3-5V. Also, ideally I want to be able to change all of these values easily in the code, if need be i.e. divide by 5 instead of 10, divide by 4 instead of 2 etc.

I'm really not sure where to start with the code or if using a full-blown Arduino is really the way to go. I have tried to read into using a counter/divider such as the one below, instead of an Arduino:

http://docs-europe.electrocomponents.com/webdocs/0fde/0900766b80fde40c.pdf

however, I can't get my head around how to program these for different output frequencies and whether or not this chip could do whatI need to do. Also, I feel like changing the frequency divider in Arduino code would be a lot easier than changing the wiring of the chip, so the Arduino would probably give me more flexibility. As I said, my electronics knowledge is very poor. Hence why I'm trying to learn through small Arduino projects.

In summary, if anyone has any ideas of the best way to output two synchronous TTL pulses, both with frequencies a function of an input/reference pulse, then I'd be really grateful. If anyone could explain how I could achieve the same output pulses using a simple counter/divider chip, then please let me know if you think that using an Arduino is overkill.

Many thanks!

I'm not a discrete electronics guy, so I can't help with finding an off-the-shelf chip to do this. Somebody else will surely chime in.

Assuming that the input frequency is less than 1-2MHz and the desired output frequencies are always less than the input frequency (and not more), this would be absolutely trivial to implement using the Arduino. You can then use an ATTiny85 by itself forthe final product. You wouldn't even need a crystal or anything else.

Hook up the input frequency to an external interrupt on the ATTiny, count the pulses and toggle two output pins when the counter reaches a certain value. Reset, rinse, repeat... < 10 lines of code for sure.

int2str:
I'm not a discrete electronics guy, so I can't help with finding an off-the-shelf chip to do this. Somebody else will surely chime in.

Assuming that the input frequency is less than 1-2MHz and the desired output frequencies are always less than the input frequency (and not more), this would be absolutely trivial to implement using the Arduino. You can then use an ATTiny85 by itself forthe final product. You wouldn't even need a crystal or anything else.

Hook up the input frequency to an external interrupt on the ATTiny, count the pulses and toggle two output pins when the counter reaches a certain value. Reset, rinse, repeat... < 10 lines of code for sure.

Thanks so much for the quick reply. I will read more into using interrupts as they definitely seem to be the easiest solution.