Clock Configuration DG32 (403)
Establish the correct clock tree
Step 1: Find the external high-speed crystal oscillator (HXTAL), modify the value defined by the macro, here it is 8MHz
Step 2: Connect the external clock to the system clock, and open the system you want to implement Clock, here is 168MHz
Step 3: Modify the system function to output the system clock correctly
/* CK_PREDIV0 = (CK_HXTAL)/5 *8 /10 = 4 MHz */
here
CK_PREDIV0 =8/2 *10/10 = 4 MHz
/* CK_PLL = (CK_PREDIV0) * 42 = 168 MHz */
此处
CK_PLL = 4 * 42 = 168 MHz
Step 4: Modify the frequency division coefficients of AHB, APB2 and AB1