Introduction
Learning about Bluetooth has been on my to do list for quite some time, but up until now I haven't been very good about setting the time aside to pursue this endeavor.
Recently I participated in the IO Link quiz and as luck would have it I was one of the fortunate ones selected to receive the MAX32666FTHR Application Platform. Now with a Bluetooth development board in hand the motivation to finally dip my toes into the Bluetooth waters had arrived.
Thank you Maxim and Element14 for the generous gift and the opportunity it provides to explore a new technology.
Contents
The following items were received as part of the kit:
- MAX32666FTHR Development Board
- MAX3265PICO Development Board
- 10-pin ribbon cable
- 2x micro USB cables
- metal case
The two development boards and ribbon cable fit nicely in the little tin case.
Having said that, please be careful not to pinch the cable when closing the case.
MAX32666FTHR
The MAX32666FTHR and its name sake MCU are the focal point of the kit.
Its key features are:
- 2x 96MHz ARM Cortex-M4F processor cores
- 1MB FLASH Memory
- 560kB SRAM
- Bluetooth 5 Low Energy Radio
- USB 2.0
- I2C/SPI/GPIO
MAX32625PICO:
The MAX32625PICO is a very capable development platform in its own right. In fact its MCU also includes a 96MHz ARM Cortex-M4F processor core.
Even so its main duty here is to act as a programmer and debugger for the MAX32666FTHR board.
Hello World Example
The first thing I did was run the HelloWorld example.
Before elaborating further on this subject I would like to add a cautionary note first. The MAX32666FTHR datasheet indicates that the board operates as a Bluetooth beacon out of the box, so before running the HelloWorld example you might want to pull out your cell phone and see if you can detect it first. Unfortunately I missed this opportunity.
I used the following video to guide me through the HelloWorld example:
I found the Maxim SDK software referenced in the video by using the following Google search words:
maxim micros sdk
In my case I chose the first search result:
The video's presenter used a solderless bread board to mount the two dev boards. Admittedly this makes for a pretty clean and organized set up.
For those of us that are accustomed to a little more chaos, do not fear, the example will still work fine when the boards are arranged haphazardly among discarded candy wrappers and peanut shells.
Upon successfully running the HelloWorld example you should see the following output in your terminal.
A Crash Course in Bluetooth
Prior to receiving the MAX32666FTHR development kit my forays into the world of Bluetooth were limited to pairing wii controllers and setting up my Roku remote. As such I needed a quick crash course in the basics of Bluetooth. Luckily Maxim produced a series of videos that provide an introduction to Bluetooth Low Energy.
Part 1 https://youtu.be/tcWrt5v5itM
Part 2 https://youtu.be/cbJgw1tkxVc
Part 3 https://youtu.be/ikt01g5yxvY
Part 4 https://youtu.be/kxl2WyzIIgw
Part 5 https://youtu.be/5PgSLtNoipo
My First Bluetooth Peripheral
At this point I wanted to go beyond HelloWorld and run an actual Bluetooth example. Lucky for me the Maxim SDK includes a number of Bluetooth example designs. I settled on the Bluetooth Periperal example.
The procedure for running this design is as follows:
Connect the MAX32666FTHR and MAX32625PICO with the ribbon cable and then connect both boards to a PC using their micro USB cables.
Open the Eclipse Maxim SDK and choose your work space.
Click File - New - Project
Select Maxim Microcontrollers and click Next
Enter your project's name. I used BLE_Periph_Example as my project's name.
Ensure that the "use default location" option is checked and click Next
Select the options shown below.
(No your eyes aren't deceiving you, you are supposed to select MAX32665 as the Chip type)
Click Finish.
I am not sure if this is 100% necessary but at this point I opened the Makefile and changed the board from EvKit_V1 to FTHR_RevA.
Save the Makefile.
Right click the project and click Clean Project
Right click the project again and this time click Build Project
This could take a while, with my case requiring 3 minutes 21 seconds.
After the build click the launch button
Once the program has been fully uploaded click the stop button and close the Eclipse SDK software all together. This isn't a problem because the program is stored to nonvolatile memory in the MAX32666 microcontroller.
Remove the USB cable that connects the MAX32666FTHR board to the PC (keep the other USB cable connecting the MAX32625PICO plugged in)
Open a terminal program like PuTTY and set the baud rate to 115,200.
Now restore the USB connection to the MAX32666FTHR.
In no time at all the Bluetooth peripheral's start up sequence will be displayed to terminal.
Admittedly a lot of this information is techno babble which I am in no position to decipher but on the 6th line we see that reset is complete.
Finally the following is reported:
>>> Advertising started <<<
Advertising is something Bluetooth peripherals do prior to their connection to a host .
They are, in a sense, advertising their presence.
This is a good point to pull out your cell phone and take a glance at the Bluetooth devices in your local environment.
Oh wow, look at that, amongst the available devices we see something called Periph.
What happens if we try and pair Periph?
Well for one thing my phone tells me that an App is needed to use this device.
Oh well, but why don't we direct our attention to terminal again.
Once again most of the information reported is beyond me, but I see one interesting thing right off the bat.
>>> Connection opened <<<
This suggests to me that for one fleeting moment a connection was established between the MAX32666 and my cellphone.
Later on we see:
>>> Connection closed <<<
This isn't too surprising because my cell phone did report, after all, that an App is needed to use this device.
Where do we go from here?
Did I become a master of all things Bluetooth today?
Certainly not. I recognize this as a baby step, but still it was satisfying to track the presence of the Bluetooth peripheral on my phone.
So where do we go from here?
Well first of all there are other Bluetooth examples included in the SDK to explore. Even the peripheral example from today has nooks and crannies to uncover. One application area I am interested in is to use Bluetooth to broadcast measurements. I will see if there are any premade apps to receive and manage this sort of data on a cell phone. Another area to explore is the possibility of making custom audio hardware that is connected by Bluetooth. Maybe today's work is one small step in the journey towards reaching these goals. Only time will tell.