Use Arduino Zero to programm extern M0-Cortex Chip via SWD? / Powerconsumtion?

Hello,

is it possible to program an external M0-Cortex Chip via the Arduino Zero (like using an UNO to program an external ATMEGA328 Chip)?

If yes, what needs to be done (jumper or cut some wire)?
And which Chip does it have to be, exactly the same (ATSAMD21G18)?

And a final question beside, how much power does the Zero consume roughly? I guess there will be Power-on and Sleep modes?

(Background: I would like to use a single M0-Cortex Chip for a MPP-Solar-Charger with PWM in progress, but 90% of the time sleeping. I guess the PWM frequency will be much more than in an UNO/MEGA!?)

Thank you very much! :slight_smile:

I would also be intersted to know if it is possible to programm the M0 with another CPU, 328p or any else.

A way to program the SAMD21 may be through the UART (pins 0 and 1).

The sam-ba bootloader allows programming via UART if the native USB port is not connected to a PC (otherwise if the USB is enumerated the sam-ba bootloader switches to "USB-CDC mode" and ignores UART). The "external programmer" (an atmega or another samd or whatever else) must talk the sam-ba protocol over serial port, you can see how is implemented in bossac, it's fairly simple I guess that the most difficult part is the XModem protocol to transfer blocks of data.

To let the CPU enter into bootloader you can use the double-tap reset: just reset the chip twice within 500ms (by driving the RESET pin of the CPU).

About the power consumption you should have a look to the SAMD21 datasheet chapter 36.6.
The value depends on sleep mode of the CPU and the amount of devices active at the same time. If you do everything right you can go down to the 10 micro-ampere range in STANDBY, BTW this requires really good hardware/software skills to be achieved.

About the Arduino Zero Board, here you can find a small writing about board power consumption: