Getting Started with MAX32630 Feather

This guide teaches you how to get started with the Maxim Integrated MAX32630 Feather board and Atmosphere. This includes creating your first project, programming the project’s firmware into your MAX32630, registering the device to Atmosphere, and having its data displayed on a dashboard.

This guide demonstrates a simple project that reads accelerometer data from the board’s onboard inertial sensor once per second, displays that x-, y-, and z-axis data on the mobile app, and then sends the readings to the cloud.

Prerequisite: You should already have an Atmosphere account.

If you'd like to see this demo before attempting this guide, it's available in Studio's Demo Projects section as the MAX32630 Feather Accelerometer Demo. Simply open the project to check it out and get started.

Hardware Requirements

  • Maxim Integrated MAX32630FTHR
  • Tablet or smartphone mobile device

Software Requirements

  • Atmosphere IoT app. The mobile app allows you to view your registered devices and display and run the project’s interface. You can download the Atmosphere IoT app from its downloads page or through the Apple App Store or Google Play Store.
  • Atmosphere IoT Agent. The Atmosphere IoT Agent is a local application that runs in the system tray and acts as an intermediary between the computer’s connectivity protocol drivers and the browser running Atmosphere, used to assist in programming your device. You can download the Atmosphere IoT Agent from its downloads page.
  • Ensure Bluetooth is enabled on the mobile device you’ll use to interact with the MAX32630.

Step 1 of 9: Create a New Project

Navigate to Atmosphere Studio from the side menu. When you visit Studio for the first time in a session, you are brought to the Studio Projects screen.

  1. Click the New Project button. This displays a New Project window.
  2. Select the MAX32630 Feather project type and give the project a name, then click Create.

This opens a new project in Studio.

This guide walks through the step-by-step process to perform actions in Studio, but doesn't cover the in-depth aspects of Studio itself. To learn more about using Studio, its areas and features, and Studio elements, visit the Atmosphere Studio section.

Step 2 of 9: Create the Project’s Embedded Firmware

The first aspect of building this sample project is adding elements to the Embedded tab to create the project’s embedded firmware. This involves setting an interval to read embedded data, and to tell the interval to read the board’s accelerometer.

  1. Add the following elements to the canvas by clicking them in the Element Toolbox:
    • Interval Element Interval element: The interval element sets the project to run at the time set in the element’s properties, which by default is set to once per second (1000 ms).
    • Bosch BMI160 Element BMI160 element: The BMI160 element reads acceleration and rotation data. This is an inertial sensor that is onboard the MAX32630 Feather board, and its element is imported in the Element Toolbox for MAX32630 Feather projects by default.

      Both of these elements will work as intended by default, so none of their properties need to be changed.
  2. Connect the interval element to the BMI160 element. This creates an event between them, which can be seen in either the interval element’s properties, or by clicking the connector’s Configuration Button button. The event added is within the Interval trigger, with the BMI160 ability Read Acceleration. This means that when the interval element is triggered (which is every second), it will read the sensor’s acceleration data.
  3. Add a BLE Characteristic Element BLE characteristic element to the canvas, which creates a GATT characteristic to use in your project. This element is a coupled element that bridges the project between the Embedded tab and Application tab, meaning it’s included on both tabs. Select the BLE characteristic element, and change the Read Data Type and Write Data Type fields to 3D Float (32-bit) Vector. This reads and writes the incoming data as a 3D floating point value, which encompasses the acceleration values (x-, y-, and z-axis) sent to and from it.
  4. Connect the BMI160 element to the BLE characteristic element, which ties the value from the sensor to the Application tab. This creates an event between the two elements of Set Value under the Acceleration Read trigger, which sets a value for the project’s interface after the acceleration value is read.

That’s all for work in the Embedded tab. To this point, an interval has been set that will run once per second after the project opens, and when run will read acceleration data. The Embedded tab canvas should resemble the following image:

MAX32630 Embedded Tab

Step 3 of 9: Create the Project’s Interface

The second aspect of building this sample project is adding elements to the Application tab to create the project’s visual component.

Click the Application tab to move to the application area of the project. Notice how the Element Toolbox has changed, and that the coupled BLE characteristic element is displayed on the canvas.

  1. Click the Interface Builder button in the Application tab’s toolbar to display the interface builder. This area creates the visual interface for your project. By default this uses the smallest display size supported for an interface (320x560), but you can add an interface size by clicking the add display button. Use the display size that fits best with your mobile device.
  2. Add an Interval Element interval element to the canvas, and connect it to the existing BLE characteristic element. This creates the trigger event Read, which reads the value of the BLE characteristic element sent from the Embedded tab every time the interval triggers.
  3. Add three Label Element label elements to the canvas. The label element displays text on a project’s interface. Notice when a label is added to the canvas, a corresponding interface component is added to the app builder. The label component can be moved around on the interface wherever you like.
  4. The three label elements will represent each of the acceleration values, so provide each of them a unique name (such as Acc[X]) in their respective properties.
  5. Connect the BLE characteristic element to each label element. This creates an event between each of the elements of Set Text under the Read trigger, which sets the text to the value of the label when the BLE characteristic is read. This correlates the set value from the BLE characteristic element in the Embedded tab to the label on the interface.
  6. Within BLE characteristic element’s properties (or individual connector properties), update each label element’s event argument text from readData to readData.[axis] for the axis the label is used for. This will update the data read to the label to correspond to the axis value. So the text arguments will be updated to readData.x, readData.y, and readData.z respectively.

This is all that needs to be done for the project’s interface, using three label elements to display each acceleration value. To this point, an interval has been set that will read the BLE characteristic value once per second, and will display the read values on each interface label. The Application tab’s canvas and app interface should resemble the following images:

Canvas Interface
MAX32630 Application Canvas MAX32630 Application Interface

If you'd like to shorten the displayed acceleration values, you can limit the numbers included after the decimal point by updating its ability argument using JavaScript.

To do so, click one of the label's connectors, and in its event properties change its Text argument field to "[labelName]" + readData.[axis].toFixed(2). For example, "Acc[X]" + readData.x.toFixed(2) would update the Acc[X] label to display x-axis data to a maximum of two decimal places. You can do this for each label by updating the element name and which axis it's for.

Step 4 of 9: Enable the Project’s Cloud Connectivity

The third aspect of building this sample project is enabling it for cloud connectivity. This is done on both the Application and Cloud tabs.

  1. While still in the Application tab, add a Cloud Event Element cloud event element to the canvas. The cloud event element is a coupled element between the Application and Cloud tabs that enables a project’s data to be sent to Atmosphere.
  2. Connect the BLE characteristic element to the cloud event element. This adds the Send Event event to the Read trigger, which sends the set value data to Atmosphere when the BLE characteristic is read.
  3. Click the Cloud tab to move to the cloud area of the project. Notice how the Element Toolbox has changed, and that the coupled cloud event element is displayed on the canvas.
  4. Add a Cloud Storage Element cloud storage element to the canvas, and connect the cloud storage element to the cloud event element. This allows Atmosphere to store data sent to it from the connected cloud event element.

That’s all for creating the project! With the added cloud connectivity, the project will send the acceleration values from the Embedded tab to the Application tab, which then uses a cloud event to send the values to the Cloud tab, where it’s connected to a cloud storage element to store the data on Atmosphere.

The final canvas for each tab should resemble the following images:

Embedded Application Cloud
MAX32630 Embedded Tab MAX32630 Application Tab MAX32630 Cloud Tab

Step 5 of 9: Compile the Project

Once the project is finished, it needs to be compiled. Compiling readies the entire project’s source code for deployment.

  1. From any tab, click the Compile button in the project options menu on the top-right of the screen. You’ll see a loading message on the screen, and will receive a notification when the project is compiled.

Step 6 of 9: Program Firmware into the Device

With the project compiled, your MAX32630 can be programmed with the project’s embedded firmware. Unlike other end devices supported in Atmosphere, the MAX32630 Feather doesn’t contain a built-in programmer. Instead, you must use a MAXREFDES100HDK Programming Adapter or external DAPLink to program the device.

Prior to programming the device, ensure you have the following configuration:

  • Connect the fine 10-pin ribbon from the SWD (J3) header on the MAXREFDES100HDK to J4 on the MAX32630 Feather.
  • Connect the MAX32630 Feather to a power source via micro USB.
  • Connect the MAXREFDES100HDK to the computer via its micro USB connector labeled HDK.

MAX32630 Feather Programming Setup

When connected, the MAXREFDES100HDK will expose itself as a drive labeled “DAPLink.”

You may need to update the board's native firmware in order to program the MAX32630. For information on performing a firmware update, see the official MBED MAXREFDES100HDK docs.

With setup complete, you can program your board:

  1. From the Embedded tab, click the Program Firmware button from the tab’s toolbar. This downloads a .bin file containing the project’s compiled firmware.
  2. Locate the downloaded file on your computer, and move it into the onto the DAPLink drive. This initiates programming of the board. Once programming is finished, the DAPLink drive will unmount and then mount again, indicating programming is complete.

Once the device is programmed, press the reset button on the MAX32630 Feather to start your project and it will begin reading acceleration data.

Step 7 of 9: Register the Device

With firmware installed, the device can now be recognized and connected to Atmosphere. From here, open the Atmosphere IoT app on your mobile device. We’ll use the mobile app to both register the device, and eventually view the label data on the project’s interface.

To register a device:

  1. Navigate to the Devices area, and click the Register Device button in the top-right of the screen to display the Add Device window. When the window opens it automatically starts scanning for available devices within range.
    • Ensure your MAX32630 is within range from the device you are attempting to register from, otherwise it may not appear.
  2. The list of available devices appears. Select your device you just programmed and click Register.

The device is registered to Atmosphere and displayed on the page.

Step 8 of 9: View the Project Interface

Each registered device has its own dedicated console page, which displays its information and is where you access the device’s interface to interact with it. Select your newly-registered device in the Devices area to access its console.

The interface created in Studio’s Application tab is available on a device’s dashboard to interact with it. As long as the device is powered on and connected to Atmosphere, it can be interacted with.

To display the interface you created, click the Interface button at the top of the screen. This opens the project interface from within the Atmosphere IoT app.

The project’s interface displays the three acceleration labels and their axis values.

Step 9 of 9: View Device Data

Now that the device’s data is sent to Atmosphere, let’s view it through one of the many dashboard widgets available. In this guide we’ll use a data glance widget to display each of the acceleration values.

  1. To add a widget to the device’s dashboard, click the Configuration button on the right side of the screen. This displays the menu of available widgets. Select the Data Glance data glance widget to add a data glance to the dashboard.
  2. Once on the dashboard, click the widget’s Menu menu icon to display its menu, then click Settings. This data glance will be used for the x-axis value.
  3. In the data glance’s settings, modify the following properties:
    • Name: Give the widget a name, such as “X Acceleration”.
    • Units: Enter g for its unit of measurement.
    • Maximum Value: Select an icon that represents the data, such as the Acceleration icon.
    • Color: Give the widget a color that you think best represents the data.
  4. In the Data Source field, click Select, then choose the following configuration options for the widget:
    • Select Cloud Storage: Click the cloud storage that is storing the acceleration data.
    • Select Value Select the x-axis acceleration dataset.
  5. When finished click Save. The data glance is then populated with the x-axis reading.
  6. Add two more data glance widgets, and repeat the process for the y- and z-axis data as well.

Each data glance widget displays their respective acceleration value.

MAX32630 Demo Dashboard

Congratulations, you just finished a complete MAX32630 project with Atmosphere!