Time Synchronization

MiWi Development Environment

MiWi(TM) Development Environment Help
Time Synchronization
Motivation

In a practical wireless network, large number of sleeping node may be connected to a single Full Function Device (FFD). All sleeping devices can sleep for a while and wake up and request indirect messages in a duty cycle. If multiple sleeping devices wake up around the same time and send Data Request to the FFD, some of those packets may collide and get lost, or have to try multiple times before a positive acknowledgement can be received. This scenario also put burden on the FFD to handle multiple requests almost at the same time. 

 

Solution

To solve this kind of problem, each sleeping device is required to report in a predefined interval. This approach is somewhat similar to beacon network which is defined in IEEE 802.15.4. However, beacon network in IEEE 802.15.4 only support star topology and require extensive hardware assistant. Our solution is simpler and requires far more less system resources. It is also suitable to be implemented in transceivers that is not IEEE 802.15.4 compliant. 

Our solution have the FFD to control the timing of the sleeping device when to wake up and check in next time. As the result, the timing information will be attached to the indirect message response time. The indirect message has been changed to the following format:

Name 
MAC Command 
Rough Timing Info 
Precise Timing Info 
Indirect Message 
Length (BYTE) 
various 
Description 
Time Sync Data Packet Command (0x8A) for data indirect message.
Time Sync Command Packet Command (0x8B) for command indirect message. 
Timeout times on timers. Timers timeout roughly once per 16 seconds. 
Timer ticks for precise timing control. One timer tick is configured to be around 244 us. 
The indirect message itself. 

 

Interfaces

To enable Time Synchronization feature, ENABLE_TIME_SYNC must be defined in configuration files for protocols: ConfigP2P.h, ConfigMiWi.h or ConfigMiWiPRO.h. The reason of enabling this feature in protocol layer instead of application layer is that both sleeping devices and FFDs must enable this feature at the same time. While configuration files in application layer is for each individual devices and configuration file in protocol layer is for every devices, it makes sense to enable/disable this feature in the protocol layer to avoid any mismatch in feature enabling. 

Additional configuration for Time Synchronization is the total number of slots, TIME_SYNC_SLOTS, supported in the wake up interval of sleeping devices. As the rule, the TIME_SYNC_SLOTS must be higher or equal to number of sleeping devices that connects to the FFD, so that every sleeping device can have at least one time slot. Same as ENABLE_TIME_SYNC, TIME_SYNC_SLOTS is defined in protocol configuration files ConfigP2P.h, ConfigMiWi.h or ConfigMiWiPRO.h for the same reason above. Another configuration is the frequency for the external crystal that connects to the 16-bit asynchronized counter. 

Apart from the configurations in protocol layer, there is no special requirement for function calls on application layer. There are additional hardware requirement for this feature. The details of additional hardware requirement can be found in the next section. 

 

Additional Notes

Time Synchronization feature requires hardware support. The MCU needs a 16-bit timer working as asynchronized counter mode on a 32KHz external crystal. The timer will be able to run when the MCU is in sleep mode and wake up the MCU once it reaches the preset interval. 

When Time Synchronization feature is enabled, the minimum time slot depends on the primary oscillator accuracy, 32 KHz external crystal accuracy as well as random time delay caused by CSMA-CA on the environment noise. On standard Microchip demo board, the time slot can be lowered to 100 millisecond.

Microchip My Application xx.yy - [Jan 1, 2009]
Copyright © 2009 Microchip Technology, Inc.  All rights reserved.