Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
FLASHCALW PicoCache example for SAM4L_EK Documentation

Introduction

This is the documentation for the data structures, functions, variables, defines, enums, and typedefs for the FLASHCALW software driver.

It also comes bundled with several examples. Using a Fibonacci calculation, this example demonstrates how much the PicoCache feature can improve the execution speed.

Note
The PicoCache always has a positive impact in terms of power consumption (Explanation: since the PicoCache features allows to do less access to the Flash, the power consumption is therefore reduced). Note however that the PicoCache feature may have a negligible negative impact on the execution speed when there are no wait states on the Flash (which may be the case when the CPU runs at 12MHz in some cases). See also the Flash Characteristics in the electrical characteristics section of the datasheet for more information.

Operating mode of the example:

  1. After reset, the example will run without PicoCache at 48MHz with 1 wait state.
  2. A Fibonacci calculation will be done.
  3. The power consumption of the calculation without PicoCache will be displayed on the board monitor.
  4. The time spent on the Fibonacci will be displayed on the debug monitor.
  5. PicoCache will be enabled.
  6. The Fibonacci calculation will be done again.
  7. The power consumption of the calculation with PicoCache will be displayed on the board monitor.
  8. The time spent on the Fibonacci will be displayed on the debug monitor.
  9. The cache hit number will be displayed on the debug monitor, which is the cause of the performance improvement and power consumption decrease.
  10. Then the example will run without PicoCache at 12MHz with 0 wait state.
  11. A Fibonacci calculation will be done.
  12. The power consumption of the calculation without PicoCache will be displayed on the board monitor.
  13. The time spent on the Fibonacci will be displayed on the debug monitor.
  14. PicoCache will be enabled.
  15. The Fibonacci calculation will be done again.
  16. The power consumption of the calculation with PicoCache will be displayed on the board monitor. The power consumption will be lower.
  17. The time spent on the Fibonacci will be displayed on the debug monitor.
  18. The cache hit number will be displayed on the debug monitor, which is the cause of the performance improvement and power consumption decrease.

Main Files

Compilation Information

This software is written for GNU GCC and IAR Embedded Workbench for Atmel. Other compilers may or may not work.

Device Information

SAM4L devices with a FLASHCALW module can be used.

Configuration Information

This example has been tested with the following kits:

  • SAM4L-EK evaluation kit;
  • SAM4L Xplained Pro
  • SAM4L8 Xplained Pro This example has been tested with the following configuration:
  • CPU clock: 48 MHz;
  • USARTx abstracted with a USB CDC connection to a PC;
  • PC terminal settings:
    • 115200 bps,
    • 8 data bits,
    • no parity bit,
    • 1 stop bit,
    • no flow control.

Contact Information

For further information, visit Microchip.
Support and FAQ: https://www.microchip.com/support/