The line of distinction between microcontroller and computer continues to blur. Although our mind and language struggles to define what is and isn't a computer, the definition must be left for the dictionary. No matter the word used, the main objective shall be to understand: Does this direction of progress actually simplify and accelerate development?

cyberDÛCK: A baby, waddling step toward flexible, low-cost, fully self-contained portable prototyping rig that you can program on the fly!

Key features:

  • USB Keyboard input (now handles long key presses)
  • Display for showing output
  • A text editor for creating and editing python code
  • A "REPL"-like command line for entering python commands (to edit file, run file, etc.)
  • Duck-shaped

Primary Outcome: Demonstrate a computer using CircuitPython

Secondary Outcome: Show what is possible so that new features might get integrated into simpler hardware designs and software hooks (e.g. Bluetooth Low Energy keyboard input)

Who is this for: Anyone that wants a self-contained, portable, prototyping computer running CircuitPython that’s in the form of a hinged duck

Use cases: This could be useful as a part of ultraportable microcontroller electronics prototyping kit

Strategy

As a prototype, the objective of this project is to hack together something that can demonstrate the concept.  It is deliberately taking bits and pieces from others and using glue, Fun-Tak, feathers and bailing wire to make it work.  

  • Use a co-processor to take input from a USB keyboard (Arduino-based USB Host for SAMD with software modified from code by gdsports)
  • Transmit keyboard input to main processor using UART
  • Use a "REPL-interceptor" to allow text input from UART to control the command execution of python input from the keyboard
  • Adapt a text editor MicroPython-editor (pye) from robert-hh to run on a CircuitPython Board with attached display. This will edit files by taking input from UART and output to the attached display.  File storage is using on-board non-volatile memory or a memory card

Project outline

  • Background
  • Objectives/Strategy: A stand-alone programmable on the fly CircuitPython entity and the conceptual chucks of stuff needed to get there
  • USB Host controller: Keyboard to UART input controller (run with Arduino) with a hack for handling directional arrow keys; uses USB on-the-go (OTG) cable 
  • REPL-interceptor: this takes input from UART to run (exec) python text commands
  • Editor: modified MicroPython-editor (pye) to use UART input and SPI connected display 
  • Bill of Materials and Mechanical design: duck-shape, of course
  • Next steps
  • The original Inspiration: the things that are major steps toward this goal, and some fun stuff

Background

The advent of MicroPython and CircuitPython has streamlined quick prototyping of microcontrollers.  However, to date the programming of microcontrollers has been tethered to a computer. In the case of Arduino programming, we require a compiler to create, compile and download the code. CircuitPython along with the extremely helpful mu editor has now eliminated the "compile" step of the process, by downloading the .py file directly onto the microcontroller as if it were a USB memory stick. Also, inclusion of the python REPL speeds up debugging of the python code. 

All of these advancements combined have streamlined and simplified the process from idea conception to hardware demonstration.

However, the "computer" tether remains.  Currently the stdout print() statements are mirrored to a serial connection that is displayed on the computer. As of about CircuitPython version 4, the stdout and REPL display can now be directed to a connected display. This is yet another advancement toward a full "computer" using CircuitPython.  The final remaining barrier is to provide software input to the microcontroller...

Read more »