SPRACN0F October 2021 – March 2023 F29H850TU , F29H859TU-Q1 , TMS320F280021 , TMS320F280021-Q1 , TMS320F280023 , TMS320F280023-Q1 , TMS320F280023C , TMS320F280025 , TMS320F280025-Q1 , TMS320F280025C , TMS320F280025C-Q1 , TMS320F280033 , TMS320F280034 , TMS320F280034-Q1 , TMS320F280036-Q1 , TMS320F280036C-Q1 , TMS320F280037 , TMS320F280037-Q1 , TMS320F280037C , TMS320F280037C-Q1 , TMS320F280038-Q1 , TMS320F280038C-Q1 , TMS320F280039 , TMS320F280039-Q1 , TMS320F280039C , TMS320F280039C-Q1 , TMS320F280040-Q1 , TMS320F280040C-Q1 , TMS320F280041 , TMS320F280041-Q1 , TMS320F280041C , TMS320F280041C-Q1 , TMS320F280045 , TMS320F280048-Q1 , TMS320F280048C-Q1 , TMS320F280049 , TMS320F280049-Q1 , TMS320F280049C , TMS320F280049C-Q1 , TMS320F28374D , TMS320F28374S , TMS320F28375D , TMS320F28375S , TMS320F28375S-Q1 , TMS320F28376D , TMS320F28376S , TMS320F28377S , TMS320F28377S-Q1 , TMS320F28378D , TMS320F28378S , TMS320F28379D , TMS320F28379D-Q1 , TMS320F28379S , TMS320F28384D , TMS320F28384S , TMS320F28386D , TMS320F28386S , TMS320F28388D , TMS320F28388S , TMS320F28P650DH , TMS320F28P650DK , TMS320F28P650SH , TMS320F28P650SK , TMS320F28P659DH-Q1 , TMS320F28P659DK-Q1 , TMS320F28P659SH-Q1
Flash memory is a non-volatile memory that provides the advantage of retaining its content even after a power cycle. However, due to its physical construction Flash memory is typically not as fast as volatile memories (SRAM, DRAM, and so forth). As a result, wait states are used in order to scale the MCU clock rate while accessing Flash memory, which can impact CPU performance . In order to greatly reduce this impact on performance, C2000 FMC’s (Flash Module Controller) read interface provides a prefetch mode (#T5843526-298). This mode significantly improves the performance of linear code, which typically makes up the majority of application code in real-time control systems.
When enabled on C2000 MCUs, the module does a look-ahead prefetch (128-bit aligned) on linear address increments starting from the last instruction fetch address and stores it in a 128-bit wide by 2-level deep instruction prefetch buffer. This buffer can hold up to sixteen 16-bit instructions and will be continuously filled in the background by the prefetch mechanism as the CPU continues to use the already fetched instructions in the buffer. As a result, no wait states are incurred for each opcode fetch, which is a significant performance boost when compared to a one time wait-stated fetch. Wait states are incurred only when there is a program counter (PC) discontinuity such as a branch, function call, and so forth.
Table 3-5 provides some real-world examples of the code efficiency that can be expected on two different classes of C2000 flash devices.
Part Number | Device Properties | 32-Bit Float Math | 16-Bit If-Then-Else | ACI Motor Signal Chain |
---|---|---|---|---|
TMS320F2838xD/S TMS320F2837xD/S |
|
|
|
|
TMS320F28004x TMS320F28002x |
|
|
|
|
TMS320F28003x |
|
|
|
|
TMS320F280013x TMS320F280015x |
|
|
|
|
While the efficiency of program code executing from flash has been considered thus far, there also exists a 128-bit data cache. Users can enable this to increase the flash data read performance. When the CPU requests data from a flash address, the flash wrapper will store entire 128-bits of Flash data (aligned) in this cache instead of simply providing the requested address’s data to CPU. The CPU can access the remaining data in this cache without incurring any wait states. This data cache gets flushed and refilled when there is a cache miss.
Finally, there is also an Error Correction Code (ECC) value for each 64-bits of flash memory. The ECC is such that it provides for single bit error correction and dual bit error detection per 64-bits. The ECC is evaluated for correctness before the data is placed into the prefetch buffer with no impact to the access times/latencies mentioned previously. If an uncorrectable error is detected, a non-maskable interrupt is generated to halt normal code execution in parallel to the normal code execution of the CPU. You have the ability to set a threshold for correctable errors to trigger an interrupt to the C28x core as well.