Mrf24j40 ACK problem

Discussion on projects that are created by users and posted on mikroElektronika website.
Post Reply
Author
Message
quijano930a
Posts: 2
Joined: 30 Jan 2017 21:22

Mrf24j40 ACK problem

#1 Post by quijano930a » 30 Jan 2017 21:27

HI im working in this module and im based in the code mikro c , so now i have una coordinator and 4 nodes all the nodes are working and receiving correctly without ACK , now i try to implements with 1 coordinator and 1 node ACK , i Follow the datasheet but i think my problem is putting the data in the control frame i try putin mode ack in control frame but it doesnt work here is my tx fifo structure.

Code: Select all

void write_TX_normal_FIFO(void){
   int i = 0;

   data_TX_normal_FIFO[0]  = HEADER_LENGHT;
   data_TX_normal_FIFO[1]  = HEADER_LENGHT + DATA_LENGHT;
   data_TX_normal_FIFO[2]  = 0x41;                        // control frame  << here is where i have to put my code to implements ack right?
   data_TX_normal_FIFO[3]  = 0x88;
   data_TX_normal_FIFO[4]  = SEQ_NUMBER;                  // sequence number
   data_TX_normal_FIFO[5]  = PAN_ID_2[1];                 // destinatoin pan
   data_TX_normal_FIFO[6]  = PAN_ID_2[0];
   data_TX_normal_FIFO[7]  = ADDRESS_short_2[0];          // destination address  
   data_TX_normal_FIFO[8]  = ADDRESS_short_2[1];  
   data_TX_normal_FIFO[9]  = PAN_ID_1[0];                 // source pan
   data_TX_normal_FIFO[10] = PAN_ID_1[1];
   data_TX_normal_FIFO[11] = ADDRESS_short_1[0];          // source address
   data_TX_normal_FIFO[12] = ADDRESS_short_1[1];

   data_TX_normal_FIFO[13] = DATA_TX[0];                  // data
   data_TX_normal_FIFO[14] = DATA_TX[1];
   data_TX_normal_FIFO[15] = DATA_TX[2];

   for(i = 0; i < (HEADER_LENGHT + DATA_LENGHT + 2); i++)
   {
    write_ZIGBEE_long(address_TX_normal_FIFO + i, data_TX_normal_FIFO[i]); // write frame into normal FIFO
   }

   set_ACK();
   set_not_encrypt();
   start_transmit();
   
}

Post Reply

Return to “User Projects”