Author Topic: Atmel transceiver (RF212B) communication using microcontroller SAM D21  (Read 13206 times)

0 Members and 1 Guest are viewing this topic.

Offline CharvRastogiTopic starter

  • Newbie
  • Posts: 3
  • Country: in
Hello,

I am working on a project to implement communication between two Atmel transceiver (AT86RF212B) boards,  I am programming the boards using spi interface between them and SAM D21 (microcontroller). I am able to send and receive data using the LWmesh peer2peer sample project given by Atmel studio 7. But the issue is the data received and the data sent are not the same, the code somehow changes the data entirely. I am using a hyper terminal to send and look at the received data.
Could you please tell me why am I not receiving the correct data? Could it be the encryption scheme that is in-built in Atmel (AES)?

Thank you.

Link to the preface of the sample project - http://asf.atmel.com/docs/latest/thirdparty.wireless.avr2130_lwmesh.apps.peer2peer.sam4lc4c_reb233_xpro/html/index.html
(Note - this project is also available for the devices I have mentioned above)
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
But the issue is the data received and the data sent are not the same
It is highly likely that you have problems with UART baudrate mismatch. Have you verified your data inside the sending device (using debugger or otherwise)?

AES can be used but mismatch of security settings will be detected by the stack and invalid frames will be discarded.

PS: There is no need to cross post.
Alex
 

Offline CharvRastogiTopic starter

  • Newbie
  • Posts: 3
  • Country: in
Thank you! I was using the configured Baudrate between the microcontroller and the transceiver instead of the USART host baudrate.
The data is sent correctly now.

I had another doubt. I was trying to locate the exact point in the code that is used to send the data to the transceiver from SAM D21 using breakpoints and by hard coding the values, but I could not succeed. The code seems to involve many underlying protocols. Is it the sio2host subprogram? Hard coding the output didn't help here either. Would you have some light to shed on this?

PS: Sorry about the cross posting. 
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
I was trying to locate the exact point in the code that is used to send the data to the transceiver from SAM D21 using breakpoints and by hard coding the values, but I could not succeed.
My original code is much simpler and easier to understand. You can look at standalone version of LwMesh here http://www.atmel.com/tools/lightweight_mesh.aspx . The actual communication with the radio happens in the PHY layer, specifically phy.c file and PHY_DataReq() function. In the standalone version it calls HAL SPI access functions directly. In the ASF version it goes through more layers.

sio2host is a serial communication part, it is not related to the radio in any way.
Alex
 
The following users thanked this post: CharvRastogi

Offline CharvRastogiTopic starter

  • Newbie
  • Posts: 3
  • Country: in
Please correct me if I am wrong,
1. the function AppSendData() in the main program file (Peer2Peer.c) is used to send the data via the transceiver to the other transceiver at the receiving end.
2. the function appDataInd prints the data received from the radio on the host PC through UART.

How is the role of transmission divided between appSendData() and phy_datareq(). PHY_datareq seems to use the frame created in the nwk_tx.c program file, so I am assuming this is the frame that needs to be transmitted by the transceiver finally?

To hard code the output we implemented this method -
I, basically, hard coded the value of rx_data and fed it to both appsenddata() and sio2host_putchar(), and I expected this to print the data on the transmitting pc terminal (which it did) but it was not received by the receiving pc. Does this mean we would have to edit the frame_tx that I mentioned above in nkw_tx to alter the data being sent over the radio?

MY CODE -

int count;

static void APP_TaskHandler(void)
{
   switch (appState) {
      case APP_STATE_INITIAL:
      {
         appInit();
         appState = APP_STATE_IDLE;
      }
      break;

      case APP_STATE_IDLE:
      break;

      default:
      break;
   }
   
   count++;
   if(count%20001==1){
      count=1;   
   }
   
   if(count%20000==19999){
   sio_rx_length = 5;
   for (uint16_t i = 0; i < sio_rx_length; i++) {
      rx_data=('A'+i); //put A,B,C
   }
   rx_data[sio_rx_length]=0x00;
   //sio_rx_length = sio2host_rx(rx_data, APP_RX_BUF_SIZE); //until buffer is filled, 0 is returned. Buffer size is 20 bytes, defined in config.h   
   if (sio_rx_length) {
      for (uint16_t i = 0; i < sio_rx_length; i++) {
         sio2host_putchar(rx_data);  //Echo back on the tx pc
         if (appUartBufferPtr == sizeof(appUartBuffer))  //Send the packet when the buffer is full
         {
            appSendData();
         }

         if (appUartBufferPtr < sizeof(appUartBuffer))  //Append to the packet to be sent, the size of which is sizeof(appUartBuffer)
         {
            appUartBuffer[appUartBufferPtr++] = rx_data;
         }
      }

      SYS_TimerStop(&appTimer);
      SYS_TimerStart(&appTimer);
   }
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
1. the function AppSendData() in the main program file (Peer2Peer.c) is used to send the data via the transceiver to the other transceiver at the receiving end.
That's the high-level idea.

2. the function appDataInd prints the data received from the radio on the host PC through UART.
appDataInd() is the callback that is called when data is received.

How is the role of transmission divided between appSendData() and phy_datareq(). PHY_datareq seems to use the frame created in the nwk_tx.c program file, so I am assuming this is the frame that needs to be transmitted by the transceiver finally?
appSendData() is an application level function. It was convenient to implement it this way for this application, but you are expected to change things depending on your application needs. NWK_DataReq() is the ultimate stack API.

The rest of the functions add necessary headers and figure out how to route the frame before it is physically sent using PHY_DataReq().

I, basically, hard coded the value of rx_data and fed it to both appsenddata() and sio2host_putchar(), and I expected this to print the data on the transmitting pc terminal (which it did) but it was not received by the receiving pc. Does this mean we would have to edit the frame_tx that I mentioned above in nkw_tx to alter the data being sent over the radio?

You really need to properly design your application, don't just adopt to Peer2Peer. Look at SimpleRemote, for example. It has a very simple and clean implementation of just the wireless part.
Alex
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
lwmesh
« Reply #6 on: April 07, 2016, 12:40:17 pm »
HI

I am using atmel AT86RF233 1 C. For the testing purpose can i only transmit only one array with using only using physical layer i mean one end to another end without using stack.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
I am using atmel AT86RF233 1 C. For the testing purpose can i only transmit only one array with using only using physical layer i mean one end to another end without using stack.
Sure. Just use the code from phy.c from LwMesh. That's the lowest level PHY driver. You will need do to at least PHY_Init() and use PHY_DataReq() to send the data.
Alex
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
HI

This is my source code .I am able to read write registers and frame buffer, DIG3 LED is turned on .In this if any data is transmitted from UART data is written in frsme buffer. By transmitting interrupt register shows TX_END.and DIG4 blinks slidely but DIG3 is not turned off.i dont know what is happening because at receiving end i am not able to receive data.
« Last Edit: April 08, 2016, 09:02:39 am by kavita »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
There is a number of issues I see with this code.
1. You never actually wait for completion of the frame transfer.
2. You are using advanced TX mode, but you never configure the address/PAN_ID and your payload does not match standard format, which radio expects in the advanced mode. You are receiving in the basic mode, so the frame will be received, but TX will fail, and you need to check the status code.
3. You never set a channel.
Alex
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #10 on: April 09, 2016, 05:25:34 am »
thank you..
 
   can you please tell me what kind of changes i have to do in this....
   I have to set channel ,PAN ID?
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #11 on: April 09, 2016, 05:32:33 am »
For basic mode you only need to set channel.

And then transmit without ARET.
Alex
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #12 on: April 09, 2016, 06:15:43 am »
what is crc value..how to calculate this..here i have already set
There is no CRC value, but you need to set frame size including CRC size (2 bytes). With the auto CRC the radio will put it there automatically.
Alex
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #13 on: April 09, 2016, 10:39:45 am »
this is my new code i have set channel and PAN ID.IS this ok?
by doing his DIG3 blinks slidely..
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #14 on: April 09, 2016, 01:03:16 pm »
HEY
I have successfully done it.thank you so much.
can you please tell me if I want to use extended operating mode which additional setting  I have to do for this.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #15 on: April 09, 2016, 08:37:02 pm »
can you please tell me if I want to use extended operating mode which additional setting  I have to do for this.
Use states that correspond to the advanced mode. Just like LwMesh does.

In addition to this you will need to make sure that the header of your payload is formatted in accordance with IEEE802.15.4.
Alex
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #16 on: April 11, 2016, 05:57:32 am »
hi

 As mentioned in data sheet that when device in tx mode,DIG4 blinks and DIG3 will turn off but in my case it is not happening.can you please tell me what is the problem.I have checked all connections and hardware is ok.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #17 on: April 11, 2016, 05:58:54 am »
As mentioned in data sheet that when device in tx mode,DIG4 blinks and DIG3 will turn off but in my case it is not happening.can you please tell me what is the problem.I have checked all connections and hardware is ok.
Have you actually enabled them? Read the datasheet entirely, especially register description. DIG pins do nothing by default, you need to enable them.
Alex
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #18 on: April 11, 2016, 06:32:32 am »
phyWriteRegister(TRX_CTRL_1_REG,(1<<TX_AUTO_CRC_ON) | (3<<SPI_CMD_MODE) | (1<<IRQ_MASK_MODE)
|(1<< PA_EXT_EN) );

I have done this setting,connected led to both this pins and initialy led is connected to 3.3V when this pin goes low LED will turn On.Now DIG3 is on when this device is ideal I mean no tx and rx.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #19 on: April 11, 2016, 06:36:21 am »
I mean no tx and rx.
DIG 3 and DIG4 are complimentary, so if enabled, there are only two states - RX (even if radio is not actually receiving anything or not even in receive mode) and TX (when frame is transmitted). There is no in-between state.
Alex
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #20 on: April 11, 2016, 07:07:35 am »
OK,
so if I want that while doing  tx LED should on.any extra setting I have to do?   
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #21 on: April 11, 2016, 07:10:08 am »
No, PA_EXT_EN is enough. Keep in mind that TX time of a maximum payload is ~5 ms. You won't see that on an LED with your eyes.
Alex
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #22 on: April 11, 2016, 07:18:54 am »
okk thank you alex..
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #23 on: April 11, 2016, 08:46:42 am »
how can i set maximum gain?
Is it already set to maximum beacuse initially PHY_TX_PWR=0x0.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #24 on: April 11, 2016, 04:36:11 pm »
how can i set maximum gain?
It is a bit complicated, since total TX power in 212B is a combination of PA_BOOST, GC_PA and TX_PWR settings.

Table 9-15 shows recommended settings based on your location and used modulation scheme.
Alex
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #25 on: April 12, 2016, 09:12:06 am »
hii alex i have started using lwmesh protocol and modified my nwkframe.h like this..
this shows sizeof(NwkFrameHeader_t)=0x12
and
sizeof(NwkFrame_t)=0x94
i am sending buffer with 6 elements.
is this ok

 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #26 on: April 12, 2016, 09:22:17 am »
I have started working on lwmesh peer to peer example and modify this file like this.i am sending data by using NWK_DataReq(&appDataReq);..

my data is {0,1,2,3,4,5}

but in PHY_DataReq while writing frame buffer this data does not appear in that frame.
physical frame looks{41,88,01,00,67,45,ff,,ff,00,00,06,02,00,00,ff,ff,00,00,02,00,00,00,01,02,00,ff,fc,02}
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #27 on: April 12, 2016, 04:27:16 pm »
I don't understand what you are doing exactly. There is only a header file attached, no actual code.
Alex
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #28 on: April 13, 2016, 09:52:37 am »
hi alex my problm was packing of structure..

i have solved it.
now i want to use extended operating mode..I have attached two files in tx i am transmitting one array and in another side receiving that ..but i am not able to receive it in extended mode..
I Am not using lwmesh but array is same as created by lwmesh..
« Last Edit: April 13, 2016, 09:57:42 am by kavita »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #29 on: April 13, 2016, 10:28:12 pm »
That's a lot of poorly written code. I'm not going to study that in details. My advice is to use phy.c as is without any modifications and do a proper port to your platform by substituting functions in halPhy.h / halPhy.c.
Alex
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #30 on: April 14, 2016, 05:42:14 am »
hii alex
I am transmitting frame...
and it is transmited successfully

transmit_buffer[30]={0x41,0x88,0x01,0x67,0x45,0xFF,0xFF,0x00,0x00,0x00,0x01
,0x00,0x00,0x01,0x00,0x11,0x06,0,1,2,3,4,5};

0x44,0x88 for broadcast frame control
0x01 sequence no
OX45,0X67 PAN ID
0xff,0xff MAC destination address
0x00,0x00 MAC source address
0X00 frame control
0x01 sequence no
0x00 ,0x00 NWK source address
0x00,0x01 NWK destination address
0x11 source and destination endpoint
0x06 no of data
0,1,2,3,4,5 actual data

but at the receiving end with using RX_AACK I AM NOT RECEIVING ANYTHING..
is there any problm in this frame if yes then please correct me..
« Last Edit: April 14, 2016, 05:45:43 am by kavita »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #31 on: April 14, 2016, 06:46:15 am »
Again, I don't know what's wrong with your code because it is unreadable mess. I'm  not going to waste my time decoding constructions like "if(reg_read & 0x08)". I have no idea what 0x08 is.

Take phy.c as is, make a proper port for your platform by providing functions HAL_PhySpiXXX() and see that this code works.
Alex
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #32 on: April 15, 2016, 08:09:37 am »
hey thanx
by using lwmesh I have successfully done peer to peer communication..
can u plz tell me what is the purpose of the timers in that code...
« Last Edit: April 15, 2016, 09:41:41 am by kavita »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #33 on: April 15, 2016, 04:03:12 pm »
To create event
can u plz tell me what is the purpose of the timers in that code...
In what code? Generally timers have descriptive names.
Alex
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #34 on: April 18, 2016, 05:55:34 am »
what happens if i remove all the timers form lwmesh..
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #35 on: April 18, 2016, 06:27:28 am »
what happens if i remove all the timers form lwmesh..
This is a strange question. Things will break. What exactly will break depends on the timer, of course.

If timers were not needed, they would not be there in a first place.
Alex
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #36 on: April 18, 2016, 11:46:02 am »
yes i got it..

i have set  appDataReq.options = NWK_OPT_ACK_REQUEST;
then how do i know that ack is received...
in my code  appDataInd(NWK_DataInd_t *ind) is called even if i dont got acknowledgement...
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #37 on: April 18, 2016, 04:00:18 pm »
appDataInd() is an indication of the received data frame.

The fact that ACK was received is indicated though a status code in the confirmation handler you provide as part of the data requests.

BTW, all of this is described in the LwMesh documentation.
Alex
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #38 on: April 19, 2016, 08:19:11 am »
but appDataInd is not called at reception of ack...
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #39 on: April 19, 2016, 08:21:06 am »
but appDataInd is not called at reception of ack...
So what? Reception of an ACK is handled as a part of the data request. So when confirmation callback is called, you know that ACK was either received, or there was a timeout. The status code will tell you which one it is.
Alex
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #40 on: April 19, 2016, 11:13:28 am »
i got it..thank u
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #41 on: April 20, 2016, 11:35:09 am »
i have a problem.when i continuously transmit form one side and receive on the another the data transfer stops aftr some time...
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #42 on: April 20, 2016, 03:05:43 pm »
Not enough information.  You will have to do some debugging and tell me more if you actually want help and not just complaining.
Alex
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #43 on: April 21, 2016, 05:17:01 am »
I am transmitting data of 100 bytes form one side and after getting callback appdataconf sending another 100 bytes data...this way i am continuously transmitting data.after some time program hangs.i have set controller frequency 25 Mhz.I have enable dynamic frame buffer protection.what happens if i increse NWK_BUFFER_AMOUNT ?
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #44 on: April 21, 2016, 04:06:51 pm »
after some time program hangs.
Hangs in what state? Confirmation is never returned? Can you publish the code you are using?

i have set controller frequency 25 Mhz.
What's the SPI clock frequency?

what happens if i increse NWK_BUFFER_AMOUNT ?
Stack will work better with large networks.
Alex
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #45 on: April 22, 2016, 05:18:47 am »
it hangs in  phyState=PHY_STATE_TX_WAIT_END
and last transmitted frame state=NWK_TX_STATE_WAIT_CONF
after that no conformation callback is received..
my spi clk frequency is 6.25Mhz.
moreover i have set data rate 2Mbps
while (1)
  {
    
   sys_TaskHandler();
      
    if(flag==0) //initially zero
         {
            
            HAL_UART_Receive_IT(&huart3,&data[0],5); //uart receiver enable
        flag=1;            
         }
      else if(flag==1)
      {
         
            if(huart3.RxXferCount==0)
            {
               flag=2; //if  something received from uart
            
            }
      }
    else if(flag==2)
      {
       if(ack_flag==0) //first tym it is zero
       {
       appSendData(&data1[0],100); //sending data i have changed this function as below
       ack_flag=1;
       }
      else if(ack_flag==2) //if callback function is called
       {
       ack_flag=0;
       }
      
      }
void appDataConf(NWK_DataReq_t *req) //this is called after successful transmission
{
 
 
    ack_flag=2;
 
 
  (void)req;  //this parameter is unused to shut up the warning
}




void appSendData(uint8_t* tx_data,uint8_t tx_size)
{
  appDataReq.dstAddr =0x01;
  appDataReq.dstEndpoint = APP_ENDPOINT;
  appDataReq.srcEndpoint = APP_ENDPOINT;
  appDataReq.options = NWK_OPT_ACK_REQUEST;
  appDataReq.data = tx_data;
  appDataReq.size =tx_size;
  appDataReq.confirm = appDataConf;
  NWK_DataReq(&appDataReq);


}

 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #46 on: April 22, 2016, 09:19:39 am »
it hangs in  phyState=PHY_STATE_TX_WAIT_END
It looks like a SPI communication issue or your SLP_TR pulse is not wide enough.

my spi clk frequency is 6.25Mhz.
Have you verified this in any way? Frequency meter or oscilloscope?

moreover i have set data rate 2Mbps
It should not affect anything here, but I would debug with default settings.
Alex
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #47 on: April 22, 2016, 10:11:55 am »
i have put one variable that counts howmany tym irq status regi gives tx complete.where my program hangs it shows that for the last frame irg status register is not showing any tx complete...
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #48 on: April 22, 2016, 04:30:25 pm »
You have not answered any of my questions.
Alex
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #49 on: April 23, 2016, 06:30:44 am »
my spi clk frequency is ok..I have increased slp_tr pulse width.
but problem is same.
how much pulse width is necessary for slp_tr?


 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #50 on: April 23, 2016, 06:33:17 am »
how much pulse width is necessary for slp_tr?
It is all in the datasheet.

There is no way for me to tell what may be wrong. Read the state register when this happens and check what state the radio is in. This may set a proper direction for debugging.
Alex
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #51 on: April 26, 2016, 07:23:15 am »
hii
i am currently using interrupt at physical layer.means phyhandler is in my ieq handler.
In my setup i have placed this modules side by side and send them data one by one (when conformation callback of one comes send data to other )at some time when i send data to dome dest addrs like 0x04, other device keep routing but that perticular device is not responding.status regi shows  TRAC_STATUS_SUCCESS.is there any deadlock happenes?
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #52 on: April 26, 2016, 07:26:26 am »
hii
i am currently using interrupt at physical layer.means phyhandler is in my ieq handler.
In my setup i have placed this modules side by side and send them data one by one (when conformation callback of one comes send data to other )at some time when i send data to dome dest addrs like 0x04, other device keep routing but that perticular device is not responding.status regi shows  TRAC_STATUS_SUCCESS.is there any deadlock happenes?

I have no idea what you just described. You need to be more specific.

In general, routing on high level is not directly related to sending individual frames and their status.

And what do you mean by "keeps routing"? And what addressed your devices have?
Alex
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #53 on: April 26, 2016, 08:36:44 am »
my devices have addresses like 1,2,3,4,5,6,7.
I am sending data from 1 to 2,3,4,5,6,7 continuously one after another.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: Atmel transceiver (RF212B) communication using microcontroller SAM D21
« Reply #54 on: April 26, 2016, 04:18:21 pm »
Ok, I'm not going to reply anymore unless you start fully describing what you are doing and write all the observed results.  And respond to all my questions.

Alex
 

Offline kavita

  • Contributor
  • Posts: 27
  • Country: in
ohh that one buffer overflow causes hard fault..
i am transmitting data from one device to another.
but last byte of data recived if different than data transmitted.
i have enabled fcs and frame buffer safe mode
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf