Patent Description:
Asynchronous devices are devices that operate without reference to a global clock system. The processing clock of asynchronous devices therefore operates independently of any frequency in the system to which the device is connected to. When considering two asynchronous devices, these devices will exhibit asynchronous behaviour relative to each other even if they appear identical from a hardware and software perspective. This is due to the tolerances on the components and the processing clock. The result of this asynchronous behaviour is that the processing cycle of one device will be slower than the processing cycle of the other device. This can cause divergence in systems that use two asynchronous devices such as dual motor control systems. In such situations, an additional mechanism is needed to prevent this divergence.

One way to solve this problem is to synchronize one of the devices with the other device. This results in a dependency between the devices in what is known as a master/slave relationship. There are three main issues that can result from this. A first is that it must be decided which device becomes the "master" device, to which the "slave" device will be synchronized with. A second issue is how to handle situations when the "master" device is lost and the slave device therefore loses its reference of the "master" device. A third issue is how to handle a "babbling idiot" event of the "master" device. A babbling idiot even relates to situations when a device malfunctions and sends data at inappropriate times.

<CIT> describes a rescheduling mechanism for asynchronous devices.

The examples described herein provide a rescheduling mechanism for two asynchronous devices which does not rely on the synchronizing the two devices using a master/slave principle so that the rescheduling is not affected by the failure of one of the devices. Furthermore, the rescheduling mechanism described herein is simple, robust to failure, of low cost to implement, and does not affect the inner characteristics of the devices.

A rescheduling mechanism is therefore disclosed herein for two asynchronous devices that is simple and does not involve synchronization of the two devices using a master/slave principle. "Not involving synchronization" means that this rescheduling mechanism does not modify the inner characteristics of each of the asynchronous devices in terms of real time sequencing.

As shown in <FIG>, a first device <NUM> has a first processing clock <NUM> which operates at a first frequency. A second device <NUM> has a second processing clock <NUM> which operates at a second frequency. Due to the manufacturing tolerances of the first device <NUM> and the second device <NUM>, the first frequency is different from the second frequency.

Each of the first device <NUM> and the second device <NUM> complete rounds of respective processing cycles. The processing cycle of the first device <NUM> takes place within a time duration which is referred to as a first device major frame <NUM>, and the processing cycle of the second device <NUM> takes place within a time duration which is referred to as a second device major frame <NUM>. As shown in <FIG>, the first device major frame <NUM> has a longer duration than the second device major frame <NUM>. However, the alternative situation is also envisaged where the first device major frame <NUM> has a shorter duration than the second device major frame <NUM>.

Towards the end of each of the first device major frame <NUM> and the second device major frame <NUM>, each of the first <NUM> and second <NUM> devices have a respective dedicated processing time slot <NUM>, <NUM>, within which rescheduling of either the first device <NUM> or the second device <NUM> is possible. The first device <NUM> has a first device dedicated processing time slot <NUM>, and the second device <NUM> has a second device dedicated processing time slot <NUM>. The first device dedicated processing time slot <NUM> has a time duration which is referred to as first device minor frame <NUM>, and the second device dedicated processing time slot <NUM> has a time duration which is referred to as the second device minor frame <NUM>. Once a device <NUM>, <NUM> enters its respective dedicated processing time slot <NUM>, <NUM>, the main execution of the processing cycle of the device <NUM>, <NUM> will have been completed. The dedicated processing time slot <NUM>, <NUM> therefore corresponds to a short time period wherein the processing cycle has not ended but the main steps of the processing cycle have been completed. Rescheduling the devices <NUM>, <NUM> during their dedicated processing time slot <NUM>, <NUM> therefore does not affect the real time sequencing of the device <NUM>, <NUM>.

Each of the first device <NUM> and the second device <NUM> are configured to send a rescheduling signal to the other device <NUM>, <NUM> when it has completed its respective major frame <NUM>, <NUM>. The ending of the first or second major frame <NUM>, <NUM> coincides with the end of the first or second dedicated processing time slot <NUM>, <NUM>. The rescheduling signal can comprise one or more signals which indicate that the processing cycle of the device <NUM>, <NUM> has been completed. The rescheduling signal can be simple such as a discrete interface, which is of low cost to implement.

The devices <NUM>, <NUM> will only monitor and respond to the rescheduling signal if it is received by the device <NUM>, <NUM> during its respective dedicated processing time slot <NUM>, <NUM>. If one of the devices <NUM>, <NUM> receives the rescheduling signal during its dedicated processing time slot <NUM>, <NUM>, the end of the current major frame <NUM>, <NUM> of the device <NUM>, <NUM> will be modified to end earlier (or later) by a set duration which results in a rescheduled major frame <NUM>', <NUM>'. The end of the rescheduled major frame <NUM>', <NUM>' will be closer in phase to the end of the major frame <NUM>, <NUM> of compared to if no rescheduling had taken place. This rescheduling will remain in place until the device <NUM>, <NUM> receives another rescheduling signal during its dedicated processing time slot <NUM>, <NUM> at the end of its rescheduled major frame <NUM>', <NUM>'.

In the case of either shortening or lengthening the current major frame <NUM>, <NUM> during rescheduling, it should be appreciated that the major frame characteristics will be modified for the current major frame <NUM>, <NUM> only. All subsequent rescheduled major frames <NUM>', <NUM>' will have the default major frame duration. It is only the start and end times of the rescheduled major frames <NUM>', <NUM>' that has changed. The scheduling will not change until rescheduling happens again.

If no rescheduling signal is received by either of the devices during <NUM>, <NUM> during their respective dedicated processing time slots <NUM>, <NUM>, no rescheduling of the major frame <NUM>, <NUM> will occur for either device <NUM>, <NUM>.

The devices <NUM>, <NUM> can be configured such that when rescheduling takes place, the set duration by which current major frame <NUM>, <NUM> of the device <NUM>,<NUM> is shifted can either be a smaller or larger amount. If the current major frame <NUM>, <NUM> is shifted by a small amount, then rescheduling events will take place more often. The advantage of this is that the major frames <NUM>, <NUM> of the devices <NUM>, <NUM> will eventually be very close and have a small amount of jitter. A disadvantage of this is that due temperature changes or ageing of the hardware, the rescheduling conditions of the rescheduled device <NUM>, <NUM> may be lost.

An alternative is to shift the major frame <NUM>, <NUM> by a large amount. Advantageously, the rescheduling conditions will not be lost due to temperature changes of ageing of the device <NUM>, <NUM>. When the major frame <NUM>, <NUM> is shifted by a larger amount, there will be relatively higher jitter between the devices <NUM>, <NUM> compared to when the major frame <NUM>, <NUM> is shifted by a smaller amount. However, the jitter in this case may not be problematic, as shown below.

The value of the set duration by which a major frame <NUM>, <NUM> is shifted can be determined based on the clock tolerances of the devices <NUM>, <NUM>. For example, the set duration may be a rounded value of the sum of the clock tolerances of each of the devices <NUM>, <NUM>. If both of the devices <NUM>, <NUM> have a clock tolerance of 8ns, the set duration can be set to 20ns. In this scenario, if the major frames <NUM>, <NUM> have a duration of <NUM>µs and one of the devices <NUM>, <NUM> is rescheduled by 20ns, the jitter will only be <NUM>% of the major frame <NUM>, <NUM>, which is negligible.

In the example shown in <FIG>, the second device <NUM> completes its second major frame <NUM> before the first device <NUM> and sends the rescheduling signal to the first device <NUM>. As shown in case #<NUM>, because the rescheduling signal is received by the first device <NUM> during its dedicated processing time slot, the first device <NUM> has the end of its major frame <NUM> shifted by a set time duration, which results in a rescheduled major frame <NUM>'. In this example, the rescheduled major frame <NUM>' is rescheduled to end earlier which makes it closer in phase to the second device <NUM>. Other examples are also envisaged wherein the rescheduled major frame <NUM>' is rescheduled to end later. The subsequent major frames <NUM>' are rescheduled so that they begin as soon as the previous major frame <NUM>' has ended.

As can be seen in <FIG>, the first device <NUM> also receives a rescheduling signal during the dedicated processing slot <NUM> of the subsequent first device major frame <NUM>'. The first device major frame <NUM>' is therefore rescheduled to end earlier by the set time duration, which results in a rescheduled major frame <NUM>".

Case #<NUM> shows the situation where no rescheduling takes place. Since the first device <NUM> has sent a rescheduling signal to the second device <NUM> when the second device <NUM> is outside of its dedicated processing time slot <NUM>, there is no rescheduling of the second device major frame <NUM>.

It should be appreciated that the major frame duration is not modified for either of the devices <NUM>, <NUM>, but rescheduling will shorten the length of the current major frame, or instantaneous cycle duration of the device <NUM>, <NUM> receiving the rescheduling signals from the other device <NUM>, <NUM> during its dedicated processing time slot <NUM>, <NUM>.

If one the devices <NUM>, <NUM> malfunctions, for example, by becoming a "babbling idiot" and sends a burst of rescheduling signals to the other deice <NUM>,<NUM>, the other device will only consider this faulty rescheduling signal during the dedicated processing time slot. The other device <NUM>, <NUM> will therefore not have its inner functioning affected by the malfunctioning device <NUM>, <NUM>. The rescheduling mechanism is therefore fault tolerant.

Turning to <FIG>, rescheduling of the asynchronous devices <NUM>, <NUM> will now be described following start-up of one of the devices <NUM>. In the example shown in <FIG>, the first device <NUM> starts up after a reset and the second device <NUM> is functioning normally. Once the first device <NUM> has completed its Power On Built I Test, or Power On Self Test (POST), the first device <NUM> will wait until it has received the rescheduling signal from the second device <NUM>. Upon receiving the rescheduling signal, the first device <NUM> will start its first device major frame <NUM>. The first device major frame <NUM> will therefore be in phase with the start of the major frame <NUM> of the second device <NUM>.

In the event that one of the devices <NUM>, <NUM> is not functioning when the other device <NUM>, <NUM> has been reset, the other device will perform its processing cycle with its predefined major frame <NUM>, <NUM> after a waiting period and a dedicated timeout. As shown in <FIG>, the second device <NUM> is not functioning, which can be due to the device <NUM> not being powered, being faulty, or having its communication link broken. Since the first device <NUM> does not receive a rescheduling signal from the second device <NUM>, a dedicated timeout in the first device <NUM> will automatically start the first device major frame <NUM> of the first device. The rescheduling mechanism is therefore fault tolerant.

Although the above examples in relation to <FIG> and <FIG> are described in relation to the first device <NUM> being reset and the second device <NUM> either functioning normally or not functioning, the above described examples can also be applied to the situation where the second device <NUM> is being reset and the first device <NUM> is either functioning normally or not functioning.

Claim 1:
An asynchronous first device (<NUM>) in communication with an asynchronous second device (<NUM>);
wherein the time for the first device (<NUM>) to complete a processing cycle is a first device major frame (<NUM>);
wherein the first device major frame (<NUM>, <NUM>') comprises a first device dedicated processing time slot (<NUM>) at the end of the first device major frame (<NUM>, <NUM>'), wherein the first device (<NUM>) is configured to send a rescheduling signal to the second device (<NUM>) when it has completed a first device major frame (<NUM>, <NUM>'); and
wherein the first device (<NUM>) is configured, during every first device dedicated processing slot (<NUM>) of every first device major frame (<NUM>, <NUM>'), to:
monitor for a rescheduling signal sent from the second device (<NUM>) to the first device (<NUM>); and
if a rescheduling signal from the second device (<NUM>) is received:
shift the end of the current first device major frame (<NUM>) to end earlier by a set duration to result in a rescheduled first device major frame (<NUM>') so that the end of the rescheduled first device major frame can be closer in phase to the end of a major frame of the second device that sent the rescheduling signal;
reschedule the subsequent first device major frames (<NUM>) such that each subsequent rescheduled first device major frame (<NUM>') starts as soon as the previous rescheduled first device major frame (<NUM>') has ended.