17.4 Enabling a Peripheral
In order to enable a peripheral that is clocked by a Generic Clock, the following parts of the system needs to be configured:
- A running Clock Source as selected in the OSCCTRL Module
- A clock from the Generic Clock Generator (GCLK.GENCTRLn.SRC), must be configured to use one of the running Clock Sources, and the Generator must be enabled.
- The Peripheral Channel that provides the Generic Clock signal to the designated peripheral "m", (i.e., PCHCTRLm), must be configured to use a running Generic Clock Generator (i.e., PCHCTRLm.GEN), and the Generic Clock must be enabled.
- The user system bus interface of the peripherals are enabled by default on reset, (i.e., MCLK.CLKMSK[0,1,2].MSKn=1), and doesn't need to be unmasked to enable it unless disabled at run time by the users software and the user needs to access the peripheral once again. In that case the user must re-enable, unmask, in the Main Clock Controller (MCLK.CLKMSK[0,1,2].MSKn=1). If this is not done the peripheral in question registers will read all '0's and any writing attempts to the peripheral will be discarded.