I'm in the midst if designing a small LED controller, and through sheer design brilliance (hah, blind luck) have a spare pin left over. I would like to add a feature to have a single master control the timing of multiple slaves, and am thinking through various mechanisms to handle this.
The controller cycles through the displays on a 10ms TICK - that's what should be synced between devices. The master would use a timer to produce the 10ms interrupt, and that routine should notify the slaves via external interrupt to jump into the same processing routine.
Something alone the lines of
// 10ms interrupt and external interrupt both point here if (mode == MASTER) { pulse SYNC_PIN } process_LEDs()
The master interrupts into the 10ms handler, pulses the sync pin to the slaves, then starts to process the LEDs. The slaves see the pulse and hop into the external interrupt handler (same basic code) and process the LEDs. Latency should be pretty small, hopefully.
This is purely the 1st pass at this, and I'm missing a lot of ancillary stuff I know. I also know this is a well-known wheel, designed many times in the past. So does anyone have any hints, either hardware or software ?
I could find another pin to make it a two-pin interface. Would mean losing a status LED on board though - which I would rather keep if I can.