Arduino Project Hub
Project in progress

Arduino Due: Micropython Enabled © MIT

Ease of Python programming on the powerful Arduino Due.

  • 4 views
  • 0 comments
  • 0 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 32bit microcontroller introduced in 2013. It has 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. Goto 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 stays in 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 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 Bluetooth Interfacing

Project tutorial by ADAM PHILIP

  • 1,128 views
  • 4 comments
  • 17 respects

Arduino Traffic light controller

by ADAM PHILIP

  • 515 views
  • 0 comments
  • 10 respects

Arduino alarm system

by ADAM PHILIP

  • 662 views
  • 0 comments
  • 12 respects

NeoMatrix Arduino Pong

Project tutorial by Arduino “having11” Guy

  • 636 views
  • 0 comments
  • 10 respects

Spideruino

Project showcase by JulienChateau

  • 2,979 views
  • 5 comments
  • 25 respects

Valentine's Sunflower

Project tutorial by circuito.io team

  • 1,017 views
  • 4 comments
  • 9 respects
Add projectSign up / Login