Will this schematic will work fine.......?
1. When uC pin is HIGH, then Comparators output HIGH (near 24V I assume), hence P-ch MOS will be OFF and N-ch MOS will be ON.
2. When uC pin is LOW, then Comparators output LOW (sinks current), VGS
will be at around -12V hence P-ch MOS will burn as Max. VGS
allowed is -4V and N-ch MOS will be OFF.
To answer in short - no it will not work, correct me if I'm wrong.
and what should best PWM freq ...??
Well, frequency in Your application is not that much important as inductance of the motor will smooth PWM signal out. OK, have You ever seen DIY robot arms with analog servos? Did You notice how robot arm jitters under? Partly that is because analog servos work at 50Hz frequency, in other words, they reposition 50 times per second. Jittering is lower in digital servos which reposition at higher frequencies. As mentioned before, in Your application probably You would see much difference between 50Hz PWM and 1kHz PWM. I would most likely go for PWM based on 8-bit timer with no pre-scaler, so if I had uC running at 1MHz then my PWM would run at = 1000000Hz / 256 = 3906.25Hz