Well, I've had some success. Basically I've used SplitControl to wire directly 
to CC2420RadioC (whilst keeping all the GenericComm stuff in place to handle 
the messages). Then I use this type of thing:

event result_t Timer.fired() {
 
  SPACER = !SPACER;
 
  if (!RADIO_ON && !SPACER) {
  call Leds.yellowToggle();
  call Leds.redOff();
  call ADC.getData();
  //Sampling
  }
  if (RADIO_ON && SPACER) {
  call Leds.yellowOff();
  call Leds.redOn();
  post dataTask();
  //sending
  }
  call Leds.greenToggle();
 
  return SUCCESS;
  }
 
  event result_t Radio.initDone() {
  return SUCCESS;
  }
 
  event result_t Radio.startDone() {
  RADIO_ON = TRUE;
  return SUCCESS;
  }
 
  event result_t Radio.stopDone() {
  RADIO_ON = FALSE;
  return SUCCESS;
  }

The state SPACER defines the windows in which sampling and radio are allowed. 
This means that the sample rate can be kept constant despite the radio being 
used after every tenth sample. The Radio_On state defines if the radio is on or 
not, and allows sampling when the radio is disabled.

NB. My code is based on the OscilloscopeRF application.

Mike

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Michael
Collett
Sent: 07 February 2007 09:31
To: Ravi Prasad
Cc: TinyOS Help (E-mail)
Subject: RE: [Tinyos-help] Suspending the MicaZ radio (CC2420)



Hi Ravi,

Thanks very much for that. I'll try it now. Looking briefly at the code, I 
think the key may be the use of the interface SplitControl, which I wasn't 
aware of before. I think that should be a better way of handling turning the 
radio on and off.

Once I've played around, I'll post my findings on the board as I've seen quite 
a few others having the same problem.

Mike

-----Original Message-----
From: Ravi Prasad [mailto:[EMAIL PROTECTED]
Sent: 07 February 2007 02:51
To: Michael Collett
Subject: RE: [Tinyos-help] Suspending the MicaZ radio (CC2420)


Hi Mike,

Sorry for responding late.

The approach is what u said, i.e. by calling start and
stop. But as radio implements the splitcontrol
interface one should wait for the event from the radio
for start finished and stop finished.

I have attached the files as a zipper archive with
this email. See the README for further explanation.
Use these in ur application.

I hope this helps.


Regards
ravi


--- Michael Collett <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> It would be great if I could have a look at your
> code. Do you do anything other than call start() and
> stop()? I've read other people on the boards who
> have had problems restarting the MicaZ radio after
> stopping it.
>
> Thanks,
> Mike
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
>
[mailto:[EMAIL PROTECTED]
> Behalf Of Ravi
> Prasad
> Sent: 05 February 2007 05:38
> To: [email protected]
> Subject: Re: [Tinyos-help] Suspending the MicaZ
> radio (CC2420)
>
>
>
> Hi,
>
> I am not aware of the problem of adc data corruption
> on Micaz.
>
> But I have succesfully used manual (means
> application
> layer controlled) radio turn On/Off in my
> applications. My application made radio On for 200ms
> every 10 sec for saving power. (as micaz-CC2420
> didnt
> have low power implementation in 1.1.14. And still I
> think low power micaz-cc2420 is not stabilized in
> tinyos2.0 also)
>
>
> Any way, if your need matches this, I can give you
> the
> code.
>
>
> BTW I used TinyOS1.1.14, which I think is not much
> diferent from 1.1.15 in terms of Radio.
>
>
> Regards
>
>
> --- Philip Levis <[EMAIL PROTECTED]> wrote:
>
> > On Feb 2, 2007, at 8:40 AM, Michael Collett wrote:
> >
> > >
> > > Hi,
> > >
> > > Platform: MicaZ
> > > OS: TinyOS 1.15 (I think, definitely not 2.0)
> > > Application: Adapted from OscilloscopeRF
> > >
> > > I've noticed that during readings of the ADC,
> > radio activity
> > > (reception or transmission) can cause the data
> to
> > change
> > > dramatically (probably due to the drain on the
> > power supply for the
> > > ADC reference voltage). I've tried calling
> > ComControl.stop() and
> > > CommControl.start() either side of taking data,
> > but the radio
> > > doesn't seem to start back up again.
> > >
> > > Is there a way to suspend the radio during a
> > measurement to prevent
> > > the data being affected. I know that I could
> just
> > set a lower
> > > sample rate and then have careful timing to stop
> > them overlapping,
> > > but I would like to find a more rigorous way of
> > solving the problem.
> >
> > Geoffrey Werner-Allen (Harvard) noted this issue
> in
> > his recent paper
> > in OSDI on a Volcano deployment. The paper says
> they
> > fixed the
> > problem, so he might have code for this purpose.
> >
> > Phil
> > _______________________________________________
> > Tinyos-help mailing list
> > [email protected]
> >
>
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> >
>
>
>
>
>
____________________________________________________________________________________
> Sucker-punch spam with award-winning protection.
> Try the free Yahoo! Mail Beta.
>
http://advision.webevents.yahoo.com/mailbeta/features_spam.html
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
>
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
>
-------------------------------------------------------------------
> This e-mail and any attachments may contain
> confidential and/or
> privileged material; it is for the intended
> addressee(s) only.
> If you are not a named addressee, you must not use,
> retain or
> disclose such information.
>
> NPL Management Ltd cannot guarantee that the e-mail
> or any
> attachments are free from viruses.
>
> NPL Management Ltd. Registered in England and Wales.
> No: 2937881
> Registered Office: Serco House, 16 Bartley Wood
> Business Park,
>                    Hook, Hampshire, United Kingdom
> RG27 9UY
>
-------------------------------------------------------------------
>



____________________________________________________________________________________
Yahoo! Music Unlimited
Access over 1 million songs.
http://music.yahoo.com/unlimited

-------------------------------------------------------------------
This e-mail and any attachments may contain confidential and/or
privileged material; it is for the intended addressee(s) only.
If you are not a named addressee, you must not use, retain or
disclose such information.

NPL Management Ltd cannot guarantee that the e-mail or any
attachments are free from viruses.

NPL Management Ltd. Registered in England and Wales. No: 2937881
Registered Office: Serco House, 16 Bartley Wood Business Park,
                   Hook, Hampshire, United Kingdom  RG27 9UY
-------------------------------------------------------------------

_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

-------------------------------------------------------------------
This e-mail and any attachments may contain confidential and/or
privileged material; it is for the intended addressee(s) only.
If you are not a named addressee, you must not use, retain or
disclose such information.

NPL Management Ltd cannot guarantee that the e-mail or any
attachments are free from viruses.

NPL Management Ltd. Registered in England and Wales. No: 2937881
Registered Office: Serco House, 16 Bartley Wood Business Park,
                   Hook, Hampshire, United Kingdom  RG27 9UY
-------------------------------------------------------------------

_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to