Skip to content

OlivierLD/small-boards

Repository files navigation

Small Boards (MicroControllers)

We will talk here about the way to develop code for those small PCBs, as well as about the different ways to communicate with them, from other machines.

Several possibilities are available, among them:

  • Serial
  • I2C
    • About I2C, see how to use those small boards as I2C slaves here.
  • In some cases (i.e. when the PCB has WiFi capabilities), REST over HTTP, TCP, can be used too.

We will also talk - as a reminder - about the way to upload and run sketches on those boards. They do not all follow the same "protocol"...

Arduino Uno, Arduino Mini, ESP8266 (Huzzah), Adafruit Trinket, Photon, etc

Examples of code are provided in the sub-directories of this project.

Universal Serial Bus (USB)

Universal, but there are at least 3 versions: A, B, C..., and each one has several variants (normal, mini, micro,,,):

USBs

Install the Arduino IDE on the Raspberry PI

Note: The Arduino IDE is also available on other platforms (MacOS, Windows, many Linux distributions).

  • Go to arduino.cc -> Software
  • Download the last version for Linux ARM

Then (in 2017)

 $ cd ~/Downloads
 $ tar -xvf arduino-1.8.5-linuxarm.tar.xz
 $ sudo mv arduino-1.8.5 /opt
 $ cd /opt/arduino-1.8.5
 $ [sudo] ./install.sh

or, version 2:1.0.5

sudo apt-get update && sudo apt-get upgrade
sudo apt-get install arduino

Note : first approach (1.8.x) should be preferred.

A note for Mac users

Apple did it again, they messed with the USB and Serial ports... If the serial port your Arduino (or else) suddenly and un-expectedly disappears, try this.

Arduino Uno

Use a USB-A to USB-B (male-male) cable.

For Arduino Uno, use board Arduino/Genuino Uno.

Arduino Uno

Programmer: AVRISP mkII

Arduino Mini

Use a CP2104 connector, itself using a USB-A to USB-C (male-male) cable.

Arduino Mini

Programmer: AVRISP mkII

For Arduino Pro Mini, use board Arduino Pro or Pro Mini, Processor ATmega328P (3.3V, 8MHz), even for 5 volts version.

Arduino Nano (33 BLE Sense in my case)

Use a USB-A to USB-C (male-male) cable.

Programmer: AVRISP mkII.

SparkFun Edge

Cheap, TensorFlow compatible... Keep posted.

Keep an eye on what you need to connect, and to upload (Serial Basic, like CP2104)...

See here

ESP8266 (Adafruit Huzzah)

Programmer: AVRISP mkII.

In the Arduino IDE, got to File > Preferences, and add a URL in Boards Manager URLS:

 http://arduino.esp8266.com/stable/package_esp8266com_index.json

Connect the Huzzah to the Raspberry PI with an FTDI cable, make sure the black goes on the GND.

Huzzah

To upload a sketch:

  • press the GPIO0 button
  • press the Reset button
  • release the Reset button
  • release the GPIO0 button

The red led should be dimmed, the board is ready to receive the sketch, you can upload it from the IDE.

Note: The Adafruit Feather HUZZAH with ESP8266 has similar capabilities, but automatically uploads your sketches, you do not need to juggle with the GPIO0 and Reset buttons like above. It also does not require an FTDI cable, a regular USB (A to C) does the job. It's a very cool little board.

Adafruit 5v Trinket

Programmer: USBtinyISP.

In the Arduino IDE, got to File > Preferences, and add a URL in Boards Manager URLS:

 https://adafruit.github.io/arduino-board-index/package_adafruit_index.json

Use a USB-A to USB-C (male-male) cable.

Adafruit Trinket

To upload a sketch:

  • Press the button on the Trinket - verify you see the red LED pulse. This means it is ready to receive data.

See the Adafruit tutorial.

Photon

Use a USB-A to USB-C (male-male) cable.

Beside that, the Photon uses its own web-based IDE, at https://build.particle.io. The code is similar to what's used above. It also comes with a free access to an IoT server.

M5StickC

See http://m5edu.com/Product/m5stick-c-micro-core/

Very cool, and very cheap. Has wireless network access.

Adafruit Circuit Playground Express

Adafruit Clue

  • Use a USB-A to USB-C (male-male) cable.
  • See here

Raspberry Pi Pico

  • Programmable with Python and C.
  • Remarkably documented.
  • See here

Read a Serial Port


To keep an eye on...

About

Arduino, Huzzah, Feather, Trinket, et al.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published