Change the Speed of Blink LED with variable clock source ATTINY85

Hi there,

I am attempting to blink an LED for a visual representation of a delayed signal am having trouble getting the LED to blink at the correct rate.

Is there a way to internally divide the external clock signal with an ATTINY85 and have an LED blink on every 325th rising edge?

When you say an "external clock signal" you mean the clock signal of something you're investigating applied to a GPIO pin? (in this case, it's pretty easy assuming the signal isn't faster than a couple hundred kHz ) You'd have to use an interrupt and count up manually, since both the timers on the 85 are 8-bit (on a chip where you can clock a 16-bit timer off an external signal - ie, basically every AVR except the tiny x5, x61 and some really low spec ones; almost everything has at least one 16-bit timer with external clock option; the tiny841/441 has two, and the larger megas have several)

Or do you mean that you've set the fuses to make it use this external clock source as the system clock? This is a whole different ball-game.

I have set the fusebits so the attiny85 accepts a 20Mhz crystal as the clock source. But we are actually using the clock output from PT2399 Delay Chip as the input clock for the attiny85. We've limited the clock speed so it ranges from about 2Mhz - just under 20Mhz.

The end goal is to get the LED to blink ever X number of clock cycles.

You should probably set the fusebits to use "external clock" not external crystal?

But yikes, making it count clocks like that is rough - certainly not with an Arduino sketch (since you need to have precise control over what executes). (You would have a much easier time, I think using, say, a T84 clocked at 20 off a crystal, using timer1 to count the pulses and clocking that off the external clock and using the compare match interrupts...)