I tried to modify the RSSI register to change the CCA threshold value after
I receive the startDone event from the radio. The way I did it is to copy
the RssiRead interface implementation in the CC2420ControlP.nc file, add
another SpiResource, and only write to the register after I receive the
granted() event from the new SpiResource component. However, this always
ends up in a dead-lock radio state, after which the radio cannot be started
nor stopped. I notice that the lower byte of the RSSI register is read-only.
When writing to the RSSi, I use the CC2420Register interface which writes
two bytes to the RSSI register at a time. Could this be the reason why the
mote end up in a corrupted state?


> Andong,


> Oh, I had a typo when I'm 'copying' my code. Position 2 in my actual code
> is between call CSN.set() and call CSN.clr(). But now a more serious problem
> is that setting the CCA threshold doesn't seem to change the CCA behavior
> much. As I understand, the CCA threshold value is interpreted as a 2's
> complement number with a range from -128 to 127.  However, I've tried -120,
> -32 (default value), 0, and 120, but the CCA result seems all the same. I
> was expecting when the CCA threshold is very low, the mote won't even be
> able to send at all because the channel will always be considered busy. I've
> tried the same set of thresholds under bot CCA mode 1 and 3. What is the
> correct way of changing the CCA threshold?


>

> Hi folks,

- Show quoted text -

> Hi Wenjie,


> CSN is used for selecting the CC2420 chip. CSN should be pulled down

(CSN.clr()) before accessing SPI, and pulled up (CSN.set()) after all of the

operations are done. What should be paid attention to is that RAM access

must be terminated by setting CSn high. The behavior of CSN is well

described in CC2420 Data Sheet.


> Andong Zhan


Best regards,
-- Wenjie Zeng
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to