<< Chapter < Page Chapter >> Page >
Each packet is appended with a 16-bit Cyclic-Redundancy- Check ( CRC ) which is used to detect accidental alterations of data during transmission. CRC is computed over the data portion ofthe frame. Upon receiving a packet, the CC2500 recomputes a CRC over the received data and compares that values with the received CRC. Amismatch indicates a corrupted packet; by default, the CC2500 silently drops such a packet. You will disable CRC and see how often corrupted packets occur.

Running the code

  • Copy code presented 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_crc . .
  • Compile and download the code onto both boards (Ctrl+D) .
  • Connect one board to a computer using the USB programmer, and read its output using PuTTY.
  • Power the other with the battery packet and press the button. You should read 'abcdefghijklmnopqrstu' on PuTTY.
  • Repeat his multiple times by moving away the sending node; you should see some alterations to the output text. If CRC was enabled, these packet would havebeen dropped by the CC2500 and you wouldn't see them on the screen.
  • You may wish to speed things up by changing P1IFG&= ~0x04; to P1IFG |= 0x04; on the sender's side so one press of the button generates an infinite stream of packets. Similarly, youmay wish to reduce its transmission power as explained in 4.3. Continuous Tx/Rx .
#include "radios/family1/mrfi_spi.h" #include "mrfi.h"mrfiPacket_t packetToSend; int main(void){ BSP_Init();P1REN |= 0x04; P1IE |= 0x04;MRFI_Init(); mrfiSpiWriteReg(PATABLE,0xBB);mrfiSpiWriteReg(PKTCTRL0,0x41); P3SEL |= 0x30;UCA0CTL1 = UCSSEL_2; UCA0BR0 = 0x41;UCA0BR1 = 0x3; UCA0MCTL = UCBRS_2;UCA0CTL1&= ~UCSWRST; MRFI_WakeUp();MRFI_RxOn(); __bis_SR_register(GIE+LPM4_bits);} void MRFI_RxCompleteISR(){ uint8_t i;P1OUT ^= 0x02; mrfiPacket_t packet;MRFI_Receive(&packet); char output[]= {" \r\n"}; for (i=9;i<packet.frame[0];i++) {output[i-9]=packet.frame[i]; }TXString(output, (sizeof output)); }#pragma vector=PORT1_VECTOR __interrupt void Port_1 (void){ P1IFG&= ~0x04; char character = 'a';uint8_t index; mrfiPacket_t packet;for (index=9;index<30;index++) { packet.frame[index]=character++; }packet.frame[0]=++index;MRFI_Transmit(&packet, MRFI_TX_TYPE_FORCED); P1OUT ^= 0x01;}

Questions & Answers

what is biology
Hajah Reply
the study of living organisms and their interactions with one another and their environments
AI-Robot
what is biology
Victoria Reply
HOW CAN MAN ORGAN FUNCTION
Alfred Reply
the diagram of the digestive system
Assiatu Reply
allimentary cannel
Ogenrwot
How does twins formed
William Reply
They formed in two ways first when one sperm and one egg are splited by mitosis or two sperm and two eggs join together
Oluwatobi
what is genetics
Josephine Reply
Genetics is the study of heredity
Misack
how does twins formed?
Misack
What is manual
Hassan Reply
discuss biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles
Joseph Reply
what is biology
Yousuf Reply
the study of living organisms and their interactions with one another and their environment.
Wine
discuss the biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles in an essay form
Joseph Reply
what is the blood cells
Shaker Reply
list any five characteristics of the blood cells
Shaker
lack electricity and its more savely than electronic microscope because its naturally by using of light
Abdullahi Reply
advantage of electronic microscope is easily and clearly while disadvantage is dangerous because its electronic. advantage of light microscope is savely and naturally by sun while disadvantage is not easily,means its not sharp and not clear
Abdullahi
cell theory state that every organisms composed of one or more cell,cell is the basic unit of life
Abdullahi
is like gone fail us
DENG
cells is the basic structure and functions of all living things
Ramadan
What is classification
ISCONT Reply
is organisms that are similar into groups called tara
Yamosa
in what situation (s) would be the use of a scanning electron microscope be ideal and why?
Kenna Reply
A scanning electron microscope (SEM) is ideal for situations requiring high-resolution imaging of surfaces. It is commonly used in materials science, biology, and geology to examine the topography and composition of samples at a nanoscale level. SEM is particularly useful for studying fine details,
Hilary
cell is the building block of life.
Condoleezza Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




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