Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

TOC(depth=5,TschTiming)

Home Tutorial

Timing Constants

By default, we use a 15ms timeslot template:

 

common

GINA

 

TelosB

 

 

provisioned

measured

provisioned

measured

Time-slot related

 

 

 

 

 

#TsTxOffset

4000us

 

 

 

 

#TsLongGT

1300us

 

 

 

 

#TsTxAckDelay

4000us

 

 

 

 

#TsShortGT

500us

 

 

 

 

#TsSlotDuration

15000us

 

 

 

 

Execution speed related

 

 

 

 

 

#maxTxDataPrepare

 

2014us

746us

2899us

2420us

#maxRxAckPrepare

 

305us

83us

610us

474us

#maxRxDataPrepare

 

1007us

84us

1000us

477us

#maxTxAckPrepare

 

305us

219us

793us

746us

Radio speed related

 

 

 

 

 

#delayTx

 

214us

219us

366us

352us

#delayRx

 

0us

cannot

0us

cannot

Radio watchdog

 

 

 

 

 

#wdRadioTx

1000us

 

 

 

 

#wdDataDuration

5000us

 

 

 

 

#wdAckDuration

3000us

 

 

 

 

Or, if you define it in C code:

// Atomic durations
// expressed in 32kHz ticks:
//    - ticks = duration_in_seconds * 32768
//    - duration_in_seconds = ticks / 32768
enum ieee154e_atomicdurations_enum {
   // time-slot related
   TsTxOffset                =  131,                  //  4000us
   TsLongGT                  =   43,                  //  1300us
   TsTxAckDelay              =  131,                  //  4000us
   TsShortGT                 =   16,                  //   500us
   TsSlotDuration            =  PORT_TsSlotDuration,  // 15000us
   // execution speed related
   maxTxDataPrepare          =  PORT_maxTxDataPrepare,
   maxRxAckPrepare           =  PORT_maxRxAckPrepare,
   maxRxDataPrepare          =  PORT_maxRxDataPrepare,
   maxTxAckPrepare           =  PORT_maxTxAckPrepare,
   // radio speed related
   delayTx                   =  PORT_delayTx,         // between GO signal and SFD
   delayRx                   =  PORT_delayRx,         // between GO signal and start listening
   // radio watchdog
   wdRadioTx                 =   33,                  //  1000us (needs to be >delayTx)
   wdDataDuration            =  164,                  //  5000us (measured 4280us with max payload)
   wdAckDuration             =   98,                  //  3000us (measured 1000us)
};

TsTxOffset

Determined by the pre-agreed upon timeslot template.

Duration between the start of the slot and the SFD leaving the radio when transmitting. Synchronization requires the SFD to be sent exactly at that time (see TschSynchronization), so it is important to make sure this delay is implemented right.

In particular, radio often have a delay between the instant you tell them to send and the time they transmit the SFD. See #delayTx to see how to measure that.

The image below shows TsTxOffset, measured between the beginning of the slot and the time the receiver gets the start of frame event from the radio.

(source file at nine_slots_final.prj)

TsLongGT

Determined by the pre-agreed upon timeslot template.

How early the receiver starts listening for a data packet, see TschSynchronization.

(source file at nine_slots_final.prj)

TsTxAckDelay

Determined by the pre-agreed upon timeslot template.

The duration between the end of the data packet, and the beginning of the ACK packet (its SFD).

(source file at nine_slots_final.prj)

TsShortGT

Determined by the pre-agreed upon timeslot template.

Exactly the same use as #TsLongGT, but when listening for an ACK. Because this duration is measured from the end of the data packet, which just happened, motes are "very" synchronized and so TsShortGT can be shorted than #TsLongGT.

(source file at nine_slots_final.prj)

TsSlotDuration

Determined by the pre-agreed upon timeslot template.

The duration of a slot.

(source file at nine_slots_final.prj)

maxTxDataPrepare

You need to measure this.

This is the maximum time it takes your microcontroller to execute #ti2 and #ta1. You want maxTxDataPrepare to be as close as possible to the measured value to reduce the energy wasted while in the TXDATAREADY state.

(source file at nine_slots_final.prj)

maxRxAckPrepare

You need to measure this.

This is the maximum time it takes your microcontroller to execute #ti6. You want maxRxAckPrepare to be as close as possible to the measured value to reduce the energy wasted while in the RXACKREADY state.

(source file at nine_slots_final.prj)

maxRxDataPrepare

You need to measure this.

This is the maximum time it takes your microcontroller to execute #ri2. You want maxRxDataPrepare to be as close as possible to the measured value to reduce the energy wasted while in the TRXDATAREADY state.

(source file at nine_slots_final.prj)

maxTxAckPrepare

You need to measure this.

This is the maximum time it takes your microcontroller to execute #ri6 and #ra2. You want maxTxAckPrepare to be as close as possible to the measured value to reduce the energy wasted while in the TXACKREADY state.

(source file at nine_slots_final.prj)

delayTx

To give the 'go' signal to transmit, some radios require you to pull a pin high, others to send a command over serial, others to write some bit in a register. In all cases, it will take the radio some time between the moment you call the 'go' function and the moment the SFD is sent over the air. That time should be as deterministic as possible, since the synchronization tightness depends on that.

The best way to determine this value is by measuring. If your radio does not generate an event when it has sent the SFD, you can measure the SFD receive event:

(source file at nine_slots_final.prj)

delayRx

Similar to #delayTx, but in receive mode. It is hard to measure, since most radio don't tell you when they start to really listen. We assume it's "pretty fast" (mostly because the PLL is already running by that time and enabling Rx is just starting up some demodulation logic) that we set that to 0.

wdRadioTx

This duration should be larger than the absolute worst case duration of #delayTx. To be conservative, we set it to 1000us.

wdDataDuration

This should be longer than the duration of the longest packet. We measure the duration of the longest packet (127 byte payload) to be 4.27ms. The value of wdDataDuration simply needs to be longer than that.

(source file at nine_slots_final.prj)

wdAckDuration

Similar to #wdDataDuration, but for the ACK. The ACK is much shorter and we measure the time it takes to transmit it to be 578us. 
The value for wdAckDuration simply needs to be longer than that.

(source file at nine_slots_final.prj)

  • No labels