[Tinyos-help] Coding for CRC checking (CC2420)
dinesh_eric03 at yahoo.co.in
dinesh_eric03 at yahoo.co.in
Thu Jul 2 15:40:18 PDT 2009
Hi Joe
Code at line 296 of CC2420ReceiveP.nc is checking the value (correctness) of CRC. Also the code at the lines 171-173 of CC2420ActiveMessageP.nc (which I couldn't find on TinyOS 2.0.2 that I am working on) is doing the same thing.
However to disable the CRC, we are not bothered about checking the CRC value, instead we are concerned where the CRC is written to the frame. AUTOCRC or CRC on CC2420 is written at the 5th bit position of MDMCTRL0, one of the registers on CC2420.
This writing process in the code can be found at the 442nd line of CC2420ControlP.nc. So, to disable the AUTOCRC, just comment out the 448th line (
1 << CC2420_MDMCTRL0_AUTOCRC ). As per the datasheet of CC2420, the Hardware ACKs don’t
work on disabling the AUTOCRC which means that you may also comment out the two lines dealing with AUTOACK that are just below the 448th line or you can leave them as they are.
Regards
Dinesh
Date: Thu, 2 Jul 2009 11:29:23 -0700 (PDT)
From: Joe Green <joeg_9 at yahoo.com>
Subject: [Tinyos-help] Coding for CRC checking (CC2420)
To: tinyos-help at millennium.berkeley.edu
Message-ID: <174069.46539.qm at web111201.mail.gq1.yahoo.com>
Content-Type: text/plain; charset="us-ascii"
Hi,
I've read the datasheet for the CC2420 chip and
it appears that on the receiver side there is one bit signifying the CRC pass/fail. I am trying to find where this bit is checked to disable the CRC checking. So far, I found two instances that seem to check the CRC.
In lines 171-173 of CC2420ActiveMessageP.nc, the code is:
if(!(call CC2420PacketBody.getMetadata(msg))->crc) {
return msg;
}
Line 296 of CC2420ReceiveP.nc also seems to check the CRC:
if ( ( buf[ rxFrameLength ] >> 7 ) && rx_buf ) {
Can anyone explain what these two sets of coding do, and let me know if there are any other places the crc bit is checked?
Thanks,
Joe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20090702/a53b7246/attachment-0001.htm
Looking for local information? Find it on Yahoo! Local http://in.local.yahoo.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20090703/d65761b1/attachment.htm
More information about the Tinyos-help
mailing list