The SYSOSC can be trimmed to a
user-trimmed value of 16 MHz or 24 MHz, if desired. Trimming is accomplished by
manipulating the fields in the SYSOSCTRIMUSER to achieve a target frequency of 16 or
24 MHz. To trim the SYSOSC, the SYSOC can be brought out externally to a pin using
the CLK_OUT unit so that it can be measured. Follow the procedure below to
derive the user trim values. Once trimmed values are obtained, they can be
programmed in to the flash memory of the device to be recalled later. Each device
must be trimmed individually for accuracy. SYSOSC can also be trimmed internally by
using the frequency clock counter (FCC).
Trim procedure using CLK_OUT with frequency correction loop (FCL) disabled (No ROSC resistor)
- Enable the CLK_OUT unit and select SYSOSC as the clock source, following the instructions in the CLK_OUT
section
- Set the SYSOSC frequency to BASE to start (ensure that the FREQ field in the SYSOSCCFG register is set to 0h for BASE), and leave the FCL mode disabled
- Program an initial tuning for the target frequency in the SYSOSCTRIMUSER register:
- Set the RCOARSE trim field in the SYSOSCTRIMUSER register to mid-range
- Set the RFINE trim field in the SYSOSCTRIMUSER register to mid-range
- Switch SYSOSC to the user-trimmed frequency by selecting USER in the FREQ field of the SYSOSCCFG register
- Measure the SYSOSC frequency at the CLK_OUT pin
- Switch SYSOSC back to BASE frequency by selecting BASE in the FREQ field of the SYSOSCCFG register
- Adjust the SYSOSCTRIMUSER parameters to close on the target frequency:
- Set the target frequency (16 or 24 MHz) in the FREQ field of the SYSOSCTRIMUSER register
- Adjust trim parameters to achieve 16 or 24 MHZ based on the selection made in step 7a
- Increasing the CAP trim field in the SYSOSCTRIMUSER register will reduce the SYSOSC range. For 24 MHz, select CAP=0, and for 16 MHz select CAP=1
- Increasing the RCOARSE trim field in SYSOSCTRIMUSER will reduce the frequency in large steps of approximately 1 MHz
- Increasing the RFINE trim field in SYSOSCTRIMUSER will decrease the frequency in small steps of approximately 100 kHz
- Repeat steps 4 through 7 until the desired accuracy has been achieved
- Save the resulting SYSOSCTRIMUSER value for recall
Trim procedure using CLK_OUT with frequency correction loop (FCL) enabled (ROSC resistor present)
- First, complete the FCL disabled trim procedure (defined above) to obtain starting values for the CAP, RCOARSE, and RFINE trim fields in the SYSOSCTRIMUSER register
- Increase the RCOARSE value by 02h from the value obtained in Step 1
- With CLK_OUT still enabled (SYSOSC as the source for CLK_OUT), ensure that the FREQ field in the SYSOSCCFG register is set to 0h for BASE, and enable the FCL mode by setting the SETUSEFCL
bit in the SYSOSCFCLCTL register
- Set the RDIV trim field in the SYSOSCUSERTRIM register to mid-range
- Switch SYSOSC to the user-trimmed frequency by selecting USER in the FREQ field of the SYSOSCCFG register
- Measure the SYSOSC frequency at the CLK_OUT pin
- Switch SYSOSC back to BASE frequency by selecting BASE in the FREQ field of the SYSOSCCFG register
- Adjust trim parameters to close on the target frequency:
- Increasing the RDIV trim field in the SYSOSCTRIMUSER register will increase the frequency in small steps of approximately 50 kHz
- Continue increasing or decreasing RDIV if the frequency is in saturation (not appearing to adjust)
- Repeat steps 5-8 until the desired accuracy has been achieved
- Save the resulting SYSOSCTRIMUSER value for recall
Note: SYSOSCTRIMUSER parameters only
take effect when switching to the USER frequency. Once USER frequency is
selected, changes to SYSOSCTRIMUSER have no effect. To refresh the USER values,
first switch to BASE frequency, then update SYSOSCTRIMUSER, and then switch
SYSOSC back to BASE frequency.