21.8.1.1.3 Workflow

  1. Create a EXTOSC32K module configuration struct, which can be filled out to adjust the configuration of the external 32KHz oscillator channel.
    struct system_clock_source_xosc32k_config config_ext32k;
    
  2. Initialize the oscillator configuration struct with the module's default values.
    system_clock_source_xosc32k_get_config_defaults(&config_ext32k);
    
    Note: This should always be performed before using the configuration struct to ensure that all values are initialized to known default settings.
  3. Alter the EXTOSC32K module configuration struct to require a start-up time of 4096 clock cycles.
    config_ext32k.startup_time = SYSTEM_XOSC32K_STARTUP_4096;
    
  4. Write the new configuration to the EXTOSC32K module.
    system_clock_source_xosc32k_set_config(&config_ext32k);
    
  5. Create a DFLL module configuration struct, which can be filled out to adjust the configuration of the external 32KHz oscillator channel.
    struct system_clock_source_dfll_config config_dfll;
    
  6. Initialize the DFLL oscillator configuration struct with the module's default values.
    system_clock_source_dfll_get_config_defaults(&config_dfll);
    
    Note: This should always be performed before using the configuration struct to ensure that all values are initialized to known default settings.
  7. Write the new configuration to the DFLL module.
    system_clock_source_dfll_set_config(&config_dfll);