Hello Felipe and Ian,
To further clarify, the actual bus frequency will be dependent on the trim setting for the internal reference, which has a trim range of 31.25 to 39.06 kHz. The DCO frequency will be 512 times this value, i.e. 16 - 20 MHz. The bus frequency will then be determined by the BDIV factor and the additional divide-by-2 stage, as previously noted. So the following bus frequency ranges would apply.
BDIV Bus frequency range:
00 8 - 10 MHz
01 4 - 5 MHz
10 2 - 2.5 MHz
11 1 - 1.25 MHz
To achieve a bus frequency of 5.0 MHz would require a BDIV setting of 01, and a reference trim frequency of 39.06 kHz. Trimming is essential for most applications as the internal reference has a very wide tolerance (37kHz +/-25%). The trim calibration process is normally done when the code is programmed. Note that the default (and factory programmed) trim frequency for this device is actually 31.25 kHz, so would need to be altered.
The trim calibration setting will be stored in flash memory at address 0xFFAF for main trim value, and 0xFFAE for fine trim bit. The application code wll need to transfer these to the corresponding ICS registers.
Regards,
Mac