Introduction

This document describes how to configure and use the Tightly Coupled Memory (TCM) features in the PIC32C and SAM MCUs using MPLAB® X IDE with the MPLAB XC32 compiler and MPLAB Harmony v3 software development framework.

TCM brings a lot of advantages to application developers. It provides the same performance as if the code is located in cache.

The following are some recommendations for optimizing the use of TCM in applications:

  • Application stack can be located in the DTCM
  • Application heap can be located in the DTCM
  • Critical variables can be located in the DTCM
  • Frequently updated variables can be located in the DTCM
  • Critical functions/routines can be located in the ITCM
  • A copy of the Interrupt vector table can be located in the ITCM
  • Interrupt service routines can be located in the ITCM