dsPIC33A Oscillator Module Deep Dive

Clock Selection Example

Last modified by Microchip on 2026/10/19 09:16

   Overview  Application Example   

Click Play ► to listen to commentary on selecting a Reference Clock and Monitor Clock source:

clock selection example

To configure the Clock Monitor, two clock sources must first be selected:

  • The reference clock, selected using the WINSEL field
  • The monitored clock, selected using the CNTSEL field

In this example using Clock Monitor 2, or CM2:

  • CM2SELbits.WINSEL = CLKGEN2  selects CLKGEN2 as the Reference Clock
  • CM2SELbits.CNTSEL = CLKGEN11 selects CLKGEN11 as the Monitor Clock

The reference clock defines the timing of the measurement window, while the monitored clock is the signal being measured and evaluated.

During each measurement window, the monitored clock cycles are accumulated and later compared against programmable threshold limits to detect drift or fault conditions.

Both Window Select (WINSEL) and Count Select (CNTSEL) support a wide range of internal and external clock sources, providing flexibility for monitoring different parts of the clock system.