Skip to content

Setting up Blend Micro board

LingQL edited this page Sep 30, 2016 · 5 revisions

The information below are all taken from Red Bear Lab Blend Microwebsite

##Software Checklist

  1. Arduino IDE version 1.0.5

  2. Nordic Bluetooth low energy SDK for Arduino beta version 0.9.0
    download library / [source code] (https://github.com/NordicSemiconductor/ble-sdk-arduino)

  3. RedBearLab nRF8001 Library version 20140701
    download library / source code

  4. RedBearLab Blend Add-On version 20140701
    download library / source code

##Arduino IDE Setup (first time only)

An Add-On is required in order for the Arduino IDE to support your Blend Micro, please follow the steps below:

  1. Before install the Add-On package, you should not be able to see the Blend Micro board
  2. Check your "Sketchbook location" in Arduino IDE (it is for storing Arduino support files), go to menu File > Preferences... (on Mac OSX, go to menu Arduino > Preferences...)
  3. Exit/Quit Arduino IDE
  4. Navigate to your Sketchbook folder (e.g. C:\Users\Documents\Arduino), it should be empty or contains a folder named "libraries"
  5. Unzip the "RedBearLab Blend Add-On" package and copy the "hardware" folder (inside "Arduino" folder) to your Sketchbook folder
  6. Locate "main.cpp" in your Arduino IDE folder
    *Windows
    Arduino IDE folder > hardware > arduino > cores > arduino > main.cp
    *Mac OSX
    Ctrl-Click/Right-Click the Arduino.app file and choose Show Package Contents
    Contents > Resources > Java > hardware > arduino > cores > arduino > main.cpp
  7. Replace it with the "main.cpp" from the "RedBearLab Blend Add-On" package. You could modify the file yourself, see below.
  8. Re-start the Arduino IDE and two (2) Blend Micro boards should be available
  9. You can also modify the “main.cpp” manually by adding the following code before "setup()".
#if defined(BLEND_MICRO_8MHZ)
    // As the F_CPU = 8000000UL, the USB core make the PLLCSR = 0x02
    // But the external xtal is 16000000Hz, so correct it here.
    PLLCSR |= 0x10;             // Need 16 MHz xtal
    while (!(PLLCSR & (1<<PLOCK)));     // wait for lock pll
#elif defined(BLEND_MICRO_16MHZ)
    // The CPU clock in bootloader is 8MHz, change to 16MHz for sketches to run (i.e. overclock running at 3.3v).
    CLKPR = 0x80;
    CLKPR = 0;
#endif

This code is to set the USB and CPU clock as it is running at 8 MHz with 3.3v but the external crystal is 16 MHz, so need to adjust the USB to run correctly.

Clone this wiki locally