BlueFruit LE and Arduino Micro?

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
lootKit
 
Posts: 11
Joined: Tue Apr 29, 2014 1:26 pm

BlueFruit LE and Arduino Micro?

Post by lootKit »

Ahoy! First post here so bare with my newbishness..

I'm a new owner of the Bluefruit LE breakout and I'm wondering if anyone has any tips, suggestions or links to great reading material for getting this to work with an Arduino Micro.

My goal is basically to start with the tutorial available here on AF, then move into finagling BlueZ into the Micro.

Thanks

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: BlueFruit LE and Arduino Micro?

Post by adafruit_support_mike »

The Micro is based on the same processor as the Leonardo (and our Flora), but aside from some minor issues with having to use Serial1 rather than Serial for output, I think the existing library should work.

You won't fit Bluez on an Arduino though. That's designed for devices that have a whole operating system.

lootKit
 
Posts: 11
Joined: Tue Apr 29, 2014 1:26 pm

Re: BlueFruit LE and Arduino Micro?

Post by lootKit »

Thanks Mike.

The sketch is uploading fine, but I'm unable to get the '... Advertising...' message to print in the Arduino IDE Serial Monitor. Also unable to connect with the Bluefruit LE Connect app for iOS.

Haven't had too much time to figure this out, but I have done some reading about the Serial1 issue. Is there a different wiring setup needed other than then the one in the Learn post about the BlueFruit LE?

lootKit
 
Posts: 11
Joined: Tue Apr 29, 2014 1:26 pm

Re: BlueFruit LE and Arduino Micro?

Post by lootKit »

I've since changed the wiring setup on the Micro. Now the MISO, MOSI and SCK from the BFLE are now going to the labelled ports on the Micro. Still no 'Advertising' echo in the monitor. Tried the pins on the ICSP but still nothing.

The only thing I know to check next is making sure the voltage is correct while powered on and the Bluefruit LE is definitely getting it's 5V from the Micro.

I'd like to try giving it the power from an external source but would like some feedback first. Don't really want to blow anything up...

Thoughts?

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: BlueFruit LE and Arduino Micro?

Post by adafruit_support_mike »

Post a photo of your hardware and connections and we'll see if that tells us anything.

lootKit
 
Posts: 11
Joined: Tue Apr 29, 2014 1:26 pm

Re: BlueFruit LE and Arduino Micro?

Post by lootKit »

Great suggestion! Here it is with the pinout I scrambled together from the Micro's documentation on the Arduino website. There it says that the pins are deliberately different than the Uno, but the same capabilities are available (afaik).
Attachments
2014-05-27 15.54.23.jpg
2014-05-27 15.54.23.jpg (953.38 KiB) Viewed 902 times

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: BlueFruit LE and Arduino Micro?

Post by adafruit_support_mike »

Double-check your SPI connections. I think you might have MISO and MOSI swapped.

lootKit
 
Posts: 11
Joined: Tue Apr 29, 2014 1:26 pm

Re: BlueFruit LE and Arduino Micro?

Post by lootKit »

Right when I snapped that, I saw that as well. Swapped them around and nothing still. Is there a way to check if the BFLE board is working at all if it isn't echoing back? Hopefully it isn't dead...

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: BlueFruit LE and Arduino Micro?

Post by adafruit_support_mike »

The nRF8001 library has a routine called 'getState()', which is described on this page of the tutorial: https://learn.adafruit.com/getting-star ... -in-detail

If you get any of the defined responses, it's a good sign that the chip isn't dead.

lootKit
 
Posts: 11
Joined: Tue Apr 29, 2014 1:26 pm

Re: BlueFruit LE and Arduino Micro?

Post by lootKit »

Thans Mike. I've read the tutorial through and through but you've definitely reiterated my concerns here.

As I've stated above, I'm not getting any of the outputs from the getState() function at all. Although I'm still getting a normal reading from my multi and osci scopes.

Seems this is just a matter of telling the Micro which pins to read from at this point.

Can you shed some light on where I can change the variable to read from the Micro's separate MISO, MOSI and CLK?

In the echoDemo file this is defined:
// e.g. On UNO & compatible: CLK = 13, MISO = 12, MOSI = 11

But I can't seem to find where to change those values.

Thanks again for the help, but maybe more eyes should help out with this problem. A quick googs search brings up a lot of other people with this problem.

lootKit
 
Posts: 11
Joined: Tue Apr 29, 2014 1:26 pm

Re: BlueFruit LE and Arduino Micro?

Post by lootKit »

adafruit_support_mike wrote:The nRF8001 library has a routine called 'getState()', which is described on this page of the tutorial: https://learn.adafruit.com/getting-star ... -in-detail

If you get any of the defined responses, it's a good sign that the chip isn't dead.
Thanks for the suggestion. I've tried sending the getState(); to the board once I get the "Adafruit Bluefruit..." but not the "Advertising started" in console and nothing is returned. The Micro RX LED lights up when I send it, but maybe I'm just too new to the platform and I'm missing something?

Still hoping that I can get some help with this so I enlisted stack exchange too. A few suggestions resulted in only one change of events when I try to alter the ble_system.h to the following:

#define HAL_IO_RADIO_CSN SS
#define HAL_IO_RADIO_REQN SS
#define HAL_IO_RADIO_RDY 1
#define HAL_IO_RADIO_SCK SCK
#define HAL_IO_RADIO_MOSI MOSI
#define HAL_IO_RADIO_MISO MISO
#define HAL_IO_RADIO_RESET 9
#define HAL_IO_RADIO_ACTIVE 8

The above mixed with below:

#define ADAFRUITBLE_REQ SS
#define ADAFRUITBLE_RDY 0 // This should be an interrupt pin, on Uno thats #2 or #3
#define ADAFRUITBLE_RST 9

... results in the RX LED staying lit. I understand this is something like a voltage warning, so I changed the '#define ADAFRUITBLE_RDY 0' to 1 and I'm back at square one.

On your Github page the following is stated:

The pin locations are defined in ble_system.h, the supported systems are defined in hal_aci_tl.cpp. The following pinout is used by default for the Arduino Uno:

SCK -> Pin 13
MISO -> Pin 12
MOSI -> Pin 11
REQ -> Pin 10
RDY -> Pin 3 (HW interrupt)
ACT -> Pin 8 (optional)
RST -> Pin 9
3V0 - > Not connected
GND -> GND
VIN -> 5V

... but I'm not sure where to look in order to change the above pinout to reflect the Micro's own arrangement of separate SPI pins.

Is there anyone else there in Adafruit land that might want to chime in as well? On paper these two should work swimmingly, so I'm hoping you fine folks and engineers can help still. :)

Thanks again for the help so far.
Attachments
2014-06-02 09.39.17.jpg
2014-06-02 09.39.17.jpg (948.07 KiB) Viewed 820 times

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: BlueFruit LE and Arduino Micro?

Post by adafruit_support_mike »

It sounds like you may have a dud.

Send a note to [email protected] with a link to this thread and the folks there will get you another breakout.

lootKit
 
Posts: 11
Joined: Tue Apr 29, 2014 1:26 pm

Re: BlueFruit LE and Arduino Micro?

Post by lootKit »

That sounds awesome. I'll absolute do that if my latest progress is a dead-end as well.

*The following changes were made to the pinout in the sketch:

Code: Select all

     #include <SPI.h>
     #include "Adafruit_BLE_UART.h"

     // Connect CLK/MISO/MOSI to hardware SPI
     // e.g. On UNO & compatible: CLK = 13, MISO = 12, MOSI = 11
     #define ADAFRUITBLE_REQ SS
     #define ADAFRUITBLE_RDY 2     // This should be an interrupt pin, on Uno thats #2 or #3
     #define ADAFRUITBLE_RST 3
And the following is the modified ble_system.h:

Code: Select all

     #ifndef BLE_SYSTEM_H_
     #define BLE_SYSTEM_H

     /*
     #define HAL_IO_RADIO_CSN       SS
     #define HAL_IO_RADIO_REQN      SS
     #define HAL_IO_RADIO_RDY       3
     #define HAL_IO_RADIO_SCK       SCK
     #define HAL_IO_RADIO_MOSI      MOSI
     #define HAL_IO_RADIO_MISO      MISO
     #define HAL_IO_RADIO_RESET     9
     #define HAL_IO_RADIO_ACTIVE    8

     //#define HAL_IO_LED0          2
     //#define HAL_IO_LED1          6
     */
New Result:

• Same output in the console for Line 1 "Adafruit Bluefruit Low Energy nRF8001 Print echo demo".

• Typing "getState()" in console and hitting enter gives a massive parallel string of characters which crashes Arduino IDE

This looks like the BTLE breakout board may actually be working properly, but the data incoming to the Micro isn't being parsed properly.

*(cross posted on stackExchange http://stackoverflow.com/q/23983683/1951749)
Attachments
2014-06-02 12.29.13.jpg
2014-06-02 12.29.13.jpg (897.2 KiB) Viewed 810 times

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: BlueFruit LE and Arduino Micro?

Post by pburgess »

The 'Guggenhat' tutorial uses this exact combo.

https://learn.adafruit.com/guggenhat-bl ... /soldering

Try following the same wiring and running the code (don't worry about connecting pixels...as long at the Micro & Bluefruit are talking, you should see the device via nRF UART or other app).

lootKit
 
Posts: 11
Joined: Tue Apr 29, 2014 1:26 pm

Re: BlueFruit LE and Arduino Micro?

Post by lootKit »

Thanks everyone for the awesome help. I received a replacement board and it's working all well and good now. I get the 'Advertising Started' message!

Now on another weird question... Seems I can't compile the BLEFirmata code. I consistently get the message:

"TOTAL_PORTS was not declared in this scope"

I've read elsewhere that there may be a linking issue, but there's been little to no expansion on the issue.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”