Skip to content

firmware

Patrick Dowling edited this page Apr 26, 2016 · 52 revisions

NB: The following instructions refer to the extended ornaments and crimes firmware.

  • There are two ways of getting the firmware onto your module:
    • Method A: upload a pre-compiled HEX file - this is easy and quick. or
    • Method B: install the Arduino IDE and the Teensyduino add-on and compile the code yourself. this option is required if you wanted to hack the code, etc.
  • either way, you'll need:
    • a micro usb cable.
    • NB: the following steps assume that you have cut the usb trace. see here.

method A: uploading the HEX file

step 1): install the Teensy Loader program

step 2): download the binary HEX file

step 3): open the HEX file in the Teensy Loader

  • open the HEX file in the Teensy Loader application
  • make sure a USB cable is connected to the Teensy, and that the O+C module is powered up
  • press the program push switch on the Teensy board (on the back of the O+C module)
  • click the Program icon, or choose Program from the Operation menu in Teensy Loader
    • you should briefly see a progress bar as the firmware is uploaded
  • click the reboot icon or chose Operation | Reboot
  • your O+C should come to life
  • proceed to Calibration

method B: compiling the firmware:

step 1): get the IDE

  • if you don’t have it already, you need to install the arduino IDE as well as the teensyduino add-on. Make sure you install the latest versions. (at the time of writing, that's arduino 1.6.8 and teensyduino 1.28, respectively).

step 2): install libraries

  • you then may have to install two additional libraries (if you don't have them already): spi4teensy (here) and ADC (here).

  • clone them (with git) or download the zip, put them in your libraries folder, and restart the arduino IDE.

step 3): overclock

  • now, prepare to overclock. (overclocking is required to increase the SPI clock to 30MHz / make the firmware run properly).

  • to do so, find the file called boards.txt. on OSX, it lives in your Arduino.app folder:

    /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/boards.txt

  • (the path will be slightly different on linux or windows systems, of course).

  • now, uncomment the line that says:

    teensy31.menu.speed.120opt=120 MHz optimized (overclock)

  • (while you're at it, you may also want to change the optimization level: -o2)

    teensy31.menu.speed.120opt.build.flags.optimize=-O2

step 4): clone or download the firmware source code repository to your computer

  • clone from https://github.com/patrickdowling/O_C
  • use the master branch (which is the default) - the master branch contains the latest "production" released code
  • the develop and other branches contain bleeding-edge code which may or may not contain bugs

step 5): compile

  • once the libraries and the source code for Ornaments and Crimes are in place, you should be able to compile the Ornaments & Crimes firmware. Open the file called o_c_REV.ino. now make sure you:

    - 1) select teensy 3.2/3.1 in `Tools>Board`. and 
    - 2) select '120MHz optimzed (overclock)' in `Tools>CPU Speed`.
    
  • things should look somewhat like this:

    pix

  • compile. and download to your board (since you've cut the usb trace, the module needs to be powered from your eurorack PSU): the display should come to life now.

  • proceed to Calibration