What is the best way to determine the power consumption of a microcontroller? Need to select the right voltage regulator to supply 3.3V for PIC32MX795F512H.
Microcontroller current consumption is dependent on the software so if you actually want to know it, you need your software first.
But if you just want to size a regulator then the current consumption for various clock speeds and generalized configurations should be listed somewhere in the datasheet under electrical specifications.
There are standard power estimation tool boxes from MCU vendors (ST has STM Cube MX). You can find one for your microcontroller from MCU websites. I would say it is better to start with those tools to get a fair idea in least amount of time.
The current consumption depends on the clock frequency you operate at. Type of instructions that is being executed, the mode of operation (active, low power,sleep etc), the external loads attached such as sensors or LEDs, number of peripherals enabled (ADC, UART, WDT, Timers, Comparators, Opamps, ECC, etc).
The current consumption also varies depending on the operating temperature and schedule of the tasks.
So, estimating the MCU power consumption takes a decent amount of time, software knowledge and operating conditions.
If the regulator is only supplying the MCU then, you can choose the one which can supply the 120% theoretically estimated maximum current.
Choosing a slightly higher capacity LDO won't harm if you have advantage of reusing the existing LDO or in terms of leakage current.