2.1.1 Op amp and DAC
The op amp is configured as a standalone general purpose operational amplifier. As the error amplifier configuration needed for proper feedback regulation in buck converters is specific for this use case, there is no internal functionality for this. To implement the external feedback network, the negative input of the op amp is configured as a pin input, and the output needs to be enabled. The positive input is internally connected to the DAC output.
The regulation process is active, meaning that the peripheral needs to be configured in “always on” mode.
The DAC is used to set the reference voltage for the error amplifier. The value for this voltage is set to provide good headroom in both directions in the op amp. A good starting point is to set it close to half of the supply voltage of the microcontroller.