Is the analogWrite Implementation of PICO hardware or ISR based?

If you'd just like to use PWM for RP2040, try these libraries of mine

  1. RP2040_PWM
  2. RP2040_Slow_PWM

It seems that you're start moving into RP2040, it's better to have a look at and see that there are already many libraries to support RP2040