Lab 2: Log Data to SD Card


In Lab 2, you will enhance the existing application and log the temperature sensor data into an external SD card using the File System. The new application will use:

  • Asynchronous SDSPI Driver using SPI2 Peripheral Library to write the temperature log onto the SD card.
  • File System Service linked with SDSPI Driver to perform file operations on the SD card.
  • RTC Peripheral Library to capture the time for the temperature log


The whole application is divided into four tasks.

  • Sensor task
  • SD card task
  • USB task
  • Wi-Fi task

Each task runs its own state machine. The tasks are called from the SYS_Tasks() routine, which is run in an infinite loop.

In Lab 2, you will develop the SD card task.



Lab 2 Index

Part 1 - Configure SDSPI Driver, File System, RTC Peripheral Library

Part 2 - Add Application Code & Build the Application

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.