Differences?? SAMD20 and SAMD21

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

Bored to death here! After cataract surgery and being stuck at home for a week I'm considering re activating my FB account or search out for a local drug dealer.......

 

But I opted to mess around with the SAM boards I got from Atmel a while ago instead.

 

So the boards both have 64 pin devices with 256K of flash but the SAMD21 board has an additional USB connector, the USB seems to be the main differences between the 2 chips from a one eyed look at the datasheets.

 

Anything else that I should be aware of? The aim at the moment is to start with the usual flashing led and then port my AVR GLCD touch code to one of the boards, nothing too complicated. sad

 

I have already ported the above code to the NXP LPCwhatever M0 chip  a couple of years ago so It should be a piece of cake, yellow cake that is.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

Last Edited: Wed. Mar 1, 2017 - 02:41 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

There are a few others that I came across while porting a couple of times from D21 to D20 and back to D21.
- D21 has TCC timers
- D21 has DPLL
- Some registers are different, in particular the ones that have to do with synchronization
- Smaller D21 models have a Device Variant B with an RWWEE section for EEPROM emulation which might be a big deal if you don't want your application to get stalled for a few ms.

Last Edited: Wed. Mar 1, 2017 - 03:03 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So plugged in the D21 board, drivers were installed, started Studio and it sees the board, did something silly...Studio not responding...send report to M$? OF course. angry

Many minutes later it is still at 25% sending? Sending what? The history of mankind since the beginning of time??

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Installed packs and now CMSIS however there seems to be a hiccup. I'll persevere. Meanwhile we are up to 76% sending error report, it must have started sending the above history from BEFORE the beginning of time.

 

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

OK giving up for now, no cigar with CMSIS for some reason, other updated packs installed including the SAMD21. Posting on the Studio forum for someone's guidance on what's going wrong.

And why are things now under Apache license? What if Sioux, Cheyenne or other tribes want to use those packs? cheeky

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

So a case of a loose nut behind the keyboard. blush https://community.atmel.com/comm...

 

Got the flashing led example from START working, changed the flash rate to 100ms and it still works!

 

And why is the ARM forum post screen different from the AVR forum? Need to put 2 CR in order to put a line between paragraphs.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

... Also, Amazon web services had an outage last night Norway time, so at least some of our servers were inaccessible for a couple of hours...

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

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

haha maybe not just the loose nut behind the keyboard after all.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

How EXCITING! My first MANUAL flashing LED program, anyone can do the automatic version. I would have loved to use the CODE button but it doesn't work here (cannot paste).

 

/*
 * GccApplication1.c
 *
 * Created: 1/03/2017 6:14:37 PM
 * Author : John Samperi
 */

#include "sam.h"

//#include <hal_delay.h>

int main(void)
{
    /* Initialize the SAM system */
    SystemInit();
    
    REG_PORT_DIRSET0 = 0xFFFF;    //PORTA for some reason, go figgure!
    REG_PORT_DIRSET1 = 0xFFFF;    //PORTB for some reason, go figgure!    
    
    /* Replace with your application code */
    while (1)
    {
    //    REG_PORT_OUTSET0 =  0xFFFF;
    //    delayms(500);
    //    REG_PORT_OUTCLR0 =  0xFFFF;
    //    delay_ms(500);
    
        REG_PORT_OUTSET1 =  0xFFFF;
    //    delayms(500);
        REG_PORT_OUTCLR1 =  0xFFFF;
    //    delay_ms(500);
    
    }
}

all that is required to flash the LEDs (up to 16) is a computer and AS7 running in single step mode (F11) and finger action.

 

I tried to figure out where a suitable delay function is located but all I could find is the one in START and don't want to use it.

 

So I can get 16 bits contiguously on PORTB?? (group1) great for 16 bit mode GLCD and some other bits on PORTA (group0) for control on the Xplain board, all it took is many hours trying to understand what magic words had to be conjured up to access the ports without gimmick. Thanks to Phil for the unrelated hint https://community.atmel.com/foru...

 

 

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

I'm having the same problem installing CMSIS 4.2. How exactly did you fix this? I'm not sure how to install the ARM compiler.

Thanks

 

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

I'm not sure how to install the ARM compiler.

By using the Studio installer, just check the ARM box during install/repair and everything you need will be installed.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

js wrote:
the USB seems to be the main differences between the 2 chips from a one eyed look at the datasheets.

 

Anything else that I should be aware of?

It seems that the flash is different (not just in size):

https://community.atmel.com/comm...

 

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...