text: Q:
  
  Choosing a crystal for a long-running synchronizing application between two microcontrollers
  
  I learned from research that crystals (HC49/U style casing) experience drift which causes timing to be inaccurate in the long haul.
  My project is a laser tag system in which one microcontroller (AT89C4051) in the target continuously searches for specific laser patterns from a gun which also uses the same microcontroller. Both use the exact same crystal (22.1184 Mhz) from the exact same manufacturer and the circuit board traces on both boards from microcontroller to crystal leads are the same. The capacitors between the crystal leads and ground are all 33 pF NPO (5%) from the same manufacturer. 
  Now if I write the software perfectly, start everything at the same time and run everything for about a minute or so, everything will fall in sync. I'm also running another unit that would cause everything to try to be in sync periodically (by the master sending sync bytes).
  But what about drift?
  Let's say I power each unit with a fully charged 6800 mAh battery for 10 hours. (Ok, I understand a real laser tag game would not last 10 hours, but I'm going for worst cases here). Then one battery decides to die 1 hour later and I replace it.
  Since the crystal is almost 24 Mhz, the microprocessor would execute instructions about one every 540 nS. So if I had the micro running for say 10 hours, would instructions still run at 540 nS at that point? or would the time alter on every minute due to drift?
  Like, for minute one, would each instruction take 540 nS to execute then minute two 538 nS then minute three 541 nS? 
  I'm just trying to understand the best crystal parameters regarding drift to choose for my application so the data doesn't get out of sync (just because of possible drift resulting from continuous operation).
  I mean I seen specs like frequency stability and tolerance measured in ppm when I looked at crystals on Digikey, but what are the best numbers to aim for and how do I convert those numbers to the amount of time I can have guaranteed instruction stability before major drift affects the operation of the synchronization?
  
  A:
  
  Garden-variety crystals only have an initial accuracy on the order of 100 ppm, before you even start to consider thermal and voltage effects. You can spend more money and push things down to on the order of 10 ppm, or you can spend a LOT more money for temperature compensated or even ovenized crystals to do even better than that.
  Two 22.1184 MHz crystals whose frequencies differ by exactly 100 ppm will have a phase difference of 2211.84 whole cycles after just one second. Crystals 1 ppm apart will have drifted by 22.1184 cycles in that period.
  So no, you can't rely on "blind" synchronization for any meaningful length of time. You need to design your system so that the subsystems remain in sync despite the inaccuracies of their individual clocks. Basically, they need to communicate with each other in some way on a continual basis.
  
  Of course, it isn't at all clear why a laser tag system would require that kind of global synchronization in the first place. Sounds like some sort of X-Y problem. What problem does that sort of approach solve for you?
  
  A:
  
  Any system that relies on instruction to instruction synchronization of two units is doomed to fail. It is not needed, and nobody ever does it. 
  Using the same nominal frequency crystal will get you within +/- 100ppm as built, which is completely adequate to get bit rates correct, so they can talk to each other. +/- 10ppm can be got with extra work and cost, but there is really little point for the system you want to run.
  Once communicating, they should sync their activity to the exchange of messages.
  
  