Go Down

Topic: 2 independent ATtiny blinking at the same time (Read 134 times) previous topic - next topic


I need 2 independent ATtinys to control some leds. I need both Attiny make blink the same leds at the same time. I can not wire them together and I don't need perfect synchronization. I expected switching them on at the same time they would blink same leds at the same time, but one system blinks faster than the other. So I tried adding external quartz crystal, but still one system blinks faster than the other. What to do?


My Adventures in the Making:


The clocks on the two ATtinys will always be different, so unless they "talk" to each other, it is impossible for them to be synchronized.


Nov 07, 2014, 01:36 am Last Edit: Nov 07, 2014, 01:39 am by mrburnette
So I tried adding external quartz crystal, but still one system blinks faster than the other. What to do?
Did you set the fuses to use the external crystal?

I don't need perfect
Anyway, assuming high-quality crystals and identical ambient temperature, you may get close with using small trimmer (or gimmick capacitor) to adjust the oscillators.  An o'scope would be useful.  Instead of syncing with power-on, sync with reset.  

I honestly do not expect a very happy outcome with manual settings, but it may get you close enough.

Ref: reference-oscillator-tuning



Did you use the same board file for both of them ?
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter


Nov 07, 2014, 08:36 am Last Edit: Nov 07, 2014, 08:39 am by JoeN
I need both Attiny make blink the same leds at the same time.
I don't need perfect synchronization.
You really haven't given us any requirements here.  How long must this be run with only "pretty good" synchronization?  What is good enough, anyway?  How far apart are the blinks and for how long are the LEDs active?  You write engineering requirements like an art student.

A crystal might have an accuracy of 50ppm.  If I assume a run time of an hour and a 50ppm crystal, after 3600 seconds (an hour), the synchronization may be off by .18 seconds, pretty far off.  After two hours, it may be .36 seconds off, really pretty obvious for example if the LED is blinking every second, maybe not so bad if it is blinking every minute.  Again, not too easy to tell if this is within your requirements because of how poorly they are defined.  But if this works for you, use the crystal, make sure the fuses are set to use an external oscillator, and make sure both devices are reset at the same time.  The idea about trimming the crystal with external capacitance is a good idea too, maybe it will get you closer.  If not, probably you need some sort of radio synchronization.
I have only come here seeking knowledge. Things they would not teach me of in college.


Ditto JoeN's reply, we need more information.

You say 2 independent tiny's blinking the same LED's at the same time.
Why can this not all be done with a single tiny?
If they are blinking the same LED's then you have a connection between the tiny's that you might be able to exploit to synchronize them.
I might seem like an idiot but remember it takes one to know one.
Forum user generally fall into three categories (the good, the bad & the a**hole) what category do you fit in?

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131