I am trying to learn to program MCUs for driving this MOSFET module.

https://www.electronicscomp.com/5-3...P-f7TWdUcEZBANgFEG1Ekoog8GPirvJwaAuLVEALw_wcB
I am now trying to program a rasberry Pi Pico with Micropython.
The MOSFET switches power ON and OFF power to a DC electromagnet at frequencies 0.1, 7, 14, 21, 28, 35 and 42 Hz. I also plan to make it work on other higher frequencies. The load current to be switched will be around 4 to 4.5 Amps DC at 12 Volts DC. The MOSFET could switch ON at 3.3 Volts output from the Pi Pico Pins.
My doubt here is that - since the Pi Pico can produce a PWM output should I use that function in the program to control the MOSFET using PWM or I can use the toggle() pin command to switch ON and OFF a pin and use that to control the MOSFET. I only need a 50 percent duty cycle for all frequencies and I will not be changing the duty cycle so the toggle() function works fine.
I like to know for this application, using the toggle function to switch ON and OFF that is using digital signals to drive the MOSFET would be a good idea or should I use the pwm function from the Pi Pico. What difference would it make performance wise. Do I need additional components like DAC or something to filter out noise.
Thanks.

https://www.electronicscomp.com/5-3...P-f7TWdUcEZBANgFEG1Ekoog8GPirvJwaAuLVEALw_wcB
I am now trying to program a rasberry Pi Pico with Micropython.
The MOSFET switches power ON and OFF power to a DC electromagnet at frequencies 0.1, 7, 14, 21, 28, 35 and 42 Hz. I also plan to make it work on other higher frequencies. The load current to be switched will be around 4 to 4.5 Amps DC at 12 Volts DC. The MOSFET could switch ON at 3.3 Volts output from the Pi Pico Pins.
My doubt here is that - since the Pi Pico can produce a PWM output should I use that function in the program to control the MOSFET using PWM or I can use the toggle() pin command to switch ON and OFF a pin and use that to control the MOSFET. I only need a 50 percent duty cycle for all frequencies and I will not be changing the duty cycle so the toggle() function works fine.
I like to know for this application, using the toggle function to switch ON and OFF that is using digital signals to drive the MOSFET would be a good idea or should I use the pwm function from the Pi Pico. What difference would it make performance wise. Do I need additional components like DAC or something to filter out noise.
Thanks.
