Author Topic: Using the SAMD10 Xplained Mini dev board as a bootloader for a SAMD10 proejct  (Read 1542 times)

0 Members and 1 Guest are viewing this topic.

Offline WOOK.ltdTopic starter

  • Newbie
  • Posts: 6
  • Country: au
Hello everyone,

I would like to use the ATSAMD10D14A in a project however I am confused on how to program the microcontroller. What I can gather from the datasheet is that you need to interact with SWCLK, SWDIO and RESET signals on PA30, PA31 and PA28 pins to program the controller (6.2.2 Serial Wire Debug Interface Pinout - SAM D10 Datasheet).

The SAM D10 Xplained Mini development board uses an ATmega32U4 as a hardware bootloader to program the onboard SAMD10 controller. The user guide for this board talks about using an external programmer to program the onboard SAMD10 microcontroller (2.2.5. Target Programming - SAM D10 Xplained User Guide). The header used to connect an external programmer connects to the same pins that the ATmega32U4 uses (PA30, PA31 and PA28). Therefore, I was thinking would I be able to use this header to program an external SAMD10 microcontroller on another board? It would also program the SAMD10 on the dev board as well.

In other words, is it possible to program two of the same microcontrollers from the one bootloader (one on the dev board and one in my project)?

As you can probably tell I am quite new to this, but any help will be greatly appreciated.

Thanks in advanced,
Will
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11228
  • Country: us
    • Personal site
Your question is not very clear. You can't program two SAM D10s from the same ATmega32U4 at the same time. But if you remove the D10 from the Xpro board, you can use Xpro board as a programmer for  external devices.

At the same time you can use the SWD connector to program the D10 on the Xpro from an external programmer. On board ATmega32U4 will be fine with that.

So if I understand your question correctly, you can turn the Xpro into the programmer if you remove the D10 chip from it.
Alex
 
The following users thanked this post: WOOK.ltd

Offline WOOK.ltdTopic starter

  • Newbie
  • Posts: 6
  • Country: au
Thanks for the reply,

I'd prefer not to pull apart my development board to program the SAM D10, however the only other solution I've found is to purchase an Atmel-ICE but they're quite expensive. Do you know of any any other options?
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11228
  • Country: us
    • Personal site
That depends. If you want to use Atmel Studio, then Atmel-ICE is the best tool. And PCBA version is $50.

I sell a cheap SWD programmer here https://www.tindie.com/products/ataradov/cmsis-dap-compliant-swd-debugger/

But shipping is probably going to be too expensive.

With some effort you cam make your own programmer using Arduino. It is doable, but not trivial.
Alex
 
The following users thanked this post: WOOK.ltd

Offline cv007

  • Frequent Contributor
  • **
  • Posts: 822
Quote
I'd prefer not to pull apart my development board to program the SAM D10
One level down from 'pulling apart', is to just get at the sw lines of interest- the swclk, swdio and reset all have resistors in their path from the 32u4 so can be isolated. I'm not certain, but maybe just removing the swclk resistor, solder a wire on both pads to a spdt switch (in->sp, dt->on board, ext)- used to switch the swclk from either going to the on board sam or to an external sam. Probably won't look pretty, but we are talking about a $9 board that is meant to be used.

Or buy another $9 sam d10 mini board, remove the sam (or cut the traces close to the sam as needed) and use the swd connector- one development board, one dedicated programmer.

edit- a 3 pin header with a shunt would work just as good as a switch for selecting int/ext.
remove swclk resistor
mount 3 pin header
2 wires from resistor pads
cut trace near swd connector (bottom layer)
wire from 3 pin header to swd connector (bottom layer)
use shunt to select internal or external target
see attached picture

edit again-
I assumed the swd connector was populated, but I guess its not, so you could instead create your own 5 pin header (100mil) on the board close to that connector (vcc, gnd, A,B,C)- just connect to the 2 needed pins on the swd footprint (no need to cut swdclk trace), and 1 from the 3 pin header. It may be easier to deal with the standard header size, without having to populate that swd connector (50mil spacing).
« Last Edit: December 05, 2018, 07:46:28 am by cv007 »
 
The following users thanked this post: WOOK.ltd

Offline WOOK.ltdTopic starter

  • Newbie
  • Posts: 6
  • Country: au
Thanks for the detailed response. I'll give it a go, I just have to wait for the board to arrive.

Also, would this only work for programming SAMD10 chips or would I be able to use it on other Atmel microcontrollers in the future?
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11228
  • Country: us
    • Personal site
All ARM based devices should work, but you will have to select an option to show incompatible devices in the AS.

But keep in mind that mEDBG is pretty slow, so 8f you are going to do this for real, better 8nvest in a good tool.
Alex
 
The following users thanked this post: WOOK.ltd


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf