44.1.4 Peak/Trough Detection

The OPA module can be configured as peak or trough detector by connecting an external capacitor to the OPAxOUT(1) pin. To configure the OPA to operate in peak or trough detect modes, hardware-controlled override must be enabled by setting the OREN bit. The HWCH and HWCL bits may be used to configure the OPA modes of operation, depending on the status of the override source. Refer to the Hardware Override Control section for more information.

The PTRES bit can be used to discharge the external capacitor used for peak or trough detection(2). The discharge time depends on the load and the external capacitor being used.

Note:
  1. The peak and trough detect features are only available when using the OPAxOUT (INTOE = 0).
  2. The peak and trough detect capacitor can be discharged by externally connecting the output of the OPA module to VSS or VDD in peak or trough detect modes, respectively.