-
Notifications
You must be signed in to change notification settings - Fork 0
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
-
Arduino IDE version 1.0.5
-
Nordic Bluetooth low energy SDK for Arduino beta version 0.9.0
download library / [source code] (https://github.com/NordicSemiconductor/ble-sdk-arduino) -
RedBearLab nRF8001 Library version 20140701
download library / source code -
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:
- Before install the Add-On package, you should not be able to see the Blend Micro board
- 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...)
- Exit/Quit Arduino IDE
- Navigate to your Sketchbook folder (e.g. C:\Users\Documents\Arduino), it should be empty or contains a folder named "libraries"
- Unzip the "RedBearLab Blend Add-On" package and copy the "hardware" folder (inside "Arduino" folder) to your Sketchbook folder
- 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 - Replace it with the "main.cpp" from the "RedBearLab Blend Add-On" package. You could modify the file yourself, see below.
- Re-start the Arduino IDE and two (2) Blend Micro boards should be available
- 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.