Showing posts with label CC2420. Show all posts
Showing posts with label CC2420. Show all posts

Monday, March 4, 2013

Enforce software ACK on CC2420 tinyos

cc2420/receive/CC2420ReceiveP.nc:


      /*
       * The destination address check here is not completely optimized. If you
       * are seeing issues with dropped acknowledgements, try removing
       * the address check and decreasing SACK_HEADER_LENGTH to 2.
       * The length byte and the FCF byte are the only two bytes required
       * to know that the packet is valid and requested an ack.  The destination
       * address is useful when we want to sniff packets from other transmitters
       * while acknowledging packets that were destined for our local address.
       */
     //--if(call CC2420Config.isAutoAckEnabled() && !call CC2420Config.isHwAutoAckDefault()) {
      if( !call CC2420Config.isHwAutoAckDefault()) {
      //--if (1) {
        //--if (((( header->fcf >> IEEE154_FCF_ACK_REQ ) & 0x01) == 1)
        if ( 1
            && ((header->dest == call CC2420Config.getShortAddr())
                || (header->dest == AM_BROADCAST_ADDR))
            && ((( header->fcf >> IEEE154_FCF_FRAME_TYPE ) & 7) == IEEE154_TYPE_DATA)) {
          // CSn flippage cuts off our FIFO; SACK and begin reading again







      // We may have received an ack that should be processed by Transmit
      // buf[rxFrameLength] >> 7 checks the CRC
      //--if ( ( buf[ rxFrameLength ] >> 7 ) && rx_buf ) {
      if ( rx_buf ) {



cc2420/transmit/CC2420TransmitP.nc:


      case S_EFD:
        sfdHigh = FALSE;
        call CaptureSFD.captureRisingEdge();
       
        //--if ( (call CC2420PacketBody.getHeader( m_msg ))->fcf & ( 1 << IEEE154_FCF_ACK_REQ ) ) {
        if ( 1 ) {


Wednesday, January 9, 2013

How to clear IEEE154_FCF_ACK_REQ to remove the ACK requirement

../cc2420/csma/CC2420CsmaP.nc :

Change line143:     header->fcf &= ( (1 << IEEE154_FCF_ACK_REQ) |

to     header->fcf &= ( (0 << IEEE154_FCF_ACK_REQ) |

Change line 151:    metadata->ack = FALSE;
to      metadata->ack = TRUE;

Sunday, January 6, 2013

CC2420 Layer Diagram


[plain] view plaincopy
  1. +--------------------------------------------------+  
  2. |               Application Layer                  |  
  3. |                                                  |  
  4. +-----------------------+--------------------------+  
  5.    
  6.  +----------------------+-------------------------+  
  7.  |             Active Message Layer               |  
  8.  +----------------------+-------------------------+  
  9.    
  10.  +----------------------+-------------------------+  
  11.  |              Unique Send Layer                 |  
  12.  +----------------------+-------------------------+  
  13.                     
  14.  +----------------------+-------------------------+  
  15.  |         Optional Packet Link Layer             |  
  16.  +----------------------+-------------------------+  
  17.                           
  18.  +----------------------+-------------------------+  
  19.  |  Optional Low Power Listening Implementations  |  
  20.  +----------------------+-------------------------+  
  21.                           
  22.  +----------------------+-------------------------+  
  23.  |        Unique Receive Filtering Layer          |  
  24.  +----------------------+-------------------------+  
  25.                           
  26.  +----------------------+-------------------------+  
  27.  |      Optional 6LowPAN TinyOS Network Layer     |  
  28.  +----------------------+-------------------------+  
  29.                           
  30.  +----------------------+-------------------------+  
  31.  |     Carrier Sense Multiple Access (CSMA)       |  
  32.  +----------------------+-------------------------+  
  33.                           
  34.                                      
  35. +----------+----------+   +----------+----------+  
  36. |      ReceiveP       |   |      TransmitP      |  
  37. +----------+----------+   +----------+----------+  
  38.                                       
  39.                           
  40. +-----------------------+-------------------------+  
  41. |    SPI bus, GPIO, Interrupts, Timer Capture     |  
  42. +-------------------------------------------------+