[Tinyos-help] Mica2 CC1000ControlM patch - double throughput and
calibrate correctly
David Moss
dmm at rincon.com
Mon May 8 10:49:40 PDT 2006
The CC1000ControlM file is very deceptive about how it obtains its values to
setup the radio.
Yes, the parameters are setup in the CC1000Const.h file, but only the
frequency parameters are pulled from the arrays in that file, which probably
make the rest of it a waste of space in ROM.
Walking through the code, here's what I see:
1. Force the initialization of the CC1000 radio by setting up all the
registers in StdControl.init(), including MAIN, LOCK, MODEMx, FSCTRL, LO,
etc. This is where that MODEM0 register gets initialized, and the
gCurrentParameters array gets filled with these values. The CC1000
registers are loaded by calls to HPLChipcon.write(..).
2. If tuning with preset values, overwrite the entire gCurrentParameters
array in memory with the parameters from the CC1000Const.h file (this is
that for statement you referred to). Do not load these values onto the
CC1000 chip.
3. Tune the CC1000 by writing all the frequency bytes from the
gCurrentParameters array in cc1000SetFreq():
for (i = 1;i < 0x0d;i++) {
call HPLChipcon.write(i,gCurrentParameters[i]);
}
So only 0xD values from gCurrentParameters, the frequency registers, get
loaded into the CC1000 - the other registers that were already initialized
are not reset. So MODEM0 is still whatever was set in the CC1000ControlM
file, not the CC1000Const.h file. At this point, the values actually loaded
into registers on the CC1000 and the gCurrentParameters array differ.
4. Calibrate the CC1000 to tune to these set frequency parameters.
So no, you do not need to edit the CC1000Const.h file's MODEM0 register
because those values will be completely ignored, and forcefully reset to
whatever the CC1000ControlM file says. Editing the CC1000ControlM file will
suffice.
Hope that helps,
-David
-----Original Message-----
From: Rahul Sawant [mailto:sawantrahul at gmail.com]
Sent: Sunday, May 07, 2006 11:33 PM
To: David Moss
Cc: tinyos-help at millennium.berkeley.edu
Subject: Re: [Tinyos-help] Mica2 CC1000ControlM patch - double throughput
and calibrate correctly
Hi David
I need to ask you one more question
as you said below change the line that says (1<<CC1K_XOSC_FREQ)); to
(0<<CC1K_XOSC_FREQ)); in CC1000ControlM.nc
now this line occurs in CC1000ControlM.nc line 367 in StdControl.init() and
is changing the value in gCurrentParameters[0x11] and in the next line
cc1000SetModem(); is called which writes this and other values using
call HPLChipcon.write(CC1K_MODEM0,gCurrentParameters[0x11]);
but again after all this in StdControl.init() there is a call to
call CC1000Control.TuneManual(CC1K_DEF_FREQ); and in this function there is
the following for loop which again changes the values of gCurrentParameters
from CC1K_Params that is defined in CC1000Const.h
for (i=1;i < 31 /*0x14*/;i++) {
gCurrentParameters[i] = PRG_RDB(&CC1K_Params[freq][i]);
}
So my question is should I also make the similar changes as you mentioned
below in CC1000Const.h according to the operating freq and in
CC1000ControlM.nc files.
Thanks in advance
Rahul Sawant
On 5/4/06, David Moss <dmm at rincon.com> wrote:
Hi Rahul,
I assume you did compile the same CC1000ControlM onto your base station
application? And you're only using mica2's (not mica2dots)?
I'll do some testing here and see if I can find any other reason why it
wouldn't work for you. Some of my motes are being flaky regardless of which
CC1000ControlM I use.
If you're not going to be changing frequencies at runtime - which I don't
think anybody is currently doing on the CC1000's because the software breaks
it - then you can simply double your throughput by changing that
MODEM0.XOSC_FREQ to a 0 in your CC1000ConrolM file. That is, change the
line that says (1<<CC1K_XOSC_FREQ)); to (0<<CC1K_XOSC_FREQ));
-David
-----Original Message-----
From: Rahul Sawant [mailto: <mailto:sawantrahul at gmail.com>
sawantrahul at gmail.com]
Sent: Thursday, May 04, 2006 3:51 PM
To: David Moss
Cc: Gregory A. Moore; tinyos-help at millennium.berkeley.edu
Subject: Re: [Tinyos-help] Mica2 CC1000ControlM patch - double throughput
and calibrate correctly
Hi
I read your following mail and downloaded the CC1000ControlM.nc file and
just replaced it for my old file in tos/platform/mica2
but now i am unable to read any packets sent over the radio on the base
station mote. but if i revert to my old CC1000ControlM.nc file i am able to
read the radio packets at the base station.
do i need to make any other changes apart from just replacing the files.
I am using Tinyos 1.1.15.
Thanks in advance
Rahul Sawant
On 5/1/06, David Moss <dmm at rincon.com> wrote:
Hi Greg,
Here's the CC1000ControlM file that performs the correct calibration
procedure, and doubles the throughput for mica2's (this is not compatible
with mica2dot's for some reason, even though they use the same 14.7456 MHz
crystal). MODEM0.XOSC_FREQ needed to be changed from a 1 to a 0 to double
the throughput.
You'll see 76.8 kBaud as opposed to 38.4 kBaud, faster startup, and the
ability to change frequencies in software correctly (although frequency
performance and characteristics will vary from mote to mote).
The CC1000 needs to be calibrated when 1) the radio starts up, or the
frequency changes 2) there are large swings in temperature (think
outdoors!) or 3) there are large swings in supply voltage. A daily
calibration would be great to implement for outdoor applications.
There are 2 frequencies going on inside the CC1000 that need to be
calibrated - Freq. A and B. When the distance between these two frequencies
is greater than around 1 MHz, then separate, single calibrations need to be
performed on each frequency. When the distance between the 2 frequencies is
less than 1 MHz (as it is on our motes) then a dual calibration can be
performed to calibrate both frequencies at once. Originally, the
CC1000ControlM file was created to perform separate, single calibrations,
which takes longer. Also, the local osciallator (LO) was not turned back on
automatically without transmitting after the dual calibration completed,
preventing frequency hopping schemes from working.
The attached updated CC1000ControlM file performs a dual calibration
procedure to do both frequencies at once, and the radio is ready to go on
both Rx and Tx after it gets done calibrating. It should consume a little
less energy when starting up the radio.
-David
.
_______________________________________________
Tinyos-help mailing list
Tinyos-help at Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
<https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20060508/db0a90e5/attachment.htm
More information about the Tinyos-help
mailing list