31.2.6.3 CTRLB SFR Description

The CTRLB fields can be changed at anytime, provided the FCR is not write protected. Updates that affect the cache happen on read access boundaries.

The Register values for CTRLB are discussed below.

PREFDIS - Prefetch Disable (conditional)

PREFDIS is only valid when the cache is enabled. When PREFDIS=1, the prefetch buffer is disabled preventing speculative fetches from flash. When PREFDIS=0, the prefetch buffer is enabled allowing speculative fetches from flash.

CHEDIS - Flash Cache Disable (conditional)

The cache is enabled by default but can be disabled using CTRLB.CHEDIS. The cache is enabled and disabled on access boundaries. When enabled reads obey the PREFDIS setting. When disabled it is invalidated and reads obey the CTRLA.RDBUF[FCR_PCHE_AHB_NUM] setting.

Accesses to the flash from debug mode does not affect the flash cache and its state is not changed.

SLP[1:0] - Power Mode in Standby Sleep

The SLP field controls the Power Reduction Mode during System Standby, Sleep. Waking the flash from its power down mode takes at least TDPDH. Upon system wakeup, the current Power Reduction Mode is reflected in STATUS.PRM. See the SLP SFR field for more details.

CHEINV: - Flash Cache Disable (conditional)

The cache is invalidated for any write or erase of the flash, including in either panel of a two panel system. It is also invalidated for a change in SWAP or read protection (via CRP register). Alternately, it can be invalided manually by writing a 1 to CTRLB.CHEINV.

TEMP - High Temp Read Control (conditional)

Some Flash panels have a High Temperature Read mode that supports read operations up to 150C junction. High Temp Read is a Read Mode of the Flash and therefore the Flash must be placed in this mode when reading at high temperatures is required. The High Temp Read mode incurs a longer Flash access time regardless of actual temperature.

CTRLB.TEMP controls entry/exit to/from High Temp Read operation. STATUS.TEMP reflects the current state of High Temp Read. The reset value of STATUS.TEMP is controlled by a Flash-based user configuration fuse typically called NVMTEMP.

Note: If the device can power up at high temp, then the device configuration bit, NVMTEMP, must select High Temp. Boot code can determine the device temperature and update TEMP accordingly.

The TEMP field allows the user to manually control the High Temp Read mode or Standard Read mode. Writing CTRLB.TEMP to a 1 toggles the temperature read mode. When changing to High Temp Read mode, change FWS to support TACC (HIGH TEMP) before writing to CTRLB.TEMP. When changing from High Temp reads, change FWS after reading STATUS.TEMP = 0. If AUTOWS = 1 then no wait state changes are needed.

Note: It is recommended that if the device can be arbitrarily operated at high temperature, to always have High Temp Reads enabled.

Note that TEMP only affects read operation. Write/Erase operation is controlled an on board temperature monitor.

The following sequence can be performed while code is executing from Flash (or any other memory). If the sequence is performed whith STATUS.PRM = 1, once the Flash wakes up it will be in the selected mode.

  1. Read current TEMP value: curr_temp = STATUS.TEMP.
  2. Write 0x02 to BYTE 0 of CTRLB (toggle Temperature Read mode).
  3. Wait until STATUS.TEMP toggles. while (curr_temp == STATUS.TEMP) {}.

No flags get set nor are interrupts generated from a read mode change.

Note: Changing TEMP changes the read mode of the Flash. Flash read mode changes stall Flash reads for TMS + TMH and in addition to synchronization delays.

PRM - Power Reduction Mode

The PRM field allows the user to manually control the Flash power mode. Writing CTRLB.PRM to a 1 toggles the power reduction mode. The current mode is reflected in STATUS.PRM. When in Flash Hibernate the panel wakes up on access but does not return to Flash Hibernate. Note that when awake the Flash reenters Auto Standby if not accessed for one read cycle time.

To change the Flash Power Reduction Mode:

  1. Read current PRM value. curr_prm = STATUS.PRM.
  2. Write 0x01 to BYTE 0 of CTRLB (toggle Flash Power mode).
  3. Wait until STATUS.PRM toggles. while (curr_prm == STATUS.PRM) {}.

No flags get set nor are interrupts generated from a power reduction mode change. The power status of the Flash is reflected in STATUS.PRM.

Note:

Changing the Power Reduction Mode incurs a delay of TDPDH to take effect.