6 Hardware and Software Requirements
The following sections cover hardware and software prerequisites used for this application, and they also cover the overview of the application.
Prerequisites
Hardware:
Software:
- MPLAB® X IDE v6.20 or above
- MPLAB® XC32 compiler v4.45 or above
- MPLAB®Code Configurator v5.5.1 or
above
- csp v3.19.7 (MPLAB Harmony v3 Chip Support Package) or above
Application Overview
This example illustrates the use of TCM in the PIC32CZ CA and SAM E70/S70/V70/V71 family of devices. It compares the time taken to execute the code from Flash memory, SRAM, and TCM with or without the I-cache and D-cache.
Application Code
To illustrate code execution from memory locations, a simple data transfer function is created on Flash memory, SRAM, and TCM. Then, the time taken is compared for each data transfer with the help of the core cycle counter. Using the MPLAB XC32 compiler attributes, the functions and data buffers are placed in different memory locations.
__attribute__((tcm))
: Places the function or buffer in TCM__attribute__ ((ramfunc, long_call))
: Places the function or buffer in SRAM
In the main.c
file,
- Two buffers,
TCM_SrcBuff
andTCM_DestBuff,
are defined and placed in DTCM - Two buffers,
SrcBuff
andDestBuff
, are defined and placed in SRAM - A function,
TCM_memcpy()
, is in ITCM - A function,
SRAM_memcpy()
, is in SRAM - A function,
flash_memcpy()
, is in Flash