CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

MRF24j40 Control Frame

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
quijano930a



Joined: 13 Dec 2014
Posts: 5

View user's profile Send private message

MRF24j40 Control Frame
PostPosted: Sat Jan 28, 2017 11:39 am     Reply with quote

hi I'm using this module, and I'm trying to understand how i can implement the control frame. Now i have working a p2p and its working okay, but i don't know what are the parameters in the control frame. I have this structure in the write_tx_fifo, and if i try to implement ACK, the datasheet tells me to put the bit 5 as '1' to implement ack in the control frame.
So i have this code from Mikro c and i understand all parameter, less control frame. Here is the code.
Code:
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]  = 0x01;                        // control frame
   data_TX_normal_FIFO[3]  = 0x88;
   data_TX_normal_FIFO[4]  = SEQ_NUMBER;                  // sequence number
   data_TX_normal_FIFO[5]  = PAN_ID_2[1];                 // destination 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();
   
}


I don't understand why control frame is set by these 2 parameters:
Code:

data_TX_normal_FIFO[2]  = 0x01;                        // control frame  data_TX_normal_FIFO[3]  = 0x88;
temtronic



Joined: 01 Jul 2010
Posts: 9231
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Jan 28, 2017 12:07 pm     Reply with quote

If I hadn't seen this...
write_ZIGBEE_long
... I would not have known you were using Zigbee !

It's kinda CRITCAL to give as much information as possible when posting questions.

I suggest getting a GOOD manual on Zigbee, it's structure and commands. I have one buried 'somewhere' on another PC as I gave up on Zigbee duo to it's range limitation and huge overhead for sending data.
Zigbee like 99% of all communications(wireless or hard wired) is full of 'bloatware' not needed for 99% of the applications.

Jay
quijano930a



Joined: 13 Dec 2014
Posts: 5

View user's profile Send private message

PostPosted: Sat Jan 28, 2017 12:11 pm     Reply with quote

I suppose if i put mrf24j40 the user will know where is my problem ::: but if he doesn't use the module he doesn't understand the question.
temtronic



Joined: 01 Jul 2010
Posts: 9231
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Jan 30, 2017 6:20 am     Reply with quote

Please post where in the datasheet you read to put a 1 in bit 5 as there are a LOT of registers and modes this device has.
quijano930a



Joined: 13 Dec 2014
Posts: 5

View user's profile Send private message

PostPosted: Mon Jan 30, 2017 12:10 pm     Reply with quote

hi


The MRF24J40 features hardware automatic Acknowledgment. It will automatically Acknowledge a frame if the received frame has the Acknowledgment request subfield in the frame control field set to ‘1’. This will maintain the RX-TX timing requirements of the IEEE 802.15.4 Specification.
Automatic Acknowledgment is enabled by clearing the NOACKRSP (RXMCR 0x00<5>) bit = 0. To disable automatic Acknowledgment, set the NOACKRSP (RXMCR 0x00<5>) bit = 1.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group