Fitness Tracker Application on SAM D21 Curiosity Nano and Nano Base for Click boards
Download
Description:
The application demonstrates a solution based on Microchip products for health care industry and wearable products. The application displays heart rate readings (in beats per minute - bpm) on a very low power consuming display. The Mikroelektronika Heart Rate 3 click board is used to read the heart pulse. Mikroelektronika eINK click bundle is used for displaying heart rate. The eINK click bundle contains the eINK click adapter board and the eINK display.
The Heart Rate 3 click contains two integrated LEDs, a photosensitive element and advanced low noise analog front end to provide clean and accurate heart rate readings. It is enough to place an index finger on a top of the sensor to get the heart rate via I2C interface. The eINK display is a very low power consumption and the ability to retain the information, even after disconnecting from the power source. The host MCU SAM D21 is interfaced with the Heart Rate 3 click over the I2C interface and eINK click over SPI Interface.
Modules/Technology Used:
- Peripheral Modules
- Timer
- EIC
- Driver Modules
- SPI Driver
- I2C Driver
- STDIO Library
Hardware Used:
- SAM D21 Curiosity Nano Evaluation Kit
- Curiosity Nano Base for click boards
- Heart Rate 3 click
- EINK CLICK BUNDLE
Software/Tools Used:
This project has been verified to work with the following versions of software tools:
- MPLAB Harmony v3 “csp” repo v3.8.3
- MPLAB Harmony v3 “core” repo v3.8.1
- MPLAB Harmony v3 “dev_packs” repo v3.8.0
- MPLAB Harmony v3 “mhc” repo v3.6.5
- MPLAB Harmony 3 Launcher Plugin v3.6.2
- MPLAB X IDE v5.45
- MPLAB XC32 Compiler v2.41
Because Microchip regularly update tools, occasionally issue(s) could be discovered while using the newer versions of the tools. If the project doesn’t seem to work and version incompatibility is suspected, It is recommended to double-check and use the same versions that the project was tested with.
Setup:
- Mount SAM D21 Curiosity Nano Evaluation Kit on “CNANO56_HOST_CONN”(U3) connector of Curiosity Nano Base board
- Mount Heart Rate 3 click board on mikro bus click 2 connector of Curiosity Nano Base board
- Mount the eINK click bundle (eINK click + eINK dispaly) on the mikro bus 3 connector of Curiosity Nano Base board
- Power the SAM D21 Curiosity Nano Evaluation Kit from a Host PC through a Type-A male to Micro-B USB cable connected to Micro-B port (J105)
Programming hex file:
The pre-built hex file can be programmed by following the below steps.
Steps to program the hex file
- Open MPLAB X IDE
- Close all existing projects in IDE, if any project is opened.
- Go to File -> Import -> Hex/ELF File
- In the “Import Image File” window, Step 1 - Create Prebuilt Project, Click the “Browse” button to select the prebuilt hex file.
- Select Device has “ATSAMD21G17D”
- Ensure the proper tool is selected under “Hardware Tool”
- Click on Next button
- In the “Import Image File” window, Step 2 - Select Project Name and Folder, select appropriate project name and folder
- Click on Finish button
- In MPLAB X IDE, click on “Make and Program Device” Button. The device gets programmed in sometime
- Follow the steps in “Running the Demo” section below
Programming/Debugging Application Project:
- Open the project (fitness_tracker\firmware\sam_d21_cnano.X) in MPLAB X IDE
- Ensure “PKOB nano” is selected as hardware tool to program/debug the application
- Build the code and program the device by clicking on the “make and program” button in MPLAB X IDE tool bar
- Follow the steps in “Running the Demo” section below
Running the Demo:
- Perform a reset by unplugging and re-plugging the power cable of SAM D21 Curiosity Nano
- After power up, the application displays the “microchip logo” on the eINK display displays and initializes the heart rate sensor
- After successful initialization of heart rate sensor, two integrated LEDs on the heart rate 3 click lights up
- Then press switch “SW0” on SAM D21 Curiosity Nano board, LED “LED0” on SAM D21 Curiosity Nano board glows on
- Place your index finger gently on the heart rate 3 click sensor as shown in the figure below
- Wait till the LED “LED0” on SAM D21 Curiosity Nano board goes off and then lift your finger
- The heart rate value (in bpm - beats per minute) gets displayed on the eINK display
Comments:
- Place your index finger gently on the heart rate 3 click sensor, don’t push or put pressure on the sensor (the heart rate values may not be accurate)
- Reference Training Module: Getting Started with Harmony v3 Peripheral Libraries on SAM D21 MCUs
- This application demo builds and works out of box by following the instructions above in “Running the Demo” section. If you need to enhance/customize this application demo, you need to use the MPLAB Harmony v3 Software framework. Refer links below to setup and build your applications using MPLAB Harmony.
Revision:
- v1.2.0 - Regenerated and tested application.
- v1.1.0 - Regenerated and tested application.
- v1.0.0 - Released demo application