Author Topic: LWMESH-OQPSK 1000kbps  (Read 32480 times)

0 Members and 1 Guest are viewing this topic.

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11228
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #125 on: September 23, 2017, 05:15:21 pm »
Well, read the spec, it will answer all your questions.

Only coordinator selects a channel. Other devices scan channels for messages (beacons) from that coordinator.
Alex
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11228
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #126 on: September 24, 2017, 08:02:45 am »
Have you actually tried to search for it? It is the first link when you search for "zigbee specification pdf".

http://www.zigbee.org/wp-content/uploads/2014/11/docs-05-3474-20-0csg-zigbee-specification.pdf
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #127 on: September 25, 2017, 01:52:48 pm »
Hi ataradov,
I read the section 2.5.5.5 which tells the start up procedure for End devices and Co-ordinator. Device with apsDesignatedCoordinator=TRUE act as Coordinator and equal to FALSE act as End devices.Here, Co-ordinator will scan channel and start network with the given PAN ID.And End devices scan channels as per Config_NWK_Scan_Attempts and Config_NWK_Time_btwn_Scans for Beacons from the network which on the same PAN ID.


To do above, I need sample code as a reference. Can you share the sample code if you have ?

Regards,
Muthu



 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11228
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #128 on: September 25, 2017, 04:23:14 pm »
No, this is way too involved for a "sample" code. You are basically inventing a new stack, it is on you to implement it.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #129 on: September 26, 2017, 05:15:57 am »
Hi ataradov,

Ok. Let me write the code and debug.....




Thanks,
Muthu
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #130 on: October 29, 2017, 09:24:38 am »
Hi ataradov,

This is off the topic. I want to do that Bare metal coding(non asf) for ARM-M0+'s  SPI,I2C,and RTC. Where can I learn this and get the sample code?.



Regards,
Muthu
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11228
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #131 on: October 29, 2017, 05:47:47 pm »
There is a lot of sample code on my GitHub. The project that contains the most peripherals is probably this one https://github.com/ataradov/dgw .

This may be of interest as well https://github.com/ataradov/mcu-starter-projects .

In general to support a new peripheral, you read the datasheet and write the code to configure registers as described. You can use ASF code to help some unclear moments. You can either look at the code, or just look at the final register configuration in I/O View in Atmel Studio.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #132 on: November 06, 2017, 09:32:59 am »
Hi ataradov,

Thanks. Started to learn from your github.


Regards,
Muthu
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #133 on: February 21, 2018, 07:15:02 am »
Hi Ataradov,

I need your suggestion on improving range for Our time sync network. Right now, we are able to connect 8 to 10 end nodes to Receiver. Within 70m range, we see less than 1% samples missing for over 1 hour capturing. When we increase the distance about 100m, we see the disconnectivity between Receiver and Endnodes.


So,We are thiniking of implementing Gateway between endnodes and Receiver.

Question:
Right now,at the end of one cycle of 200ms, Receiver receives 8x100 bytes (8 End nodes each have 20ms time slot sending 100 bytes in their time slot). In the case of implementing Gateway, I need to store these 800 bytes in the Gateway and have to send them in the Gateway time slot(for example 9th device at 180ms) to Receiver.
As we know, RF212B has only 128 bytes transmit buffer.But, Gateway requires buffer of minimum 800 bytes...I don't know whether my statement is right or not..
Please suggest..

Regards,
Muthu


 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11228
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #134 on: February 21, 2018, 07:18:06 am »
You are going to store multiple packets, so they have to go to the main memory. Why do you even worry about RF212 packet buffer? You can't receive a second frame until you clear that buffer first anyway.

You really need to figure out how this stuff works, it will be so much easier.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #135 on: February 21, 2018, 02:00:03 pm »
Ok.I got it. Well, the following is Our understanding...Please let us know whether it will work or not..

Note: Sorry Our rate of sending is for every 100ms not 200ms.

Right now, Gateway sends Beacon for every 100ms. I assigned 10ms Time slot for 5 end nodes such as 10ms,20ms,30ms,40ms and 50ms.If all the 5 end nodes have Payload of 80 bytes to transmit, Gateway will have 400 bytes after 5th end nodes completed its transmission.There are 50ms more time(which is not allotted for any End nodes).So,if I am right, I have to make use of these 50ms time to transmit 400 bytes to Receiver.



Regards,
Muthu


 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11228
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #136 on: February 21, 2018, 05:22:42 pm »
If you only have one range extender, then yes, it must be able to send its data in that time slot. If you have more than one range extender, then you need to allocate time slots for them as well. That's exactly the reason why nobody uses this approach for mesh networks.

You will also have more problems with interference. If your remote devices can transmit at the same time as close devices they will interfere. Even if remote devices don't have enough power to be received with 1% failure rate, they still transmit a signal powerful enough to interfere.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #137 on: February 22, 2018, 10:44:31 am »
Ok.I thought of putting only one Extender and I don't want to go with Multiple extender since there will be a chance interference as you said.I start to write code...
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #138 on: February 23, 2018, 04:27:12 am »
Hi Ataradov,

Actually our Extender board have two RF212B module in which one for talking to End nodes and other for talking to Receiver.Connecting minimum 9 End nodes is our requirement.So, out of 100ms, 90 ms goes to 9 End nodes transmission.For Extender to Receiver transmission, we want to use other module in the extender board at different channel. Hence, we don't have to do time slot transmission for Extender to Receiver transmission and also inetrference could be avoided as both operates at different channel.

Is there any problem with this approach?..Please let us know

Regards,
Muthu
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11228
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #139 on: February 23, 2018, 04:41:49 am »
So receiver never connects to end nodes directly, only to the extender? This will work fine.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #140 on: February 23, 2018, 04:43:35 am »
Yes...Thank you very much
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #141 on: March 19, 2018, 12:10:07 pm »
Hi Alex,
I have noticed the following code worked good when optimization level set to None(-O0) but not with Optimize(-O1).

Code: [Select]
typedef enum
{
APP_STATE_SEND_TRUE,
APP_STATE_SEND_FALSE,
}AppState_t;

static AppState_t appState = APP_STATE_SEND_TRUE;

//-----------------------------------------------------------------------------
void Gw_NWK_DataConf(bool status)
{
appState = APP_STATE_SEND_TRUE;
(void)status;
}
//-----------------------------------------------------------------------------
int main(void)
{
  /*driver code is here */
        while (1)
{
if (APP_STATE_SEND_TRUE == appState)
{

appSendData();
appState = APP_STATE_SEND_FALSE;

}
else
{
/* do nothing */
}
         }
}[code]

Can you tell me why it is happening....

Regards,
Muthu
« Last Edit: March 19, 2018, 12:11:43 pm by muthukural001 »
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11228
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #142 on: March 19, 2018, 03:35:33 pm »
I have no idea. See what ends up in a disassembly, and what parts get removed.

This specific fragment looks OK, but on its own, it is obviously not functional with any level of optimization.
« Last Edit: March 19, 2018, 03:37:54 pm by ataradov »
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #143 on: March 20, 2018, 05:49:37 am »
Hi Alex,

The following code is working fine for any optimization. The code is using volatile flag which is used to send data over RF module instead of enum based state machine.

Code: [Select]
static volatile bool Gateway_send=true;

//-----------------------------------------------------------------------------
void Gw_NWK_DataConf(bool status)
{
 Gateway_send=true;
 (void)status;
}
//-----------------------------------------------------------------------------
int main(void)
{
  /*driver code is here */
        while (1)
 {
  if (Gateway_send)
{
if (READ_PACKETLENGTH <= n_used())
{
Gateway_send=false;
fifo_read(Gw_appData.Gw_data,READ_PACKETLENGTH);
Gw_appSendData();
}
}
         }
}

As we know, volatile tells the compiler do not optimize the variable. So, it always being read from RAM rather than actual memory if it is not volatile.

But, in your time sync in the GitHub, you shared phyState between two threads (timer isr and RF212B isr).It is working fine for any optimization. Can you explain?

Regards,
Muthu
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11228
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #144 on: March 20, 2018, 05:56:39 am »
But, in your time sync in the GitHub, you shared phyState between two threads (timer isr and RF212B isr).It is working fine for any optimization. Can you explain?
Compilers are not that smart. They realistically can only optimize out variables used in a very few places (probably one main loop and an interrupt handler). State is changed all over the place, so each individual function can not assume that the value is preserved between the calls.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #145 on: March 20, 2018, 06:15:49 am »
Hi Alex,

Thanks. For curiosity to know, can we avoid volatile flag in such cases. To understand GCC compiler behavior for cases like this, can you show me any materials.




Regards,
Muthu
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11228
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #146 on: March 20, 2018, 06:24:07 am »
To understand GCC compiler behavior for cases like this, can you show me any materials.
It is not GCC specific. I'm not sure if there are any documents that specifically cover this.

It is just common sense. Compilers can realistically only optimize things like this:
Code: [Select]
int var = 1; // Also changed in the ISR

while (var)
{
  // do things that are not changing var
}
This whole code will just be optimized to while (1) {}.

But if code inside the loop is sufficiently complex and changes var, then compiler can't assume that var is not going to change to 0 as the result to the loop body, so it can't optimize it.

And in case of my example, the variable is modified in multiple functions called from may other places (and from other files, which compiler can't see at the time of building that file). So there is no chance of it being optimized.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #147 on: March 23, 2018, 11:47:37 am »
Hi Alex,

Our system has two external interrupts, AT86RF212B external interrupt and AD7124-ADC interrupt, and One Timer interrupt.

Questions:
Q1: Is all these interrupts having same priority by default ?.If so, MCU execute other interrupt ISR after finishing current ISR execution. If the interrupts having different priority, higher priority interrupt can interrupt lower priority interrupt's ISR which is called as Nested interrupt. I don't think that the nested interrupt is needed for our design.

Q2: The global interrupt will be disabled Once execution goes to ISR if all the interrupts have same priority ?.

Q3: For Nested interrupt, global interrupt will be kept enabled when execution in the lower priority ISR ?.

Our system is working fine.Curiosity for knowing, I have asked above questions.




Regards,
Muthu
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11228
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #148 on: March 23, 2018, 04:22:27 pm »
Q1: Is all these interrupts having same priority by default ?.If so, MCU execute other interrupt ISR after finishing current ISR execution. If the interrupts having different priority, higher priority interrupt can interrupt lower priority interrupt's ISR which is called as Nested interrupt. I don't think that the nested interrupt is needed for our design.
All interrupts have the same priority by default.

Q2: The global interrupt will be disabled Once execution goes to ISR if all the interrupts have same priority ?.
There is not really a global interrupt disable. You can only boost the priority of the current code to maximum, which effectively blocks all interrupts.

But interrupt handlers are always called according to their priority. Interrupts with priority higher than the current code will interrupt the code. If all interrupts have equal priority, then only one can be executed at a time.

Q3: For Nested interrupt, global interrupt will be kept enabled when execution in the lower priority ISR ?.
Again, no such thing as global interrupts enable.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #149 on: April 28, 2018, 10:31:57 am »
Hi Alex,

For Our second version of the Project, We are planning to use AT86RF215 as it has 2K TX and RX FIFO and high output power compared to RF212B.The more TX and RX FIFO will really help us in increasing the end nodes. In the Atmel studio ASF, I looked at RF215 chat example, there is  a mesh in understanding PHY driver. And also let me know about moving to AT86RF215 is good ?



Thanks,
Muthu
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf