View previous topic :: View next topic |
Author |
Message |
quijano930a
Joined: 13 Dec 2014 Posts: 5
|
MRF24j40 Control Frame |
Posted: Sat Jan 28, 2017 11:39 am |
|
|
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: 9243 Location: Greensville,Ontario
|
|
Posted: Sat Jan 28, 2017 12:07 pm |
|
|
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
|
|
Posted: Sat Jan 28, 2017 12:11 pm |
|
|
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: 9243 Location: Greensville,Ontario
|
|
Posted: Mon Jan 30, 2017 6:20 am |
|
|
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
|
|
Posted: Mon Jan 30, 2017 12:10 pm |
|
|
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. |
|
|
|