Arduino Project Hub
Project in progress

Arduino Due: Micropython Enabled © MIT

Ease of Python programming on the powerful Arduino Due.

  • 678 views
  • 1 comment
  • 4 respects

Components and supplies

About this project

What is Micropython?

Micropython is a subset of Python 3 optimized for microcontrollers. You can learn more about Micropython here.

Why on Arduino Due?

Arduino Due is the first 32-bit microcontroller introduced in 2013. It has the powerful SAM3X8E chip which runs at 84 Mhz, 96KB of RAM, 512KB of flash memory and tons of extra I/O peripherals like CAN bus and dedicated DACs. This makes Due perfect for running Micropython.

[NOTE: The Micropython port on Arduino Due is still in BETA, so not all peripherals are currently supported. Go to Github repo for the current status of the project]

This is a step-by-step guide on how to flash & run Micropython on Arduino Due.

Step 1: Downloading necessary programs and libraries

  • You'll need ARM GCC Toolchain to compile source code. Go to this link to download & install Toolchain for your windows version.
  • You'll also need 'make' utility. You can also install it from MinGW project which is a collection of GNU utils for windows.
Alternatives: I highly recommend using cygwin because it's easy to setup, all your files stay in a single folder and you can use this script as CLI package manager.
  • PuTTY is required for serial communication.

Step 2: Installing drivers and setting up tools

  • Plug Due's 'Prorgramming port' to the PC.
  • Hold the Erase button for a second and release.
  • Windows should automatically install drivers and recognize device as 'Arduino Programming port'.

Step 3: Compiling micropython

  • Open command prompt/cygwin and cd into your micropython/atmel-sam3x folder.
  • Then type: make

It will compile the source code and create a bin file in /build folder.

Step 3: Flashing Micropython on the Arduino Due

  • Plug USB to PC and to Arduino Due's 'Programming port'
  • Once detected, go to control panel > Hardware and sound > device manager > ports and note the COM port number. In my case, it is COM8.
  • In the same folder (atmel-sam3x) type: make upload port=(your COM Port)

Flashing takes about 20-30 seconds to complete. After successful flashing the board will reboot itself.

Step 4: More driver installation

  • Now disconnect the board and plug it again but with 'Native port'.
  • Automatic driver installation will eventually fail.
  • In the device manager under ports section, you'll see:
  • Right click on CDC Virtual Com > Update driver software > browse computer > select the micropython/atmel-sam3x/drivers folder. After installation you'll see the following but with different COM port.

Step 5: Profit

  • Open PuTTY and click on Serial button and type your COM port enter speed 115200 and hit open.
  • You'll see a blank screen, just hit Ctrl + D and Voila!
  • type: help() to see what features board currently supports.

Type the following LED blink program in REPL:

>>>from machine import LED, time
>>>while True:
>>>    LED.toggle()
>>>    time.sleep_ms(500)

Comments

Similar projects you might like

Arduino 101 BLE App

Project in progress by Alexis Santiago Allende

  • 1,806 views
  • 12 comments
  • 23 respects

FM radio

Project tutorial by Patrick Müller

  • 8,171 views
  • 2 comments
  • 37 respects

SMART CUBE: A New Way to Control Your Home

Project tutorial by Alberto Sartori

  • 619 views
  • 0 comments
  • 5 respects

Arduino Digital Clock Version 2

Project showcase by John Wafik William

  • 581 views
  • 0 comments
  • 8 respects

Aquariumatic

Project in progress by Craig Hissett

  • 7,521 views
  • 2 comments
  • 17 respects

Avoid Injuries with Smart Backpack

Project tutorial by Chathuranga Liyanage

  • 969 views
  • 2 comments
  • 12 respects
Add projectSign up / Login