
A31G22x Clock Setting Guide
5. Flash Access Timing
23
5.
Flash Access Timing
5.1.
Wait Time Configuration
Users of A31G22x can set the Wait-time in WAIT field (CFMC_CFG[10:8]) of the CFMC_CFG register
after setting the system main clock. The Wait-time settings implies the Flash access speed and affects
system performance.
Users can set the Access Timing of Code Flash Memory and Data Flash Memory to the value between
0-wait and 5-wait. In addition, the Access Timing can be calculated by the following formula depending
on the system main clock (MCLK = HCLK) and the Wait time.
𝐹𝑙𝑎𝑠ℎ 𝐴𝑐𝑐𝑒𝑠𝑠 𝑇𝑖𝑚𝑖𝑛𝑔 =
𝐻𝐶𝐿𝐾
1 + 𝑊𝐴𝐼𝑇
≤ 20𝑀𝐻𝑧
Table 7. Flash Wait Time Values
Register Field
WAIT Value Description
Max. Flash Access
Speed
CFMC_CFG<WAIT>
or
DFMC_CFG<WAIT>
0
Flash access in 1 cycle (0-wait)
Up to 20MHz
1
Flash access in 2 cycles (1-wait)
Up to 40MHz
2
Flash access in 3 cycles (2-wait)
Up to 48MHz
3
Flash access in 4 cycles (3-wait)
Up to 48MHz
4
Flash access in 5 cycles (4-wait)
Up to 48MHz
5, Others
Flash access in 6 cycles (5-wait)
Up to 48MHz
5.2.
F/W Configuration
Figure 12 shows an example code that sets Flash Access Timing. Set the Flash Wait Delay to 2 for the
system having 48MHz of MCLK. For this case, the Flash Access Speed is 16MHz as calculated below:
48MHz / (1 + 2) = 16MHz (62.5ns)
Figure 12. Flash Access Timing F/W Configuration