Synchronising two circuit tasks

Hi Guys

I've got two standalone circuits (one 328P controlled and one Tiny24 controlled) and each one switches between some different led lighting patterns in response to the operation of its own hall sensor. Each sensor operation currently changes the lighting pattern on its connected circuit only.

I now intend that no matter which of the two hall sensors are operated, both circuits will change their own unique pattern in response to operation of either of the sensors and at the same time (no real timing issues here, within the same second is fine). The two circuits will never be more than 1500mm apart.

My question is in regard to which is the better of the following two ways to achieve this (leaving aside for a moment that there are probably many other better ways):

  1. The simplest way - connect the two hall sensors in parallel such that no matter which one is operated, both circuits see the sensor change and do "their own thing" in response and simultaneously

or

  1. The more complicated way of using two wires between the circuits and no matter which circuit's hall sensor is operated, that circuit sets the two connecting lines high, low, or one high one low (or vice versa) for the other circuit to read and react to, ie one of four binary states, which is just the number of different patterns I need to control. The two lines would enable both circuits to see the current state, . Both circuits would continuously check the line states, both see the same binary pattern and will be programmed to react accordingly.

The way I see it is that whilst the first option is much simpler, the second is more foolproof in that both circuits will "see" what state it is expected to be in all the time, and not run the risk of missing a sensor read when the other circuit HAS read it, and hence getting out of sync with the other circuit.

I'd like to hear a more experienced view on this though please. The coding is not a problem - its the more elegant and reliable solution I'd like help in choosing (or would I be better off using IC2?).

Many Thanks Bernie

and not run the risk of missing a sensor read when the other circuit HAS read it,

If the sensors are wired in parallel to two processors there is no way one can read it without the other reading it. Reading a sensor with one processor does not take away the fact that the sensor is still signalling a detection of the magnetic field and so can be read by the other as well.

I was rather hoping someone would say that Grumpy_Mike ;) !

I think its a hangover from my mechanical engineering background (belts and braces mentality), that I even considered an alternative to the parallel sensors. In fact, thinking about it more now, I think I should have considered that if a processor is capable of missing a sensor reading then it's just as likely it could miss seeing the "message" from the other processor!

Thanks for the nudge I needed to stop prevaricating and start doing!

Bernie

BTW, anyone any idea as to why my avatar may have disappeared for no reason?

BTW, anyone any idea as to why my avatar may have disappeared for no reason?

New forum software a few weeks back, you might have to reload it.