I roughly calculated like this:
From the datasheet IR8342
Max Vgs 20V
View attachment 373375
Then the power rate of the resistor
View attachment 373378
If i use 0805 resistor with 0.1W, then the max current will be at 100/20 = 5mA. So i need minimum R = 20/5 = 4kOhm
If i use 1210 resistor with 0.25W, then the max current will be at 250/20 = 12.5mA. So i need minimum R = 20/12.5 = 1.6kOhm
If i use 2512 resistor with 0.5W, then the max current will be at 500/20 = 25mA. So i need minimum R = 20/25 = 800Ohm
But the capacitance is only 1000pF
View attachment 373379
If the Voltage 20V then for 1000pF, it have charge Q = CV = 1000x20 = 20nC.
Lets say 500mA will break those resistor, then the time to discharge roughly will be around t = q/i = 20/500 = 40nsec.
This range of time wont break the resistor.
Practically just use whatever resistance you have at hand, will be enough to discharge those 1000pf.
But then we need to consider the rp2040 electrical properties of the gpio.
View attachment 373383
It is pull down by between 50-80k ohms. Our pulldown mosfet will be paralled by this.
So don’t use resistor >50kOhm. Because using aournd this value, will reduce the resistance significantly, which might split the voltage (voltage divider) enough so that the high voltage will be decrease into the range of the low voltage.
So in conclusion, just pick any resistor you have at hand approximately below 5kOhm.