Step 8: Build and Run the Application
1
2
Note: It is not required to adjust the Baud rate as you are using a USB connection.
4
Remove the SD card from the IO1 Xplained Pro board.
7
Press the switch SW1 again. That will stop the log.
10
Safely remove the SD card media from the Host machine and insert the SD card into the microSD slot of the IO1 Xplained Pro board. Reset the PIC32 WFI32E Curiosity Board using the MLCR button. Last, press the switch SW1 to start the log.
Note: You can find the solution of the Lab 2 in the folder: <your unzipped folder path>\getting_started_pic32_wfi32e\Lab2\solution.
Results
You should be able to verify the temperature logs were successfully recorded into the SD card.
Analysis
In this lab, you have successfully added new functionality to your project. The new application writes the temperature sensor values along with current system time to a file in an SD card using the File System interface.
- The SDSPI Driver with SPI2 Peripheral Library was used to perform operations on the SD card.
- The RTC Peripheral Library was used to get the current system time.
- The File System service was used to write the current system time along with temperature sensor values received from the Sensor Task to a file created on an SD card using the SDSPI Driver.
- Some BSP features have been used to provide interaction with the user.
In the next lab, you will move the current application into an RTOS environment.
Conclusions
In this lab, you have successfully developed a full-fledged MPLAB Harmony Application. This gives you a fair idea of how MPLAB Harmony helps application development. If you need to add the SD card and File System support to any of your existing applications, this lab can be used as a reference. This can also be a starting point for your IoT applications.