ATSAMD21-XPRO to start with ARM microcontrollers

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

I would like to migrate from AVR to ARM microcontrollers. I'm thinking to buy an ATSAMD21-XPRO board from Microchip for 18 euros without VAT. It is a cortex M0+ evaluation board to start with. Do you think it is a nice choice to start with ARM microcontrollers?

 

     Thanks in advance.

Last Edited: Fri. Nov 24, 2017 - 02:57 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

saik wrote:
Do you think it is a nice choice to start with ARM microcontrollers?

Yes!

 

laugh

 

Just picking one of very many posts at random: https://community.atmel.com/comme...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

saik wrote:
Do you think it is a nice choice to start with ARM microcontrollers?

Yes, yes!

laughlaugh

 

The main advantage IMO is that with one USB cable to your PC you're up and running, with an on-chip debugger (which is invaluable).

 

One alternative is to go for the SAMD20 Xplained: You obviously lose some peripherals that the D20 lacks: Application USB functionality (USB for programming/debugging is still there), advanced timers.. You gain a header on the D20 Xplained board to "break out" the programmer/debugger to a custom board. Unless you know you're going in this direction soon then the D21 is the better choice IMO.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

If You aren't strongly Microchip oriented, You can buy one from the STM342 Discovery boards. They are cheap (from under 10 €), with the on board debugger, quite good free software and with many tutorials for beginners available in net.

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

Given that this is Atmel's forum, it's not really the place to suggest non-Atmel products - especially direct competitor's  products!

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JohanEkdahl wrote:
The main advantage IMO is that with one USB cable to your PC you're up and running, with an on-chip debugger (which is invaluable).

Absolutely!

And not just the debugger; with that one USB cable to your PC, you also get:

  • Power to the board;
  • A serial port;
  • Atmel Studio will immediately recognise the board, and show you the ready-made examples specifically for the board;
  • Data Gateway Interface (DGI): http://www.atmel.com/webdoc/dv/c...

The last one is a bit of an "advanced topic" - probably no need to worry about it just now. 

 

Of course, as awit suggested, other manufacturers do have similar products (in fact, Atmel were quite late to catch on) - but this is not the place for discussing competitor's products!

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I find the Cortex M0 cpu to be a bit depressing from a "learn ARM" perspective (it's "THUMB-only", so a lot of typical ARM instructions have unusual limitation or are not present at all.)  A CM3 or CM4 product would be nicer (adds THUMB-2, at least.)

OTOH, it IS the family aimed at replacing 8bit microcontrollers, the SAMD21 is pretty popular, the Xplained-pro boards are pretty nice, and 18 Euros is an excellent price.

 

 

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

But, unless you're writing extensively in ASM, those things are going to be (almost) invisible.

 

As has been said many times before, most of this has nothing to do with whether the core is AVR or ARM or whatever. The important stuff is how to deal with peripherals, interrupts, etc - which has very little (if anything) to do with the core.

 

See: https://www.avrfreaks.net/comment...

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

westfw wrote:
I find the Cortex M0 cpu to be a bit depressing from a "learn ARM" perspective (it's "THUMB-only", so a lot of typical ARM instructions have unusual limitation or are not present at all.)

I have been dabbling to and fro with the Cortex-M0's for half a year or so now. I have yet to be affected by the instruction set/repertoire.

 

These "learn ARM" discussions are a bit strange methinks. IMO, the big bend in the learning curve is not the processor architecture and instruction set but these two

 

  • System Peripherals. E.g. the interrupt controller, the clock system etc. These are designed in by ARM so I expect these to be identical/similar if moving to other brand of Cortex-M0s.
  • Peripherals. The digital ports/pins, USARTS, Timers, ADCs and DACs etc.. Will definitively be different, requiring a re-learn, when moving from one brand to another.

 

Unless the plan is to code in assembler, the point of knowing it is for understanding generated code, right? In that perspective I can not see a disadvantage with the instruction set being limited/cut-down. It might even be seen a an advantage!

 

Re the instruction set it seems a lot of it is similar to other sets. The thing that was somewhat exotic for me is how subroutine calls/returns are handled. The most recent return address is not on the top of the stack but in a "link" CPU register, and you do a "jump with link" rather than a "call with push". But again that is of no concern when coding in C (until you need to look at the generated code).

 

So far I estimate that 90% of my dabblings has been struggles with the peripherals. The remaining 10% has gone to toolchain stuff, and the specific D20/D21 Xplained boards. Everything SAM specific, nothing ARM generic.

 

I am using other peoples stuff [1] for startup code, which is where I suppose a lot of ARM-generic stuff is. When I get into that I expect things to change somewhat since that will involve more of "ARM generics".

 


 

[1]  mcu-starter-projects by Alex Taradov.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

Last Edited: Tue. Nov 28, 2017 - 10:32 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wot he said - absolutely!!

 

 

EDIT

 

Cross-ref: https://www.avrfreaks.net/commen...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Thu. Mar 29, 2018 - 10:21 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

unless you're writing extensively in ASM, those things are going to be (almost) invisible.

  [the important thing to learn is] not the processor architecture and instruction set but [system and vendor peripherals]

 

Yes, I mostly agree.  Which is why I used the term "depressing" for CM0 architecture rather than a more derogatory term. :-)

 

Still, there's a tendency for code to use features (division, bitfields) under the assumption that they're relatively cheap to implement, and it can be a bit of a shock to have that not be the case.)  (or, I guess, it usually works the other way around - an embedded 8bit programmer will by habit AVOID certain features, and part of the "move-to-32bits" should be un-learning some of those habits.  IMNSHO, a CM0 is ... less rewarding of such changes... than it ought to be.)

 

 

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

westfw wrote:
an embedded 8bit programmer will by habit AVOID certain features, and part of the "move-to-32bits" should be un-learning some of those habits.

An important habit to unlearn is the "always use the smallest sized variable" habit - on a 32-bitter that may actually cost you!

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...