Home

Awesome

GpioTwiddler

This is a simple Nerves application for the BeagleBone Black that is used to measure the performance of various ways of toggling a GPIO. This is useful to demonstrate tradeoffs and set expectations for performance in real applications.

Please, please realize that many of the options compared are not identical. While they all toggle a GPIO, some are platform dependent, require the Erlang VM to run as root, run the risk of crashing the VM, can't support other GPIO features (like notification when an input changes), or require C coding. TL;DR: The more of these issues or limitations you can put up with, the faster things go. Old 16 MHz 8-bit microcontrollers are better suited to some tasks.

Naming

Data for each experiment is named with the following convention:

kernel_erlang_work_test.csv

kernel is one of the following:

erlang is one of the following:

work is one of the following:

test is one of the following:

The filename arduino-uno-r3 is for captures using an Arduino Uno R3 running the code in arduino/twiddle_fast.

Results

Results

Replicating the results

Assuming that you have a BeagleBone Black, run through the Nerves installation guide to set up your system.

Build an SDCard image by running:

mix deps.get
mix firmware

Then insert a MicroSD card into a reader on your computer and run mix firmware.burn. After burning the MicroSD card, place it in the BBB and boot. You'll be presented with an Elixir shell prompt on the serial port. All tests toggle Pin 12 on connector P9 on the BBB. Hook up a logic analyzer to measure this. See the individual modules for tests, but you can try one or more of the following: