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

0 Members and 1 Guest are viewing this topic.

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
LWMESH-OQPSK 1000kbps
« on: March 26, 2017, 08:01:17 am »
Hello,

We are using at86rf212b with LWmesh stack and configured to QOPSK1000 . we have connected 3 nodes to a receiver each node with data rate of 80byts per packaet (at 200 ms interval). we are facing data loss of more than 10% ( i.e. 6 packet missing per minit) the range is also low (all boards are placed on the same table)

Please suggest if some one has some experience with this...

Thanks,

Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #1 on: March 26, 2017, 08:19:04 am »
What is your hardware?

Also, 6 packets mer minute at 200 ms sending interval is not 10%, it is 2%. And depending on how exactly this data is sent, it may not be  that bad of a result.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #2 on: March 27, 2017, 07:05:07 am »
Hi Alex,
Sorry, we wrote it wrongly. 2% loss is for One transmitter to One Receiver network. When we connect 3 boards (transmitter), we see 10% loss. Coming to Operation, We read ADC-AD7124 in Interrupt method read. It means that ADC interrupt MCU to read sample from its data registers once ADC conversion completed. We set Our ADC to 70 Samples per second data rate. So, it will interrupt MCU every 14.28ms(1/70=14.28ms).If so, at the end of 200ms, we will get 14 samples.We will send these 14 samples over LWMESH. Each sample constitute of 5 bytes. One packet has 80 bytes. Out of 80 bytes, 70 bytes are 14 samples and 10 bytes for packet identification. For every seconds, we send 5 packets over LWMESH. When we test one transmitter to One receiver setup, we see 4 packets per second instead 5 packet per second approximately every 13 S duration. I tested above without ADC by sending 80 bytes for every 200ms from one SAM L21 development board (Transmitter) to other SAM L21 development board (Receiver) to ensure this problem not with ADC.  Testing with and without ADC for this 4 packets per second do not give any difference in result. In the attached excel log, you can see that 10s(5 packets per second) and 8s (4 packets per second) in the last column for every 13 Second. Also attached sniffer log, for 1 to 1 development board test case.

Thanks,
Muthu
« Last Edit: March 27, 2017, 07:25:41 am by muthukural001 »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #3 on: March 27, 2017, 07:07:32 am »
What any of this has to do with communication problems?

I'll ask again, what hardware do you use? Have you tried to simply send data, without involving other peripherals?

So do you actually loose frames of you just counting how many frames you receive in a second?
« Last Edit: March 27, 2017, 07:09:30 am by ataradov »
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #4 on: March 27, 2017, 07:28:10 am »
Hi Alex,
We are using AT86RF212B Sub-Ghz module to send packets, SAML21J18B MCU and AD7124-ADC. Yes,we determine it by counting per second.For a minute, we can receive 5 packets per second for 54-56 seconds but we see 4 packets per second case in the remaining 4 -6 seconds. This results in 4-6 packets loss per minute.


Note: Tested at OQPSK-1000kbps.

Thanks,
Muthu
« Last Edit: March 27, 2017, 07:57:05 am by muthukural001 »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #5 on: March 27, 2017, 07:32:09 am »
We are using AT86RF212B Sub-Ghz module to send packets, SAML21J18B MCU and AD7124-ADC.
What module? What is your antenna design? And what ADC has to do with network problems?

Is your claim of packet loss based on the actual measured packet loss, or only on calculating the expected number of packets? Can you just put a counter inside the frame and see if you are missing any frames that are actually sent?

You need to start giving relevant information. I'm not going to pull it from you.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #6 on: March 31, 2017, 06:19:22 am »
Hi Alex,
Thanks. Counter method which you said really helps me. Previously, due to some logic missing, I was getting that problem. In the Counter method test, I captured packets for 7 minutes.For this 7 minutes, I am not seeing any gap in the incremented value  in the captured packets and received 5 packets for every seconds as I expected. I tested above with 1 transmitter to receiver. But, When I connect one more transmitter to receiver,  I see gap between the incremented values in transmitter 1 packets and transmitter 2 packets due to packet loss.
In our application, we need to connect 5 Transmitters to receiver. Each transmitter will transmit packet/200ms(5 packets/second) Please suggest a solution to achieve this.

We have used ATZB-212B-XPRO module and off-the-shelf antenna which part number is 66089-0906 (915MHz Whip, Straight RF Antenna 3dBi Connector, U.FL Connector Mount ).


Thanks,
Muthu

 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #7 on: March 31, 2017, 06:22:52 am »
But, When I connect one more transmitter to receiver,  I see gap between the incremented values in transmitter 1 packets and transmitter 2 packets due to packet loss.
It is not necessarily packet loss. What does the status code say in the confirmation callback on the transmitters. It will probably be channel access failure.

How exactly did you set OQPSK-1000 mode?
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #8 on: March 31, 2017, 07:50:45 am »
Hi alex,
Below is the OQPSK setting of My project.

OQPSK Setting:
config.h:
#ifdef PHY_AT86RF212B
  #define APP_CHANNEL             0x03
  #define APP_BAND                0x00
  #define APP_MODULATION          0x2E  ---->OQPSK-SIN-1000-SCR-ON
#else


Setting following in PHY_Init() and phySetChannel() respectively:

                                     phyWriteRegister(RF_CTRL_0_REG, reg | 0X02); /* GC_TX_OFFS =2 for OQPSK */

                                      /*short acknoweldgement setting */
                                   reg = phyReadRegister(XAH_CTRL_1_REG) & ~0x04;
                                   phyWriteRegister(XAH_CTRL_1_REG, reg | 0x04);



Coming to status code, I have read that appDataConf callback function gives status of the last packet transmitted. Can you tell me a proper way to check status code of multiple boards when I use more than one board?

Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #9 on: March 31, 2017, 04:32:02 pm »
Your settings seem to be fine. I would try to to do the same test with no modifications at all, just to get baseline. I personally have no experience with proprietary high-speed modes.

And also reduce the power. It is possible that you are saturating the radio, and unless you have a signal analyzer, you will never know.

WSNDemo checks the status, check that as an example. You can get the status in req->status.

You don't really need to look at it on multiple nodes at the same time. Just pick one and observe how its status behave while others are running on their own.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #10 on: April 02, 2017, 09:50:52 am »
Hi Alex,
Thanks. I will check status code as you said.And we have been working on this project for 6 moths. Project is 10 transmitters transmit 80 bytes of temperature value for every 200ms to Receiver.  It is not working for even Two transmitters. How should we approach further to achieve Our application?. Please suggest a solution.



Thanks,
Muthu 
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #11 on: April 02, 2017, 05:05:04 pm »
Project is 10 transmitters transmit 80 bytes of temperature value for every 200ms to Receiver.
So that's 50 full length frames in a second from a few devices. Just for reference, in 2.4 GHz range and at a standard 250 kbps data rate, a single device can realistically send to another device ~100 frames per second. This is the limit of the channel.

I don't have a whole lot of experience with non-n standard modes, so I don't know where the limit is there.

It is not working for even Two transmitters.
This is a bit strange.

How should we approach further to achieve Our application?
First of all get those status codes. You really need to be able to get information like this right away, if you want to debug this in a reasonable amount of time.

Then, start with standard data rate modes, since they do less processing magic. And try to reduce TX power.

Eventually, you may have to arrive at some time-synchronization scheme, so devices only send in their assigned time slots. You are running very close to the realistic channel limit.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #12 on: April 03, 2017, 02:41:12 pm »
Hi Alex,
Thanks. We have captured status code of one Transmitter while Two transmitters were transmitting to Receiver. In the captured Status code log,I see most of times SUCCESS(0) status and some time NWK_PHY_NO_ACK_STATUS(6). Attached code which I used to get status code and status log which contains two status that are 0 for SUCCESS and 6 for NWK_PHY_NO_ACK_STATUS. I used dev board which has serial port  as One transmitter and Our custom board which don't have serial port for other transmitter. We have used Serial port to get status code of Dev board transmitter.As our custom board don't have serial port, we are not able to do status code checking on the second board. 



Thanks,
Muthu


« Last Edit: April 03, 2017, 02:56:25 pm by muthukural001 »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #13 on: April 03, 2017, 05:03:06 pm »
NWK_PHY_NO_ACK_STATUS(6).
So the frame is sent, but never acknowledged. This may be an indication of the problems on the receiving end. What kind of processing you do to the data there? Can you show your appDataInd() function, of whatever your indication callback is called?

As our custom board don't have serial port, we are not able to do status code checking on the second board. 
It is always advisable to have a debug port, even if just on test points, just for cases like this.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #14 on: April 04, 2017, 11:01:16 am »
Hi Alex,
Below is the appDataInd callback function code,

static bool appDataInd(NWK_DataInd_t *ind)
{
   for (uint8_t i = 0; i < ind->size; i++)
   {
      ethernet=ind->data;
   }
   tcp_write(gs_pcb,ethernet,MAXLENGTH,TCP_WRITE_FLAG_COPY); //---->tcp_write & tcp_output to send RF module data over Ethernet
   tcp_output(gs_pcb);
   LED_Toggle(LED0);
   return true;
}
 Here, I am using TCP function to send received data from RF module(LWMESH) through Ethernet cable.

Thanks.We are trying to add debug(serial) port in our custom board.

Thanks,
Muthu

 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #15 on: April 04, 2017, 04:42:00 pm »
   tcp_write(gs_pcb,ethernet,MAXLENGTH,TCP_WRITE_FLAG_COPY); //---->tcp_write & tcp_output to send RF module data over Ethernet
   tcp_output(gs_pcb);

This is probably the source of your problems. How long do tcp_write() and tcp_output() take? If they take more than 5-10 ms, then you will have dropped frames.

When appDataInd() is blocked, only one other frame can be buffered in the radio for further processing, the rest of them will be rejected.

At this data rate, you need to accumulate data from many devices and send it in one chunk. And this sending must be fast, or it must be split into smaller section using state machines.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #16 on: April 05, 2017, 05:01:30 am »
Hi Alex,
Thanks. I think that the best way to judge that use sniffer instead Ethernet for monitoring packets. Ok, in the Receiver side, I will disable Ethernet function. But, I see difficulty in counting packets in Wireshark log when I capture from two boards. Is there anyway to extract the useful data(80 bytes) from Wireshark log and export it to excel?. So that I can see whether there is any packet loss or not over long period.



Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #17 on: April 05, 2017, 05:12:58 am »
Thanks. I think that the best way to judge that use sniffer instead Ethernet for monitoring packets. Ok, in the Receiver side, I will disable Ethernet function. But, I see difficulty in counting packets in Wireshark log when I capture from two boards. Is there anyway to extract the useful data(80 bytes) from Wireshark log and export it to excel?. So that I can see whether there is any packet loss or not over long period.

That's why you need debug UART :)

Wireshark can probably export into some text-based file format. It is not necessarily going to be only your data, but a simple Python script will do the rest.

Or you can just scroll through the log. You will see frames that got PHY_NO_ACK status by a very characteristic 4 retries in a row without Ack frames in between them. If you see that - this frame is lost. And that's also a thing to keep in mind when doing analysis on the logs -  the frame is sent, and sniffer has received it, but intended recipient did not. So you need to be smart about your parsing, not just look at counters.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #18 on: April 12, 2017, 04:49:15 am »
Hi Alex,
In the Receiver side, I tested with Serial communication instead Ethernet communication for sending the received Packets from Receiver board to PC. I set baud rate  to 115200. With this baud rate, 80 byte transmission takes 6.9ms only. However, Still I see Packet loss that is same Ethernet communication when I connect two transmitter boards to Receiver. In the attached serial port excel log, in the packets per sec for two boards column, you can see 2,3,4,5,6,7,8,9 and 10 packets per second . What we have expected was 10 packets per seconds.


Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #19 on: April 12, 2017, 05:05:06 am »
Don't send 80 bytes. Don't send anything at all during the test. 7 ms is still a relatively long time. Why do you need to send 80 bytes anyway?

Just count the frames, and print the counters every second. Restart the counting timer only after printout is completed.

I would try to start with one of the standard modes as well. OQPSK-250 should be fine.

Also, you really should not expect 100% delivery all the time. There will be loses.

In this case, it look like two transmitters are just fighting for the receiver. You need to look at the sniffer log. You need to look at everything at the same time, you can't just look at the transmitters side, a week later look at the receiver side, and a week later look at some logs. You need to correlate that loss on the application level to what's going on on the air at the same time.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #20 on: April 13, 2017, 04:14:26 am »
Hi Alex,
In the actual application, I need to send 80 bytes (1 packet) for every 200ms from transmitter. So, I have implemented 80 bytes transmission.
Last 10 bytes of these 80 bytes include frame counter. Here, I am testing without changing structure .


Q1: Do you want me to send less than 80 bytes for every transmission?


Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #21 on: April 13, 2017, 04:18:29 am »
In the actual application, I need to send 80 bytes (1 packet) for every 200ms from transmitter. So, I have implemented 80 bytes transmission.
But it does not have to be blocking. Your application is critical to timing, so you will have to use interrupts and buffering. Or you will have to implement some sort of time synchronization between the senders, so they don't try to send close to each other.

Q1: Do you want me to send less than 80 bytes for every transmission?
At this point you need to evaluate your radio performance, so you don't need to sens anything at all. Just count and exit from the indication function as fast as possible. And then once a second (or even less often) print that counter, and then reset the timer.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #22 on: April 13, 2017, 04:28:02 am »
Hi Alex,
If I am right, you are talking about Receiver. Instead sending received packets over either ethernet or serial port, you want me to put frame counter in appDataInd function of the Receiver  and reset that counter after 1 second.



Thanks,
Muthu



 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #23 on: April 13, 2017, 04:35:11 am »
If I am right, you are talking about Receiver. Instead sending received packets over either ethernet or serial port, you want me to put frame counter in appDataInd function of the Receiver  and reset that counter after 1 second.
Exactly. It would be helpful to do similar procedure on the senders as well, and see how many frames they send successfully.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #24 on: April 20, 2017, 04:31:54 am »
Hi Alex,
Sorry.As I was traveling last week, I couldn't reply in time.Due to timers that I used in transmitter for sending packets for every 200 ms and in receiver for frame counting for 1s is not synchronized, I am not able to count frame in Receiver side Precisely. Actual packets should I receive for 1 second is 5 packets. But I am receiving most of the times 5 packets and some times 4 packets.
[/quote] But it does not have to be blocking. Your application is critical to timing, so you will have to use interrupts and buffering. Or you will have to implement some sort of time synchronization between the senders, so they don't try to send close to each other.

 I didn't work with any time synchronization. Can you tell me that how to implement time synchronization between senders?

Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #25 on: April 20, 2017, 04:39:32 am »
I didn't work with any time synchronization. Can you tell me that how to implement time synchronization between senders?
It is sort of advanced topic. There is no way for me to describe that in details. In general, you need to have gateway assign a time slot to each node. Then gateway will send broadcast synchronization frame periodically. In many cases (Wi-Fi, Bluetooth, and even IEEE 802.15.4) they are called "beacons". After node receives this frame, it should start a more or less precise timer. 10 ms application timers will not work, you will need to use a hardware Timer/Counter for that. After interval is expired, device is free to send its data.

This way you get no collisions, since each device knows exactly when it can send data and the air will be free.

This is not an easy task, and the description above is very general. And obviously, be prepared to do a lot of debugging.

Otherwise you will have to either lower your sending rate, or just deal with collisions.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #26 on: April 26, 2017, 12:18:14 pm »
Hi Alex,
Will WSN demo project from ATMEL help for My application?

I just want to try it before going to time slot based transmission.


Please suggest a solution
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #27 on: April 26, 2017, 03:30:07 pm »
Will WSN demo project from ATMEL help for My application?
Help in what sense? Sending a lot of data at a very fast rate? Then no, it won't. WSNDemo uses the same stack, and it generally expects devices to be spread in time.

To do what you want to do, you need to basically implement completely different stack, specifically optimized for streaming continuous data.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #28 on: April 28, 2017, 12:31:43 pm »
Hi Alex,

'' it generally expects devices to be spread in time.

So, here(WSN project), each transmitter exactly knows when it can transmit ?

WSN project itself has time slot based transmission and time sync ?

Please refer the attached time slot image which I want to do.

Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #29 on: April 28, 2017, 03:40:15 pm »
So, here(WSN project), each transmitter exactly knows when it can transmit ?
WSN project itself has time slot based transmission and time sync ?
If you are asking about WSNDemo application, then no, it does not implement any of this. It is a feature that will require modifications to the stack itself, not just the application.

The general idea is correct, but you will also have to implement periodic synchronization between the devices, because their time keeping will drift over time.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #30 on: April 29, 2017, 05:40:22 am »
Hi Alex,
Thanks. Periodic Time sync between devices all are quietly new to me. Can I get ready made code from anywhere? and    Do u have any idea about implementing Periodic sync between the devices ?









 
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #31 on: April 29, 2017, 05:43:28 am »
Can I get ready made code from anywhere?
I don't think so, it is pretty specific to your application.

Do u have any idea about implementing Periodic sync between the devices ?
I described it earlier in this thread. You may want to read some general information on Wi-Fi or Bluetooth. Both protocols use periodic beacons fro synchronization.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #32 on: April 30, 2017, 08:01:07 am »
Hi Alex,
In the field, Our application may run continuously for 5 hours to send engine temperature. In between , using periodic sync will affect our application by increasing response time at Receiver. Response time means that Changes of temperature value at transmitter nodes takes how long to reflect at GUI. Is there any way other than Periodic Beacon for Sync.



Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #33 on: April 30, 2017, 05:57:05 pm »
In between , using periodic sync will affect our application by increasing response time at Receiver. Response time means that Changes of temperature value at transmitter nodes takes how long to reflect at GUI.
I don't understand why you think that sync pulses will affect anything. They are the only way to get close to 100% of the bandwidth utilization.

I don't know off the top of my head how long the frames are in OQPSK-1000, but in a standard OQPSK-250, a maximum length frame takes 4.5 ms to transmit. And it may actually get a bit shorter for time-synchronized mode, since you can eliminate CSMA/CA procedure.

So lets say you select 4.5 ms intervals. This means that 10 devices aligned back to back will be able to send their data in 45 ms. And transmitter will have to send a sync frame, which can be very short, but even if we assume 5 ms, this means that every device will get a chance to transmit full payload every 50 ms.

You can also skip some sync frames, if you feel like time keeping is good enough on the nodes.

All those calculations are theoretical, a lot will depend on the receiver design as well. You will probably have to switch to the real interrupt-driven radio driver, since it will have to receive a lot of data.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #34 on: April 30, 2017, 06:13:52 pm »
Hi Alex,
Basically Sync frame is broadcast frame. In the Mesh network, it will be passed between nodes presented in the network to sync time. So, reach time of Sync frame will differ between nodes right?. If Star network, Sync frame will be reached all nodes at same time right?

And please let me know that why I need to disable routing for testing and how to disable.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #35 on: April 30, 2017, 06:17:39 pm »
In the Mesh network, it will be passed between nodes presented in the network to sync time.
No, forget about mesh, There will be no mesh. Time-synchronized mesh networks is something people write PhD disserations about, but in real life they don't work. And most certainly not with this kind of approach to the design.

If Star network, Sync frame will be reached all nodes at same time right?
Yes, and you need to keep it to the star topology. Or invest A LOT of time in money into R&D.

And please let me know that why I need to disable routing for testing and how to disable.
Exactly for that reason. It is disabled in the stack configuration file.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #36 on: April 30, 2017, 07:05:00 pm »
Hi Alex,

Only disabling #define NWK_ENABLE_ROUTING Macro will change the stack to Star topology.




Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #37 on: April 30, 2017, 07:06:42 pm »
Only disabling #define NWK_ENABLE_ROUTING Macro will change the stack to Star topology.
It will disable routing, all devices within the range will still be able send data directly. In your scenario, it is equivalent to star topology,
Alex
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #38 on: May 03, 2017, 01:29:59 am »
Here is a simple example of a pretty basic time-synchronized network https://github.com/ataradov/netsim/tree/master/embedded/time_sync

This example is written for the network simulator PHY, and will not work on the real hardware. But NetSim radio was modeled after Atmel radios, so porting would not be too hard.

You can try it in the simulator, or just look at the code to get an idea. The code is fully interrupt-driven. Your main loop is free fro ADC and whatever else you want there.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #39 on: May 03, 2017, 09:22:15 am »
Hi Alex,
I can understand code.

But, I don't see any simulator tool to simulate and any document to work around it in the link which you gave.Please suggest a solution.




Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #40 on: May 03, 2017, 03:30:16 pm »
But, I don't see any simulator tool to simulate and any document to work around it in the link which you gave.Please suggest a solution.

That link is quite literally a part of the NetSim project. Here is the link to the root - https://github.com/ataradov/netsim/
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #41 on: May 05, 2017, 10:11:24 am »
Hi Alex,
Though I read README.md  text in the netSim, I have some doubt on Simulator working. 
Following is the My questions:

1. I don't see simulator.exe in the link that you gave. How to generate it?

2.If I would use Atmel studio and compiling the netSim code in this, what should I do with makefile?

3.Without using real boards, How to simulate multiple nodes using netSim?

Please make me clear in the above.


Thanks,
Muthu





Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #42 on: May 05, 2017, 04:20:59 pm »
1. I don't see simulator.exe in the link that you gave. How to generate it?
You have to build it yourself. I don't distribute binary files. Just do what is described in the Installation section. You will need to have MinGW installed to the the GCC for windows and all the necessary utilities.

2.If I would use Atmel studio and compiling the netSim code in this, what should I do with makefile?
It goes with GNU Make utility. You will get it as part of the MinGW installation.

This is not an Atmel product, so it would be against EULA to use Atmel Studio for this. Not that it would make any sense, even if it was not illegal.

You will have to learn how to use make, it is an industry standard tool.

3.Without using real boards, How to simulate multiple nodes using netSim?

NetSim reads a configuration file, that specifies parameters of the simulated environment. In case of TimeSync application this file is located here https://github.com/ataradov/netsim/blob/master/embedded/time_sync/TimeSync_4x4.cfg It specifies a network of 16 nodes located on a grid.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #43 on: May 13, 2017, 08:38:05 am »
Hi Alex,
I just tried WSN demo project by sending dummy packets from 4 boards. I see below 0.5% packet loss consistently for 4 times-30 minutes capture. I tested at 200ms interval packet send.  But, I wonder how to integrate ADC and maintain synchronicity between ADC task and LWMESH timer which is used to send data in WSN. Because, When I test with dummy data, after 200ms expired, it goes TimerHandler fuction to fill buffer to a prepare packet and change the STATE to APPSEND_DATA to send the prepared packet.This is completely independent task so it was working as expected. But when ADC comes , there are two tasks, Sample accumulation and Timer task. I see difficulty in achieving sync between tasks.Please suggest a solution.

I am also trying with PHY layer.


Thanks,
Muthu



 
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #44 on: May 13, 2017, 05:41:33 pm »
I see difficulty in achieving sync between tasks.
I don't see a problem here, and without knowing specifics of your code it is impossible to say wot to do.  Just make sure that none of your task handlers are longer than 10 ms. If they need to be - split processing into multiple stages.

The code I provided runs 100% from interrupts, so main application is free to do whatever it wants to do.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #45 on: May 14, 2017, 04:53:56 pm »
Hi Alex,
I have attached the main file and WSN source file. Here, I just tired what I want to do. With this code, I am facing the Problem which I already described. Please let me know if there

I have some questions on the provided code:
The provided code  is compatible for AT86RF212B PHY layer right?. And I can port and check with real hardware?


Thanks,
Muthu
« Last Edit: May 14, 2017, 05:14:44 pm by muthukural001 »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #46 on: May 14, 2017, 06:10:18 pm »
I have attached the main file and WSN source file. Here, I just tired what I want to do. With this code, I am facing the Problem which I already described. Please let me know if there
I'm not reading 14 pages of code. Why not debug? Toggle a pin at time-critical moments and see where your expected timings don't hold on the oscilloscope. You have to start debugging  your code, not just write and guess why it does not work.


The provided code  is compatible for AT86RF212B PHY layer right?. And I can port and check with real hardware?
Depends on how you define compatible. After porting, it will be working with the real radio. Right now it is designed to work vit a virtual radio, that is similar to all Atmel radios.

It is not really porting. You need to understand what this code does and change 212B PHY code accordingly.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #47 on: May 20, 2017, 02:55:31 pm »
Hi Alex,


[/quote]

This is probably the source of your problems. How long do tcp_write() and tcp_output() take? If they take more than 5-10 ms, then you will have dropped frames.

When appDataInd() is blocked, only one other frame can be buffered in the radio for further processing, the rest of them will be rejected.

At this data rate, you need to accumulate data from many devices and send it in one chunk. And this sending must be fast, or it must be split into smaller section using state machines.
[/quote]

As soon as I come out of appDataInd, I can avoid dropping packets. I come up with FIFO buffer idea which is used to store frame in appDataInd function. So, I am not going to use tcp functions in appDataInd. In while (1), tcp transmission will be performed if FIFO HEAD and TAIL not matched.

It will work?


Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #48 on: May 20, 2017, 09:47:14 pm »
It will work?
If your TCP/IP functions remain big and blocking, then no, it will not. It does not matter where you call them, what matters is how often you release control to the stack (call SYS_TaskHandler). Everything in the stack happens from within that task handler, so if you block outside of the appDataInd(), there will be no new appDataInd() until you unblock and call SYS_TaskHandler().
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #49 on: May 21, 2017, 04:46:43 am »
Hi Alex,
There are two taskHandler in while(1), SYSTaskHandler and Etherenet_TaskHandler. Yes, I understood that how much important to call SYS_TaskHandler frequently to avoid frame missing. Is there any efficient way to do this?



Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #50 on: May 21, 2017, 04:49:17 am »
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.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #51 on: June 01, 2017, 12:03:02 pm »
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
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #52 on: June 01, 2017, 04:23:47 pm »
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.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #53 on: June 02, 2017, 05:12:57 am »
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
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #54 on: June 02, 2017, 05:26:58 am »
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.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #55 on: June 02, 2017, 02:50:54 pm »
Hi,

Can you tell me that how to disable acknowldgement ?




Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #56 on: June 02, 2017, 03:42:51 pm »
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.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #57 on: June 02, 2017, 03:52:59 pm »
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
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #58 on: June 02, 2017, 03:54:25 pm »
Doing this change unicast mode to broadcast mode in My side.
I seriously doubt it. How do you know it?
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #59 on: June 03, 2017, 10:47:54 am »
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
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #60 on: June 07, 2017, 09:44:47 am »
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
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #61 on: June 07, 2017, 04:44:11 pm »
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.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #62 on: June 08, 2017, 09:53:10 am »
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

« Last Edit: June 08, 2017, 11:51:58 am by muthukural001 »
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #63 on: June 08, 2017, 02:42:24 pm »
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.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #64 on: June 08, 2017, 04:27:04 pm »
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.
Alex
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #65 on: June 08, 2017, 04:28:40 pm »
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.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #66 on: June 09, 2017, 03:35:01 am »
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
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #67 on: June 09, 2017, 03:52:31 am »
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.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #68 on: June 09, 2017, 08:19:01 am »
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
 
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #69 on: June 09, 2017, 08:27:32 am »
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.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #70 on: June 09, 2017, 02:21:56 pm »
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



 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #71 on: June 09, 2017, 02:52:10 pm »
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();
}
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #72 on: June 09, 2017, 09:23:36 pm »
Sorry. This is the first time working on Wireless field.
But MCU timers are a very generic topic, they are not specific to wireless.
Alex
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #73 on: June 09, 2017, 09:24:52 pm »
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.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #74 on: June 10, 2017, 02:04:47 am »
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;
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #75 on: June 10, 2017, 02:08:06 am »
Those registers are not applicable to a real hardware, so you can do whatever you want with them. They only work in a simulator.

For real hardware, you have to rewrite this code to use real registers from a real microcontroller.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #76 on: June 11, 2017, 06:48:35 am »
Hi Alex,

Now I am able to send Sync command for every 60ms from Gateway. But End devices not responding.

This is because AT86RF Interrupt  ISR is not get call. Our board using PB14 for interrupt.  File trxaccess.c which is taken from PEER2PEER project having following definition for AT86 interrupt:

Code: [Select]
typedef void (*irq_handler_t)(void);
static irq_handler_t irq_hdl_trx = NULL;
Code: [Select]
   void trx_spi_init(void)
{
/* Initialize SPI in master mode to access the transceiver */
#if SAMD || SAMR21 || SAML21 || SAMR30
spi_slave_inst_get_config_defaults(&slave_dev_config);
slave_dev_config.ss_pin = AT86RFX_SPI_CS;
spi_attach_slave(&slave, &slave_dev_config);
spi_get_config_defaults(&config);
config.mux_setting = AT86RFX_SPI_SERCOM_MUX_SETTING;
config.mode_specific.master.baudrate = AT86RFX_SPI_BAUDRATE;
config.pinmux_pad0 = AT86RFX_SPI_SERCOM_PINMUX_PAD0;
config.pinmux_pad1 = AT86RFX_SPI_SERCOM_PINMUX_PAD1;
config.pinmux_pad2 = AT86RFX_SPI_SERCOM_PINMUX_PAD2;
config.pinmux_pad3 = AT86RFX_SPI_SERCOM_PINMUX_PAD3;
spi_init(&master, AT86RFX_SPI, &config);
spi_enable(&master);

struct extint_chan_conf eint_chan_conf;
extint_chan_get_config_defaults(&eint_chan_conf);
eint_chan_conf.gpio_pin = AT86RFX_IRQ_PIN;
eint_chan_conf.gpio_pin_mux = AT86RFX_IRQ_PINMUX;
eint_chan_conf.gpio_pin_pull      = EXTINT_PULL_DOWN;  //EXTINT_PULL_DOWN
#if (SAML21 || SAMR30)
eint_chan_conf.enable_async_edge_detection = false;
#else
eint_chan_conf.wake_if_sleeping    = true;
#endif
eint_chan_conf.filter_input_signal = false;
eint_chan_conf.detection_criteria  = EXTINT_DETECT_RISING;
extint_chan_set_config(AT86RFX_IRQ_CHAN, &eint_chan_conf);  //AT86RFX_IRQ_CHAN=14(PB14 connected to IRQ)
extint_register_callback(AT86RFX_ISR, AT86RFX_IRQ_CHAN, EXTINT_CALLBACK_TYPE_DETECT);
        extint_chan_enable_callback(AT86RFX_IRQ_CHAN,EXTINT_CALLBACK_TYPE_DETECT);
}
In the PHY_Init(), I am calling trx_irq_init(FUNC_PTR trx_irq_cb) like below to set callback function as irq_handler_trx()

Code: [Select]
void PHY_Init(void)
{
          uint8_t reg;
trx_spi_init();
trx_irq_init((FUNC_PTR)irq_handler_trx);
PhyReset();
phyRxState = false;
phyBand = 0;
phyModulation = phyReadRegister(TRX_CTRL_2_REG) & 0x3f;
phyState = PHY_STATE_IDLE;

do {  phyWriteRegister(TRX_STATE_REG, TRX_CMD_TRX_OFF);
} while (TRX_STATUS_TRX_OFF !=(phyReadRegister(TRX_STATUS_REG) & TRX_STATUS_MASK));

phyWriteRegister(IRQ_MASK_REG, (1<<TRX_END));  //---------> Enabling inetrrupt for Transmission and Reception

reg = phyReadRegister(RF_CTRL_0_REG) & ~0x03;
phyWriteRegister(RF_CTRL_0_REG, reg | 0X02); /* GC_TX_OFFS =3 for BPSK */

phyWriteRegister(PHY_TX_PWR_REG, 0x00); /* 3dBm */

    phyWriteRegister(TRX_CTRL_1_REG,(1 << TX_AUTO_CRC_ON) | (3 << SPI_CMD_MODE) | (1 << IRQ_MASK_MODE));

    phyWriteRegister(TRX_CTRL_2_REG, (1 << RX_SAFE_MODE));
}
Code: [Select]
void irq_handler_trx(void)
{
if (PHY_STATE_SLEEP == phyState)
{
return;
}

if (phyReadRegister(IRQ_STATUS_REG) & (1 << TRX_END))
{
if (PHY_STATE_IDLE == phyState)
{
PHY_DataInd_t ind;
uint8_t size;
int8_t rssi;
rssi = (int8_t)phyReadRegister(PHY_ED_LEVEL_REG);
trx_frame_read(&size, 1);
trx_frame_read(phyRxBuffer, size + 2);
ind.data = phyRxBuffer + 1;
ind.size = size - PHY_CRC_SIZE;
ind.lqi  = phyRxBuffer[size + 1];
ind.rssi = rssi + phyRssiBaseVal();
PHY_DataInd(&ind);
phyWaitState(TRX_STATUS_RX_AACK_ON);
}
else if (PHY_STATE_TX_WAIT_END == phyState)
{
uint8_t status = (phyReadRegister(TRX_STATE_REG) >>TRAC_STATUS) & 7;
  if (TRAC_STATUS_SUCCESS == status)
{
status = PHY_STATUS_SUCCESS;
}
else if (TRAC_STATUS_CHANNEL_ACCESS_FAILURE == status)
{
status = PHY_STATUS_CHANNEL_ACCESS_FAILURE;
}
else if (TRAC_STATUS_NO_ACK == status)
{
status = PHY_STATUS_NO_ACK;
}
else
{
status = PHY_STATUS_ERROR;
}
phySetRxState();
phyState = PHY_STATE_IDLE;
PHY_DataConf(status);
}
}
}
Please suggest a solution



Thanks,
Muthu
« Last Edit: June 11, 2017, 01:04:29 pm by muthukural001 »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #77 on: June 11, 2017, 09:28:57 pm »
I have no clue about ASF and its interrupt configuration and handling. And I don't want to waste a second of my time trying to figure that out. That you will have to figure out on your own.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #78 on: June 12, 2017, 03:23:31 pm »
Hi  ataradov,

My Phy_Init() is ok ?. Though I set IRQ_MASK_REG to give interrupt for Transmission completion and Frame reception, I am not getting any interrupt. I have no idea on what is missing in Interrupt setup. Do you see anything wrong code?. Please suggest a solution.




Thanks,
muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #79 on: June 12, 2017, 03:37:40 pm »
My Phy_Init() is ok ?. Though I set IRQ_MASK_REG to give interrupt for Transmission completion and Frame reception, I am not getting any interrupt.
Your code look ok.

Does the interrupt pin actually change its state? You need to separate interrupt controller issue from the radio issue.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #80 on: June 14, 2017, 03:50:26 pm »
Hi ataradov,

Sorry. Transmission completion interrupt is coming but not frame reception.Shared code automatically add field which are mandatory  for filtering process at Receiver side.

Pls help me ?


Thanks,
Muthu
« Last Edit: June 14, 2017, 04:13:41 pm by muthukural001 »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #81 on: June 14, 2017, 05:01:45 pm »
Pls help me ?
Use basic mode, there is no need to mess with IEEE headers in this case.

If you still want to do that, then read section "8.2 Frame Filter" of the datasheet, read section 7.5.6.2 of the IEEE 802.15.4-2006 standard. Or just look at how LwMesh is doing it.

Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #82 on: June 14, 2017, 05:56:03 pm »
Hi,

Basic mode will support OQPSK-250kbps?



Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #83 on: June 14, 2017, 05:57:33 pm »
Basic mode has noting to do with modulation. Just spend a couple hours and read the datasheet fully. Your life will be much easier.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #84 on: June 15, 2017, 07:54:50 am »
Hi ataradov,

I don't see any topic which is related to Basic mode.
Q1:
Can you point me?

Q2:
In the basic mode, no need to add header?

Q2:
 Basic mode will take care acknowledgement  ?


Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #85 on: June 15, 2017, 03:11:36 pm »
Ok, this is really turning into huge waste of my time. You should consider hiring a professional developer if you want this to go anywhere.

I don't see any topic which is related to Basic mode.
Q1: Can you point me?
Are you serious? READ THE DATASHEET. At least read the table contents. There is a chapter 7.1 called "Basic Operating Mode". How can you miss it?

Q2:In the basic mode, no need to add header?
All answered in the datasheet.

Q2: Basic mode will take care acknowledgement  ?
No, but you don't want low-level ACKs for time-synchronized network anyway. ACKs are taken care of on a network level.

Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #86 on: June 15, 2017, 03:48:14 pm »
Hi,
I am really sorry.Hereafter, I will try to solve the problems as much as I can. So, for my application, I can stick to Basic operating mode right?



Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #87 on: June 15, 2017, 04:29:39 pm »
Not only you can, you should.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #88 on: June 16, 2017, 03:56:40 pm »
Hi ataradov,

In the basic mode, I can send SYNC command for the specified interval from Gateway. But, in the end node, control goes to dummy_handler() exception when start slot timer upon receiving SYNC command. I am not facing this issue when I start SYNC timer in Gateway. With commenting Slot timer code, I can get SYNC command  continuously from gateway without problem. Please suggest a solution.



Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #89 on: June 16, 2017, 04:14:11 pm »
Most likely something in your code causes Hard Fault. You need to debug and find what it is.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #90 on: June 20, 2017, 11:15:47 am »
Hi ataradov,

I couldn't found what is causing hard fault.Still I am trying. But, End node receives SYNC command for every SYNC interval from Gateway if I keep Transceiver state at RX state and commenting Phy_DataInd(). If I enable, Phy_DataInd(), it goes to DummyHandler(). Do U see any mistake with the following code?
Code: [Select]
void PHY_DataInd(PHY_DataInd_t *ind)
{
NwkHeader_t *header = (NwkHeader_t *)ind->data;
        if (ind->size < sizeof(NwkHeader_t))
{
return; // Malformed frame
}
    if (nwkDeviceId != header->dst && NWK_BROADCAST_ID != header->dst)
{
return; // This frame is not for us
}
if (NWK_COMMAND_SYNC == header->command)
{
nwkStartTimer(nwkDeviceId * NWK_SLOT_TIME, nwkSlotTimerHandler); 
}
if (NWK_COMMAND_DATA == header->command)
{
NWK_DataInd_t nwkInd;

nwkSyncAck |= (1 << header->src);
nwkInd.src  = header->src;
nwkInd.dst  = header->dst;
nwkInd.data = ind->data + sizeof(NwkHeader_t);
nwkInd.size = ind->size - sizeof(NwkHeader_t);
nwkInd.lqi  = ind->lqi;
nwkInd.rssi = ind->rssi;

NWK_DataInd(&nwkInd);
}
}


Thanks,
muthu
« Last Edit: June 20, 2017, 11:21:18 am by muthukural001 »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #91 on: June 20, 2017, 04:47:07 pm »
Well, what exact line here fails? Get a debugger and singe-step trough the code.

My guess is that there is an issue with packing of the NwkHeader_t.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #92 on: June 21, 2017, 05:22:10 am »
Hi ataradov,

Thanks.Here it get fails

Code: [Select]
if (nwkDeviceId != header->dst && NWK_BROADCAST_ID != header->dst)
{
return; // This frame is not for us
}

Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #93 on: June 21, 2017, 05:23:56 am »
So is your NwkHeader_t packed?
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #94 on: June 21, 2017, 05:42:07 am »
Hi ataradov,

I have attached debug images.





 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #95 on: June 21, 2017, 05:44:19 am »
Show me how your structure is defined! It must have PACK next to it, and that PACK must actually be defined. Do you have nay of this?
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #96 on: June 21, 2017, 05:47:55 am »
Hi,

Here is My structure.

Code: [Select]
typedef struct
{
uint16_t src; //uint8_t      src;
uint16_t dst; //uint8_t      dst;
uint8_t  command;//uint8_t      command;
} NwkHeader_t;

typedef struct
{
NwkHeader_t header;
uint32_t    ack;
} NwkSyncCmd_t;

typedef struct
{
NwkHeader_t header;
uint8_t     data[NWK_MAX_PAYLOAD_SIZE];
} NwkDataCmd_t;

I don't define anything other than this.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #97 on: June 21, 2017, 05:49:39 am »
Well, the parts you have removed from my code are critical. Put them back, and try to understand why they are needed there.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #98 on: June 21, 2017, 06:14:36 am »
Hi Alex,

Thank you very much. Now it is fine. Missed PACK definition at all.



Thanks,
Muthu
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #99 on: June 21, 2017, 11:46:40 am »
Hi Ataradov,

I have tested with two boards in the basic mode.Node-1 will send at 20 ms and Node-2 at 40ms from the time of  Sync command received. It seems to be working. Can you have look at the attached Wireshark log ?. 

WireShark:
In this, Row with 9 bytes is Beacon Or Sync command and  followed by two rows with 41 bytes are data from Node 1 and Node 2. First two bytes of all is Source address followed Destination address respectively.

Questions:
1. Is there any Wireshark protocol for Basic mode?. Because wireshark fields like Info,Protocol,Source and Destination gives different name while capture.


Give your  comments.


Thanks,
Muthu

 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #100 on: June 21, 2017, 03:55:36 pm »
I have tested with two boards in the basic mode.Node-1 will send at 20 ms and Node-2 at 40ms from the time of  Sync command received. It seems to be working. Can you have look at the attached Wireshark log ?. 
If it works, it works. What is there to look at?

1. Is there any Wireshark protocol for Basic mode?. Because wireshark fields like Info,Protocol,Source and Destination gives different name while capture.
In basic mode, you define payload. So unless you write a dissector for your protocol, Wireshark will not know how to deal with it. Just use raw IEEE 802.15.4 frames and parse things manually.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #101 on: June 22, 2017, 05:58:06 am »
Hi Ataradov,

Thanks.

Quote
Just use raw IEEE 802.15.4 frames and parse things manually.

I have to do this in the basic mode itself right?
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #102 on: June 22, 2017, 06:00:27 am »
You do this in Wireshark. Basic mode is an internal thing to the radio. Wireshark does not care how your radio generated the frame.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #103 on: June 22, 2017, 07:42:00 am »
Hi,

Q1:how to get start with writing dissector ?


Q2:How long it would take for developing Own protocol in wire shark?



Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #104 on: June 22, 2017, 03:19:27 pm »
Q1:how to get start with writing dissector ?
I have no clue. I have never written one. I bet they have some documentation on this - google it.

Q2:How long it would take for developing Own protocol in wire shark?
Writing itself is probably not that hard. But it will take some time to set up the build environment with all the dependencies and stuff.

You probably just want to download the source code and try to build it. If you don't want to publish your changes, then you can just hack up LwMesh dissector to show the data you want.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #105 on: June 30, 2017, 10:31:36 am »
Hi Alex,


I am seeing problem when two external interrupts(ADC int and RF module int) starts to work.

Problem:

When I test without Gateway board, I can read the expected TEMPRATURE values from ADC in interrupt mode as there is no SYNC command sending and RF module interrupt will not trigger as well. The moment when I turn on Gateway board, RF module interrupt triggers whenever it send & receive  but ADC temperature values read as zero instead the expected value. couldn't come out of this even if Gateway board switched off again. It is going fine in to ADC handler.
 
Here is the code:

ADC Handler

Code: [Select]
int32_t volatile Tsample;
int32_t sample;
volatile bool adc_int=false;
void ad7124_irq_handler(void)  //ADC handler
{
adc_int=true;
struct system_pinmux_config pin_conf;
pin_conf.mux_position = 0x03; // Change MISO/EXTINT pin MUX position to Sercom MUX for SPI
system_pinmux_pin_set_config(PIN_PA04, &pin_conf);
ATOMIC_SECTION_ENTER
ret=AD7124_ReadData(ad7124_handler, &sample);
ATOMIC_SECTION_LEAVE
}


main

Code: [Select]
int main(void)
{
enum ad7124_registers regNr;
irq_initialize_vectors();
system_init();
delay_init();
configure_spi_master();                                 //ADC spi innterface at 3MHZ sclk
ret = AD7124_Setup(ad7124_handler, AD7124_SLAVE_ID, (ad7124_st_reg *)&ad7124_regs); //ADC functions
if (ret<0)
{
return;
}
ret= AD7124_Calibration(AD7124_SLAVE_ID);                                            //ADC functions
if (ret<0)
{
return;
}
for(regNr = AD7124_Status; (regNr < AD7124_REG_NO) && !(ret < 0); regNr++)           //ADC functions
{
ret = AD7124_ReadRegister(ad7124_handler, &ad7124_regs[regNr]);                  //------------------>Read Register value after Writing
if (ret < 0)
return;
}
port_pin_set_output_level(EXT1_PIN_10,false);
PHY_Init();
NWK_Init(SRC_ADDR);
timer_init();
appInit();
configure_extint_channel();
adc_irq_init((FUNC_PTR)ad7124_irq_handler);   //Pointing ADC handler
cpu_irq_enable();
port_pin_set_output_level(EXT1_PIN_10,true);  //start conversion
    while (1)
{

               if (adc_int==true)
              {
          adc_int=false;
          struct system_pinmux_config pin_conf;
          pin_conf.mux_position = 0x00;        // change back MUX position to EXTINT to detect next RDY
          system_pinmux_pin_set_config(PIN_PA04, &pin_conf);
          ATOMIC_SECTION_ENTER
          Tsample=sample;
          ATOMIC_SECTION_LEAVE
          channelnum= Tsample & 0x0F;
          if(acqptr<50)                                            //Buffer capacity for 10 samples (50 bytes)
         {
acqbuf[acqptr++]= MODULE_NO;                     // MODULE_NO as per Lab view configuraion
acqbuf[acqptr++]= channelnum;
acqbuf[acqptr++]= (Tsample>>24) & 0xFF;
acqbuf[acqptr++]= (Tsample>>16) & 0xFF;
acqbuf[acqptr++]= (Tsample>>8) & 0xFF;
                  }
                  if(acqptr==50)
         {
acqptr=0;
                  }
}

Suggest.


Thanks,
Muthu
« Last Edit: June 30, 2017, 11:30:50 am by muthukural001 »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #106 on: June 30, 2017, 05:50:41 pm »
I don't know. Debug!
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #107 on: August 09, 2017, 01:33:07 pm »
Hi Alex,

I successfully sent ADC packets from two boards to Receiver in time sync method without loss. I want to know something in the code,

There is nwkSyncAck, When I send sync command, I assign the value of nwkSyncAck which is modified by the last node acknowledgement to nwkSyncCmd.ack. But in the node side, it is not used for any purpose.

Also
Code: [Select]
if ((counters[ind->src] + 1) != data->counter)
{
SYS_CTRL_LOG = "Counter mismatch"; //in the shared code
}

Should I use the above code in the NWK_DataInd function?

Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #108 on: August 09, 2017, 04:11:37 pm »
It is basically a combined ACK variable for the whole time frame, you are free to use it however you like.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #109 on: August 12, 2017, 12:25:55 pm »
Hi Alex,
Everything is going in the right way. But, I see the slot Timer interrupt occurence at 5-10ms tolerance from the slot period set. I set slot time for 20ms. First node will trigger at 20ms, second node at 40ms and third one at 60ms. But realistically, first node trigger at 24 ms, second node at 46msand third one at 72ms from the time of SYNC command received with the following board clock.

     (Internal oscillator)OSC32K--------------->SYSTEM_CLOCK_SOURCE_DFLL---->48MHz, with Closed-loop

Please suggest a solution...


Regards,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #110 on: August 12, 2017, 04:37:05 pm »
Configure GCLK output on a pin and measure the actual clock frequency.

And them double check your timer configuration.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #111 on: August 13, 2017, 02:33:12 pm »
Hi,

Ok, I can guess that Measuring the clock and apply it to the following formula which is used to calculate period,

Quote
(F_CPU / 1000ul / 256) * i; //F_CPU=Actual clock frequency
........


Coming to the Range,

Case-10ft distance:
I checked with 3 transmitters to the Receiver which is 10 feet away from the transmitters...In this case, for sometime I get 100% reception from each transmitters and sometime I see losses which is negligible...

case-30ft distance:
This one gives poor output... I see 10-30% losses from each of the transmitters...


In the field, Receiver will sit at 100ft away from transmitters....suggest


Regards,
Muthu
« Last Edit: August 13, 2017, 02:37:49 pm by muthukural001 »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #112 on: August 13, 2017, 05:08:36 pm »
Ok, I can guess that Measuring the clock and apply it to the following formula which is used to calculate period,
Well, not really. You need to understand why  they clock is so wrong compared to the requested. You are talking about huge differences.


In the field, Receiver will sit at 100ft away from transmitters....suggest
Perform actual measurements with actual instruments. Something is wrong with your hardware, I don't know what.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #113 on: August 14, 2017, 10:20:17 am »
Hi Alex,

I measured Main clock in the closed loop as well open loop. In the closed loop mode, clock oscillate between  47-48.5MHz.For open loop mode, it is between 44 - 45.1MHz.....

 GCLK_GENERATOR_1 source is internal 32Khz oscillator... Electrical characteristics says it may vary between 32.572 to 33.044 kHz at room temperature and 3.3V VDD...


Please look at the oscilloscope images for Open loop and closed loop mode... I am not able to figure out why it happens ....Please suggest how to get stable clock..........


Thanks,
Muthu
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #114 on: August 14, 2017, 12:16:56 pm »
Hi Alex,


I tried with 16MHZ internal oscillator as source for GENRATOR 1 with the pre-scalar of 500... since it has less variation in output frequency.

As input reference should be between 0.732 kHz to 35.1 kHz, I am dividing 16MHZ with 500 to get 32KHz..

In the DFLL configuration, I set DFLL_MULTIPLY_FACTOR to 1500 so that 1500*32Khz=48MHz.....

After done this, I see that timer triggers +/-1ms from the expected value...I don't see much difference which I saw with the Internal 32k input to DFLL.....

give your comments.


Reagrds,
Muthu

 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #115 on: August 14, 2017, 03:52:18 pm »
That all sounds about right. You can also put your 32 kHz source on the output, just to verify its actual frequency.

1 ms for short-term delays is still a lot.

Open loop mode depends on your setting of the tuning values, so it can be anything.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #116 on: August 15, 2017, 06:20:44 am »
Hi Alex,
I will do that..

Is there any way to set the required frequency by using Internal oscillators? (OR) Should I use external oscillators which have <=10ppm as source to generate 48MHz ?

Is there any documents which solve the above?


Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #117 on: August 15, 2017, 06:25:15 am »
Internal RC oscillator is plenty accurate. You just need to trace things on each step and verify all frequencies. Make sure that division and multiplication factors are correct, etc. You are measuring very short time intervals.

External oscillators are preferable, of course, but 10 ppm is probably an overkill, 25 ppm should be sufficient.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #118 on: August 17, 2017, 08:44:24 am »
Hi Alex,
Thanks..I recheck internal oscillator configurations...

Now,the biggest problem for us is that getting range....

RF MOULE:
We are using the available off-the-shelf 212B module board from Atmel/Microchip.

Antenna:
Coming to the antenna, we didn't design it. We are using off-the-shelf antenna..Here, we have to connect the antenna cable to module connector only..

Antenna information:


Antenna used for our custom board is :
Mfg:66089-0906
Des: ANTENNA U.FL 915MHZ 6MM -3dBi



Can you recommend antennas for 915 MHz ?

Suggest..

Thanks,
Muthu





 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #119 on: August 18, 2017, 12:04:25 am »
I don't have a lot of hands on experience with sub-GHz, so I can't recommend much apart from performing basic measurements on your system.

I'd download a copy of  FCC tester from atmel.com and port it to your hardware.

Also, which module do you use? If it is something unamplified, then you may be seeing its true performance.
« Last Edit: August 18, 2017, 12:06:00 am by ataradov »
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #120 on: September 20, 2017, 12:46:25 pm »
Hi Alex,

Is the time sync code support to use CCA feature in AT86RF212B to select channel automatically?



Regards,
Muthu
« Last Edit: September 20, 2017, 12:48:14 pm by muthukural001 »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #121 on: September 20, 2017, 03:50:46 pm »
I don't understand the question.

CCA is never used to select a channel. CCA is used to sense if selected channel is busy before transmitting. And it needs to be disabled for time-synchronized networks, since all devices know ahead of time that channel will be free, since they are transmitting in their personal time slot.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #122 on: September 22, 2017, 07:48:43 am »
Hi Alex,
Thanks. I just want to know that the following is possible with the time synchronized network code.

Right now, I have assigned Channel number 5-914Mhz in the North American band for End nodes and Gateway by writing the corresponding register. So, It will form network at Channel 5.Instead of doing the above, Is there any automatic channel selection method which measures channels energy before forming network so that form the network on the channel that have less energy ?.


Thanks,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #123 on: September 22, 2017, 04:06:53 pm »
Just do a ED scan on all channels before you pick one.

But that's not super robust, since interference may be intermittent. You probably also want to make a decision to switch even when network is running, but nodes can detect loss of data.

Read the ZigBee spec, it has all of that described, so you can get some ideas from there.
Alex
 

Offline muthukural001Topic starter

  • Regular Contributor
  • *
  • Posts: 211
  • Country: in
Re: LWMESH-OQPSK 1000kbps
« Reply #124 on: September 23, 2017, 08:01:24 am »
Hi Alex,
Thanks.I will read the Zigbee spec.I have the following Question.


1.Assume,there are 10 nodes plus Gateway.Each will do ED scan on startup and select channel which is best.The channel to be selected by the nodes and Gateway should be same right in order to time sync network work ? . Please let me know that how channel selection of each nodes will go.



Regards,
Muthu
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • 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
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • 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



 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • 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
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • 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


 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • 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


 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • 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
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • 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 »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • 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
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • 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
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • 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
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • 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
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: us
    • Personal site
Re: LWMESH-OQPSK 1000kbps
« Reply #150 on: April 28, 2018, 03:59:16 pm »
The more TX and RX FIFO will really help us in increasing the end nodes.
How so? You are limited by the OTA transfer speed, not the memory size at the moment.

In the Atmel studio ASF, I looked at RF215 chat example, there is  a mesh in understanding PHY driver.
I have no idea what kind of support there is for RF215 in AS.

And also let me know about moving to AT86RF215 is good ?
I don't see how it will benefit you at all.
Alex
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf