Project in progress

Arduino Due: Micropython Enabled © MIT

Ease of Python programming on the powerful Arduino Due.

  • 2,242 views
  • 1 comment
  • 8 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 'Programming 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

Relativ - Build Your Own VR Headset for $100

Project showcase by Relativty

  • 6,886 views
  • 2 comments
  • 10 respects

A DIY Smart Insole to Check Your Pressure Distribution

Project tutorial by Juliette van der Pas

  • 1,859 views
  • 8 comments
  • 18 respects

Arduino LIDAR

Project tutorial by abhinav

  • 15,439 views
  • 4 comments
  • 28 respects

VU Meter on Steroids: Arduino Nano and WS2812Bs

Project in progress by WannaDuino

  • 4,735 views
  • 15 comments
  • 17 respects

Sprout: Modern Indoor Self Watering Planter

Project tutorial by Jonathan Pereira

  • 4,806 views
  • 4 comments
  • 25 respects

Arduino Mega Chess

Project showcase by Sergey_Urusov

  • 4,769 views
  • 14 comments
  • 28 respects
Add projectSign up / Login