You're absolutely right. I can't find a single instance of
TXPOWER_MAX, or for that matter CC2420_TXPOWER or even TXPOWER,
anywhere in the TOS 1.1.7 code that I have...so it beats me.
I have 1.1.10 on another machine, but I'm too lazy to go look now.
I guess it's lucky that I didn't go to Vegas afterall.
But I did find RADIO_916BAND_CHANNEL_00 in tos/platform/mica2/CC1000Const.h
Sometimes the bull wins.
MS
Andres Aberasturi wrote:
Thank you very much Michael and Lei for answering my question. I
understand much better how it works.
But... I still don't find the definition of TXPOWER_MAX. The problem,
can it be that I am using the version 1.1.7 of TinyOS? (Yes, very
probably) Also, the MakeXbowLocal file that I am using is old (there are
the frequency and power definitions for the mica2!But until now, I have
not found any problem to compile the apps). So I am confused with this!
I mean, I have been always working with micaz and why my application
compilation have not advertised me about using a "wrong" MakeXbowLocal.
Anyway, if I would be using the mica2, where is the definition for
example of RADIO_916BAND_CHANNEL_00 that appears in MakeXbowLocal?
Thank you again for your help,
Andrés
From: Michael Schippling <[EMAIL PROTECTED]>
To: Andres Aberasturi <[EMAIL PROTECTED]>
CC: [email protected]
Subject: Re: [Tinyos-help] set frequency and power for the CC2420 in
Micaz motes
Date: Thu, 08 Jun 2006 13:41:35 -0600
I don't know, is actually my best answer....
but I've never been afraid to make a few guesses anyway...
The defines set in the MakeXbowLocal file are probably used
in a config array someplace. I think that's what mica2 does,
so I'd guess micaz does as well. If you search for those names
in the the code you may find something useful.
In order to be maximally confusing, making default settings
does not use the high-level interfaces. This is to make it
impossible to do what you are trying to do, i.e., understand
how things work.
[just did it to prove my ability to guess impossible things:
in tos/lib/CC2420Radio/
grep CC2420_DEF_CHANNEL *.nc
CC2420ControlM.nc: ((357+5*(CC2420_DEF_CHANNEL-11)) <<
CC2420_FSCTRL_FREQ));
CC2420ControlM.nc: status = status && call
CC2420Control.TunePreset(CC2420_DEF_CHANNEL);
Guess I should head out to Las Vegas while my luck holds...]
What the makefile is doing is setting a bunch of -D defines
for the compiler. If you do a "make micaz" for some demo app,
you should see something like this:
enfield:Robot [6] make micaz
mkdir -p build/micaz
compiling Robot to a micaz binary
ncc -o build/micaz/main.exe -Os -I%T/../contrib/xbow/tos/pla
tform/mica2 -I../../tos/interfaces -I../../tos/system -finli
ne-limit=100000 -Wall -Wshadow -DDEF_TOS_AM_GROUP=125 -Wnesc
-all -target=micaz -fnesc-cfile=build/micaz/app.c -board=mic
asb -DCC1K_DEFAULT_FREQ=RADIO_916BAND_CHANNEL_00 -DRADIO_XMI
T_POWER=0xFF -DCC2420_TXPOWER=TXPOWER_MAX -DCC2420_DEF_CHANN
EL=26 -DIDENT_PROGRAM_NAME="Robot" -DIDENT_PROGRAM_NAME_BYTE
S="82,111,98,111,116,0" -DIDENT_USER_HASH=0xdbcec089L -DIDEN
T_UNIX_TIME=0x44887a32L -I/cygdrive/C/cygwin/opt/tinyos-1.1.
7/tos/lib/CC2420Radio Robot.nc -lm
where, e.g., -DCC2420_TXPOWER=TXPOWER_MAX is passed to the
ncc compiler and does what a header define would do:
#define CC2420_TXPOWER TXPOWER_MAX
and TXPOWER_MAX is probably declared in a CC2420 header someplace.
For the channel it's more straight-forward because the name
"CC2420_DEF_CHANNEL" is set to the value 26, which is part of
the actual data that gets written to a register someplace.
I think that's what you were asking about anyway...
MS
Andres Aberasturi wrote:
Hi Michael,
I have seen that in the module CC2420ControlM, inside the
configuration CC2420RadioC, there is the implementation of the
function SetRFPower, like this:
command result_t CC2420Control.SetRFPower(uint8_t power) {
gCurrentParameters[CP_TXCTRL] = (gCurrentParameters[CP_FSCTRL] &
0xfff0) | (power << CC2420_TXCTRL_PAPWR);
call HPLChipcon.write(CC2420_TXCTRL,gCurrentParameters[CP_TXCTRL]);
return SUCCESS;
}
But I do not find were is it call. I suposed that it would be in the
module CC2420RadioM, but it is not there.
And to finish, two more things. The first one, I do not see were is
defined the variable TXPOWER_MAX. And secondly, when you write in
MakeXbowLocal:
CFLAGS +=-DCC2420_TXPOWER=TXPOWER_MAX
CFLAGS +=-DCC2420_DEF_CHANNEL=26
are you just printing in the console the sentenses
DCC2420_TXPOWER=TXPOWER_MAX and DCC2420_DEF_CHANNEL=26, or you are
really setting the power and the frequency? I want to know where are
DCC2420_TXPOWER and DCC2420_DEF_CHANNEL declarated.
Than you very much in advance,
Andres
>From: Michael Schippling
>To: Andres Aberasturi
>CC: [email protected]
>Subject: Re: [Tinyos-help] set frequency and power for the CC2420
in Micaz motes
>Date: Wed, 07 Jun 2006 17:01:38 -0600
>
>IF you poke down a bit further in MakeXbowLocal you should see
>things like:
>
> CFLAGS +=-DCC2420_TXPOWER=TXPOWER_MAX
> CFLAGS +=-DCC2420_DEF_CHANNEL=26
>
>for the micaz....is that what you are looking for?
>MS
>
>
>
>Andres Aberasturi wrote:
>>Hi all,
>>
>>At this moment I am working with the chipcon CC2420 in the MicaZ
>>motes. I would like to know if I can change the frequency and the
>>power, and how can I do it?
>>
>>I have seen that for the mica2 motes, this is made in the
>>MakeXbowLocal:
>>
>>CFLAGS = -DCC1K_DEFAULT_FREQ=RADIO_916BAND_CHANNEL_00
>>CFLAGS += -DRADIO_XMIT_POWER=0xFF
>>
>>But what happens if I use the MicaZ? Which range of values can I
>>use for micaz?
>>
>>Thanks in advance,
>>
>>Andrés
>>
>>_________________________________________________________________
>>¿Estás pensando en cambiar de coche? Todas los modelos de serie y
>>extras en MSN Motor. http://motor.msn.es/researchcentre/
>>
>>_______________________________________________
>>Tinyos-help mailing list
>>[email protected]
>>https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
------------------------------------------------------------------------
Encuentra una aventura, un romance o al amor de tu vida. Date de alta
gratis. <http://g.msn.com/8HMAESES/2737??PS=47575>
_________________________________________________________________
Grandes éxitos, superhéroes, imitaciones, cine y TV...
http://es.msn.kiwee.com/ Lo mejor para tu móvil.
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help