Dear all, I investigated the issue a little bit more, especially the cause for the behaviour described in my previous email.
According to the data sheet, when the receiver in the CC2420 chip is started (SRXON command) the RSSI measurement and associated with it the CCA assessment becomes valid only after 8 symbols - which is 128 us on MicaZ. I confirmed this by measurements on real hardware. When you use Low Power Listening (LPL) a receiver turns on CC2420 receive mode and enters a for loop in PowerCycleP.nc / task getCca to check if there is a transmission or not. On my test program using TinyOS 2.1.1, nescc 1.3.1, avr-gcc 4.1.2 it takes 85 us on MicaZ from sending the SRXON command to the beginning of this for loop. Thus, during the first iterations of the for loop the CCA pin is checked although its value is not valid yet! In fact, 4 iterations of the loop take 32 us (remember: 85 us + 32 us = 117 us < 128 us) and in all 4 iterations EnergyIndicator.isReceiving() is true. Therefore, the loop is exited and the radio stays on although there might be no transmission. So, in a future release of TinyOS the number of minimum detections (MIN_SAMPLES_BEFORE_DETECT) should be increased or - even better - the status byte of the CC2420 should be checked first before using the CCA pin. Moreover, the MAX_LPL_CCA_CHECKS should take into account if ACKs are enabled. I also guess that this value depends on the platform since one iteration may take a different time period on a different platform. Best, Daniel -- Daniel Minder University of Duisburg-Essen, Networked Embedded Systems Bismarckstr. 90, 47057 Duisburg, Germany Skype: d.minder _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
