CFM Operation

6.4.3.1Setting the CFMCLKD Register

Prior to issuing any program or erase commands, CFMCLKD must be written to set the Flash state machine clock (FCLK). The CFM module runs at the system clock frequency ⎟ 2, but FCLK must be divided down from this frequency to a frequency between 150 kHz and 200 kHz. Use the following procedure to set the PRDIV8 and DIV[5:0] bits in CFMCLKD:

1.If fSYS ⎟ 2 is greater than 12.8 MHz, PRDIV8 = 1; otherwise PRDIV8 = 0.

2.Determine DIV[5:0] by using the following equation. Keep only the integer portion of the result and discard any fraction. Do not round the result.

fSYS

DIV[5:0] = 2 x 200kHz x (1 + (PRDIV8 x 7))

3. Thus the Flash state machine clock will be:

fSYS

fCLK = 2 x (DIV[5:0] + 1) x (1 + (PRDIV8 x 7))

Consider the following example for fSYS = 66 MHz:

DIV[5:0] =

=

fSYS

2 x 200kHz x (1 + (PRDIV8 x 7))

66 MHz

= 20

400 kHz x (1 + (1 x 7))

fCLK =

 

fSYS

 

 

2 x (DIV[5:0] + 1) x (1 + (PRDIV8 x 7))

 

=

 

66 MHz

= 196.43 kHz

 

 

 

2 x (20 + 1) x (1 + (1 x 7))

 

 

 

 

So, for fSYS = 66 MHz, writing 0x54 to CFMCLKD will set fCLK to 196.43 kHz which is a valid frequency for the timing of program and erase operations.

6-18

MCF5282 User’s Manual

MOTOROLA

Page 160
Image 160
Motorola MCF5282, MCF5281 user manual Setting the Cfmclkd Register, Thus the Flash state machine clock will be