SAMR21 Radio not answering

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey!

 

I'm trying to get lightweight mesh to work on my board but I'm failing to get past PHY_Init because it seems that SERCOM4 has no dataflow. If I singlestep through the code and look at the appropriate I/O view I don't see any data on Data register for some reason. I'm running a R21 xplained (changed the device to represent my SAMR21E17, but that should not matter as the internal connections should be exactly the same to the AT86RF233 radio module.

 

At the moment I don't have any external clock elements and all clock configuration happens as it is in the demo application (tried with peer2peer).

 

Any suggestion on what I should try? Can't throw a scope on the SPI lines either for obvious reasons.

 

-Rain-

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't really know what issues you could be getting right now. But I would recommend a few minor things. I have seen issues when chnaging chips, even when changing from like a D20J to D20E. Some libraries go a little funny and you can see the D20J definition in the project file symbols, or includes (forgot which one). That was a bug in AS7 from what I have seen. Open up the project file with your favourite text editor and check the for definitions of your old chip.

 

Another thing that might be possible is that you have not enabled the clock for the R21E, have a look in your config/conf_clocks.h file (if this asf implementation is being used) and enable the appropriate clock.

 

Hope this helps.

 

Ryan.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, thanks for the answer.

 

All that I can see in peer2peer example project regarding clock is that it disables the internal OSC8 prescaler. If I look at the registers in debug mode I can see that OSC8 is enabled with no prescaler and also OSC32 is enabled.

 

I'll take a look at the headers aswell but at the moment only CPU related header file I can see is SAMD21J18a.h. I thought that maybe it's the processor part in the R21 SOC, but could not find any information in the datasheet about it.

 

-Rain-

Last Edited: Thu. Apr 21, 2016 - 09:25 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Tried copying SERCOM1 setup that has a working SPI interface to a flash generated by atmel Start to SERCOM4 with appropriate pin controls but still no dice. I can see CS going low etc but all registries I'm reading are read back as 0.

 

SPI workflow:

1.Init SPI

2.CS low

3.Send 0x8D (0x1D [version nr, should be 2] + MSB to read register)

4.Read

5.CS high

 

I'll also add the register values from debug:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not sure mate, might be time to have a look over on the AT91 forums, they are a lot more active with the arm related queries.

 

Maybe just crawling their forums you could find the answer!

 

Good luck!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey!

 

Just as an update to anyone interested. The radio is relying on the XTAL being connected. Pushed 5MHz in the XTAL1 and got an answer from the SPI lines.

 

One learns every day :)

 

Anyway, thanks for help and thinking with me.

 

-Rain-