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,
>
> I'm trying to change the CCA threshold of the CC2420 on a TelosB mote. The
> way I change it is to write the RSSI.CCA_THR value by inserting the
> following line, as denoted by >>, into the CC2420ControP.nc file:
>
> async event void InterruptCCA.fired() {
> ...
> call IOCFG1.write(0);
> writeId();
> >> call RSSI.write( 0xc0 << CC2420_RSSI_CCA_THR);
> call CSN.set();
> call CSN.clr();
> //position 2
> ...
> }
>
> It seems that the position of the RSSI.write statement is critical.
> Putting
> it earlier or later in the radio start process will corrupt the radio
> startup process (and no startDone event will be generated). I understand
> that RSSI write has to follow IOCFG1.write(0) since setting I0FG1 to 0
> returns CCA pin to its normal state, but why will the radio start fail if
> I
> put it to position 2? Thank you.
>
>
> Best regards,
> -- Wenjie Zeng
>
> 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