-
#50 Reply
Posted by
ataradov
on 21 May, 2017 04:49
-
Is there any efficient way to do this?
"Efficient" is a relative term. You need to make sure that your Etherenet_TaskHandler does not take a lot of time to execute. It should not contain any busy-wait loops, or transfers of large volumes of data. Do everything though state machines, doing a little bit of work at a time.
-
-
Hi Alex,
I have One question.
When I test with three boards and parallely capture packet in sniffer, I see Packet transmission from second and third boards before first device get acknowledgement for its transmitted packet. In the receiver side, I don't use any blocking function in appDataInd function.capture packets only in sniffer, no ethernet nothing. Seeing same thing in OQPSK-250kbps also.
Please refer the attached sniffer log so that you have clear view on the problem.
Thanks,
Muthu
-
#52 Reply
Posted by
ataradov
on 01 Jun, 2017 16:23
-
You are sending them just a few ms apart, that's not enough time.
Also, as I mentioned many times, you need to disable routing and ACKs, or allow enough time between the requests to receive the ACK.
This is all valid, if you are still working on time-synchronized network.Otherwise - it is normal, there is no requirement for frames to be received in a any particular order.
-
-
Hi,
Disabling ACK will change unicast mode to Broadcast mode right?
I heard that Broadcast mode is not recommended as it sends packet all the nodes in the network instead one specific node.
Thanks,
Muthu
-
#54 Reply
Posted by
ataradov
on 02 Jun, 2017 05:26
-
Disabling ACK will change unicast mode to Broadcast mode right?
No, disabling ACKs will disable ACKs. Nothing more.
I heard that Broadcast mode is not recommended as it sends packet all the nodes in the network instead one specific node.
But again, in case we are still discussing time-synchronized network, you want to enable link-local communication only, and disable routing, so broadcasts are not a problem anyway.
-
-
Hi,
Can you tell me that how to disable acknowldgement ?
Thanks,
Muthu
-
#56 Reply
Posted by
ataradov
on 02 Jun, 2017 15:42
-
Can you tell me that how to disable acknowldgement ?
Are you for real? Don't include NWK_OPT_ACK_REQUEST option in the request. You also need to disable routing to disable automatic ACK sent for route discovery.
But remember, that this will disable a major way to device to know that it is not getting through. That's why my simple time-synchronized network has nwkSyncAck variable, which includes all ACKs from the previous cycle, which all devices receive at the same time at the begging of the next cycle. You will have to implement similar thing.
-
-
Hi,
I know that not including NWK_OPT_ACK_REQUEST will disable Ack. Doing this change unicast mode to broadcast mode in My side. That's why I asked to know, is there anything other than this to disable ack.
Yes, I am starting to work on time-sync code provided by you. Hopefully, it will solve My problem.
Thanks,
Muthu
-
#58 Reply
Posted by
ataradov
on 02 Jun, 2017 15:54
-
Doing this change unicast mode to broadcast mode in My side.
I seriously doubt it. How do you know it?
-
-
Hi,
Previously, I disabled ack in Peer2Peer project and captured frame in sniffer. That time it was showing that frames are transmitted in broadcast mode.Just now, I checked with ack disabled, it is working for me.And sniffer shows that it is transmitting in unicast mode only. May be I did some mistake earlier in Peer2Peer code.
Thanks,
Muthu
-
-
Hi ataradov,
To work on time Sync code given by you, Can I use register setup given by ASF for AT86RF212B.Because, in the shared code, simulator.h includes register which is not for AT86RF212B.
What I want to do is that take LWMESH stack from ASF and modifiy it as per time sync code that is provided by you. And one more question is , Both Transmitter and Receiver will have same program?
Thanks,
Muthu
-
#61 Reply
Posted by
ataradov
on 07 Jun, 2017 16:44
-
To work on time Sync code given by you, Can I use register setup given by ASF for AT86RF212B.Because, in the shared code, simulator.h includes register which is not for AT86RF212B.
Yes, that's the whole idea - to replace phy.c with code to support the actual PHY you have.
And one more question is , Both Transmitter and Receiver will have same program?
Have you actually read the code? It is like 150 lines long and contains all the answers.
-
-
Hi,
I am having doubt in implementing network timer . shared time-sync code has the following code for timer
static void nwkStartTimer(int interval, void (*callback)(void))
{
nwkTimerCallback = callback;
SYS_TIMER3_COUNTER = 0;
SYS_TIMER3_PERIOD = interval;
SYS_TIMER3_INTFLAG = SYS_TIMER_INTFLAG_COUNT;
SYS_TIMER3_INTENSET = SYS_TIMER_INTFLAG_COUNT;
SYS_CTRL_INTENSET = SOC_IRQ_SYS_TIMER_3;
}
void irq_handler_timer3(void)
{
SYS_TIMER3_PERIOD = 0;
SYS_TIMER3_INTFLAG = SYS_TIMER_INTFLAG_COUNT;
nwkTimerCallback();
}
Can you tell me how to make it in MY side?
Moreover, I read the code, but can you explain the concept so that I make sure myself?
As far as I know, GATEWAY with address 0 sends SYNC command for the specified interval which depends NWK_MAX_SLOTS and NWK_SLOT_TIME. For example, NWK_MAX_SLOTS = 5 and NWK_SLOT_TIME = 10ms, SYNC command will be send for every 60 ms. Router (Or) End device at the other end will send data to GATEWAY upon receiving SYNC command .
Thanks,
Muthu
-
-
Hi,
In the share time-sync code, How irq_handler_trx() get called . I don't see that any function calling irq_handler_trx(). Or It will be used in while(1) main loop.
-
#64 Reply
Posted by
ataradov
on 08 Jun, 2017 16:27
-
Can you tell me how to make it in MY side?
This is just a standard hardware timer. LwMesh uses one of those in halTimer.c.
As far as I know, GATEWAY with address 0 sends SYNC command for the specified interval which depends NWK_MAX_SLOTS and NWK_SLOT_TIME. For example, NWK_MAX_SLOTS = 5 and NWK_SLOT_TIME = 10ms, SYNC command will be send for every 60 ms. Router (Or) End device at the other end will send data to GATEWAY upon receiving SYNC command .
That's correct. So the same code applies to both sides, you just need to assign address 0 to the gateway, and addresses 1-N to the devices.
-
#65 Reply
Posted by
ataradov
on 08 Jun, 2017 16:28
-
In the share time-sync code, How irq_handler_trx() get called . I don't see that any function calling irq_handler_trx(). Or It will be used in while(1) main loop.
That's an interrupt handler, it is called by the MCU when interrupt happens.
Since you are using external radio, in your case this will be external interrupt handler. You will have to setup the pin that is connected to the IRQ pin of the radio accordingly.
-
-
Hi,
Speaking of External interrupt:
Already ADC sample reading working on External interrupt method. Should I set priority in My case if RF module also using external interrupt?
Thanks,
Muthu
-
#67 Reply
Posted by
ataradov
on 09 Jun, 2017 03:52
-
Already ADC sample reading working on External interrupt method. Should I set priority in My case if RF module also using external interrupt?
I don't understand the question. There are no problems using multiple external interrupts, and you don't get control over the priority. Just follow good practices, and keep interrupts short, and you will be fine.
-
-
Hi,
So for timer , I can use LWMESH sys timer right?. I have set two timer one is SYNC and Slot timer. Below is the code for that.
/*- Code----------------------------------*/
#define NWK_SLOT_TIME 10 //10000 //
#define SYNC_INTERVAL ((NWK_MAX_SLOTS + 1) * NWK_SLOT_TIME)
#define SLOT_INTERVAL (SRC_ADDR * NWK_SLOT_TIME )
/*- Sync timer--------------------------- */
Sync_timer.interval=SYNC_INTERVAL;( SYNC_INTERVAL= ((NWK_MAX_SLOTS + 1) * NWK_SLOT_TIME))
Sync_timer.mode=SYS_TIMER_INTERVAL_MODE;
Sync_timer.handler=nwkSyncTimerHandler;
/*- Slot timer----------------------------*/
Slot_timer.interval=SLOT_INTERVAL;
Slot_timer.mode=SYS_TIMER_INTERVAL_MODE;
Slot_timer.handler=nwkSlotTimerHandler;
In the shared code,nwkDataReq() function uses ATOMIC_SECTION_ENTER and ATOMIC_SECTION_LEAVE. Can you tell me what does it mean?.
I think it is ENTER_TRX_CRITICAL_REGION() and LEAVE_TRX_CRITICAL_REGION() respectivley.
//-----------------------------------------------------------------------------
static void nwkDataReq(uint8_t *data, int size)
{
nwkDataBuf = data;
ATOMIC_SECTION_ENTER
nwkDataSize = size;
ATOMIC_SECTION_LEAVE
if (NWK_GATEWAY_ID == nwkDeviceId)
PHY_DataReq(nwkDataBuf, nwkDataSize);
}
Should I use trx_access.h and trx_access.c in lWMESH stack to set up interrupt for RF MODULE. Suggest a solution.
Thanks,
Muthu
-
#69 Reply
Posted by
ataradov
on 09 Jun, 2017 08:27
-
Please use [ code ] tags for formatiing the code.
So for timer , I can use LWMESH sys timer right?
No, you can't. You can look at how that timer is implemented on a low level, pick a different hardware timer, and implement a slotting timer based on that.
In the shared code,nwkDataReq() function uses ATOMIC_SECTION_ENTER and ATOMIC_SECTION_LEAVE. Can you tell me what does it mean?.
They mean exactly what it says in the name. They ensure that code between them executes atomically (win no interruptions).
This is necessary because assignment operation is not guaranteed to be atomic, and if used sends a request just on the edge of the slot, the data size may be corrupted.
Should I use trx_access.h and trx_access.c in lWMESH stack to set up interrupt for RF MODULE. Suggest a solution.
Use whatever you want. You need to read the datasheet, understand how interrupts are configured in the radio, and configure them accordingly.
I'm not going to do your work for you.
-
-
Hi ataradov,
Sorry. This is the first time working on Wireless field. Yes, I am only to do all work. But, I will need some guidance from your side to complete.
Thanks,
Muthu
-
-
Hi ataradov,
When implement hardware timer, I can set Sync timer interval (Or) Slot timer interval to Timer period register?
Because Shared code shows that SYS_TIMER3_PERIOD = interval; in nwkStartTimer(parameters) function.
//function//
static void nwkStartTimer(int interval, void (*callback)(void))
{
nwkTimerCallback = callback;
SYS_TIMER3_COUNTER = 0;
SYS_TIMER3_PERIOD = interval;
SYS_TIMER3_INTFLAG = SYS_TIMER_INTFLAG_COUNT;
SYS_TIMER3_INTENSET = SYS_TIMER_INTFLAG_COUNT;
SYS_CTRL_INTENSET = SOC_IRQ_SYS_TIMER_3;
}
//function//
void irq_handler_timer3(void)
{
//SYS_TIMER3_PERIOD = 0;
//SYS_TIMER3_INTFLAG = SYS_TIMER_INTFLAG_COUNT;
nwkTimerCallback();
}
-
#72 Reply
Posted by
ataradov
on 09 Jun, 2017 21:23
-
Sorry. This is the first time working on Wireless field.
But MCU timers are a very generic topic, they are not specific to wireless.
-
#73 Reply
Posted by
ataradov
on 09 Jun, 2017 21:24
-
When implement hardware timer, I can set Sync timer interval (Or) Slot timer interval to Timer period register?
I don't understand the question. You need to replicate functionality of this function, it accepts time interval, and callback function to call when time interval expires.
-
-
Hi,
Thanks. My question is
Can we directly assign interval (like 60ms) to Timer period register? Or should we set corresponding count value to acheive 60ms inetrrupt.
Shared code shows that inerval assigned to PERIOD register of Timer.
/* CODE-----------------------------------------*/
SYS_TIMER3_COUNTER = 0;
SYS_TIMER3_PERIOD = interval; //60ms
SYS_TIMER3_INTFLAG = SYS_TIMER_INTFLAG_COUNT;
SYS_TIMER3_INTENSET = SYS_TIMER_INTFLAG_COUNT;
SYS_CTRL_INTENSET = SOC_IRQ_SYS_TIMER_3;