<< Chapter < Page Chapter >> Page >

The experimental setting goes as follows. You will have two boards, both sampling periodically sampling the channel. When they are not sampling the channel, theCC2500 is switched off and the MSP enters low-power mode. When you press a button on one board, it sends a preamble cut into 50 micro-frames; the receiverhears a micro-frame and keeps listening until it hears the last one.

To this end:

  • Program two board with the code taken from listing below Alternatively, this code is available in the downloadable source code . Open source_code/iar_v4.11/lab_ezwsn.eww with IAR. The project corresponding to this section is called txrx_preamble_msp . ; one will be the transmitter, the other the receiver.
  • Plug in one of the board into the computer and use PuTTY to read from its COMx port; this will be the receiver.
  • press on the transmitter's button, you should read 03 02 01 on your screen.

#include "mrfi.h" #include "radios/family1/mrfi_spi.h"void start_slow_timeout() {TACTL|=TACLR; TACCTL0=CCIE; TACTL=TASSEL_1+MC_1; }void stop_slow_timeout() {TACTL=MC_0; TACCTL0=0; }void start_fast_timeout() {TBCTL|=TBCLR; TBCCTL0=CCIE; TBCTL=TBSSEL_2+MC_1; }void stop_fast_timeout() {TBCTL=MC_0; TBCCTL0=0; }void print_counter(int8_t counter) {char output[] = {" "};output[0] = '0'+((counter/10)%10);output[1] = '0'+ (counter%10);TXString(output, (sizeof output)-1); }int main(void) {BSP_Init(); P1REN |= 0x04;P1IE |= 0x04; MRFI_Init();P3SEL |= 0x30; // P3.4,5 = USCI_A0 TXD/RXD UCA0CTL1 = UCSSEL_2; // SMCLKUCA0BR0 = 0x41; // 9600 from 8Mhz UCA0BR1 = 0x3;UCA0MCTL = UCBRS_2; UCA0CTL1&= ~UCSWRST; // Initialize USCI state machine IE2 |= UCA0RXIE; // Enable USCI_A0 RX interruptBCSCTL3 |= LFXT1S_2; TACTL=MC_0; TACCTL0=0; TACCR0=1060; //slow timeout TBCTL=MC_0; TBCCTL0=0; TBCCR0=31781; //fast timeoutstart_slow_timeout(); __bis_SR_register(GIE+LPM3_bits);} void MRFI_RxCompleteISR(){ mrfiPacket_t packet;stop_fast_timeout(); stop_slow_timeout();MRFI_Receive(&packet); if (packet.frame[9]<4) { print_counter(packet.frame[9]); start_slow_timeout();} else { MRFI_WakeUp();MRFI_RxOn(); }} #pragma vector=PORT1_VECTOR__interrupt void interrupt_button (void) {P1IFG&= ~0x04; uint8_t counter;mrfiPacket_t packet; packet.frame[0]=8+20; MRFI_WakeUp();for (counter=50;counter>=1;counter--) { packet.frame[9]=counter; MRFI_Transmit(&packet, MRFI_TX_TYPE_FORCED); }} #pragma vector=TIMERA0_VECTOR__interrupt void interrupt_slow_timeout (void) {MRFI_WakeUp(); MRFI_RxOn();start_fast_timeout(); __bic_SR_register_on_exit(SCG1+SCG0);} #pragma vector=TIMERB0_VECTOR__interrupt void interrupt_fast_timeout (void) {stop_fast_timeout(); MRFI_Sleep();__bis_SR_register_on_exit(LPM3_bits); }

Some keys for understanding the code:

  • The microcontroller handles two timeouts, one for measuring CI , the other for Dcca . Those timeouts are sourced by two different clocks: a fast and accurate clock for Dcca ; a slower, less accurate but extremely energy-efficient clock for CI . The fast clock is the Digitally Controlled Oscillator ( DCO on Timer A) while the very-low-power, low-frequency oscillator ( VLO on Timer B) is the slow clock. Because CI is triggered by the slow clock, that clock stays on all the time. Only when the slow timeout expires does the microcontroller start the fast clock to clock the fast timeout ( Dcca ); and stops it when that expires. The radio is on only during Dcca .
  • Line 38 initializes the slow timeout on Timer A
  • Line 39 initializes the slow timeout on Timer B
  • Line 42. Because the slow clock runs all the time, the board can only enter LPM3 which leaves the VLO clock running.
  • Line 71. Every time the slow timeout triggers, the CC2500 is switched on in Rx mode (lines 74-75); the fast timeout is started (line 76), and because it is clocked by the DCO, LPM0 mode is entered which leaves the DCO running (line 77).
  • Line 79. When the fast timeout expires, this timeout is stopped (line 82), the CC2500 is put to sleep (line 83) and the LPM3 mode is resumed (line 84).
  • Line 58. When the button is pressed, the board transmits 50 micro-frames, each containing a decrementing counter.

Questions & Answers

Is there any normative that regulates the use of silver nanoparticles?
Damian Reply
what king of growth are you checking .?
Renato
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
Stoney Reply
why we need to study biomolecules, molecular biology in nanotechnology?
Adin Reply
?
Kyle
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
Adin
why?
Adin
what school?
Kyle
biomolecules are e building blocks of every organics and inorganic materials.
Joe
anyone know any internet site where one can find nanotechnology papers?
Damian Reply
research.net
kanaga
sciencedirect big data base
Ernesto
Introduction about quantum dots in nanotechnology
Praveena Reply
what does nano mean?
Anassong Reply
nano basically means 10^(-9). nanometer is a unit to measure length.
Bharti
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
Damian Reply
absolutely yes
Daniel
how to know photocatalytic properties of tio2 nanoparticles...what to do now
Akash Reply
it is a goid question and i want to know the answer as well
Maciej
characteristics of micro business
Abigail
for teaching engĺish at school how nano technology help us
Anassong
Do somebody tell me a best nano engineering book for beginners?
s. Reply
there is no specific books for beginners but there is book called principle of nanotechnology
NANO
what is fullerene does it is used to make bukky balls
Devang Reply
are you nano engineer ?
s.
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
Tarell
what is the actual application of fullerenes nowadays?
Damian
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
Tarell
what is the Synthesis, properties,and applications of carbon nano chemistry
Abhijith Reply
Mostly, they use nano carbon for electronics and for materials to be strengthened.
Virgil
is Bucky paper clear?
CYNTHIA
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
NANO
so some one know about replacing silicon atom with phosphorous in semiconductors device?
s. Reply
Yeah, it is a pain to say the least. You basically have to heat the substarte up to around 1000 degrees celcius then pass phosphene gas over top of it, which is explosive and toxic by the way, under very low pressure.
Harper
Do you know which machine is used to that process?
s.
how to fabricate graphene ink ?
SUYASH Reply
for screen printed electrodes ?
SUYASH
What is lattice structure?
s. Reply
of graphene you mean?
Ebrahim
or in general
Ebrahim
in general
s.
Graphene has a hexagonal structure
tahir
On having this app for quite a bit time, Haven't realised there's a chat room in it.
Cied
what is biological synthesis of nanoparticles
Sanket Reply
how did you get the value of 2000N.What calculations are needed to arrive at it
Smarajit Reply
Privacy Information Security Software Version 1.1a
Good
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get the best Algebra and trigonometry course in your pocket!





Source:  OpenStax, Ezwsn: experimenting with wireless sensor networks using the ez430-rf2500. OpenStax CNX. Apr 26, 2009 Download for free at http://cnx.org/content/col10684/1.10
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Ezwsn: experimenting with wireless sensor networks using the ez430-rf2500' conversation and receive update notifications?

Ask