Update 2: Even with a Totem-pole there was some problems… After some investigation I was hit by the truth, NEVER FORGET COUPLING CAPACITOR… The first schematics is almost correct, I just need to add some big capa on the VCC, in fact the current on the first switch was too high and put the PSU in protection mode…
Update: It seems, without Totem-pole and the FET gate directly on the PIC pin the system is really unstable, with short-cut on the PWM and other black magic troubles, so even if it works most of the time, I’ll go with a totem-pole design.
I made some tests on this project with a breadboard. When tere is no load on the output the 100kHz PWM works fine, but when I put an heavy load (under about 50ohm) the PWM collapse and the switching becomes really unstable. I didn’t investigate too much but I think I was too optimistic on the Gate driving power of the pic18f and forgot to put a totem-pole like driving circuitry.
On the other hand I tested with an old sample of dscpi30f3010 I have. And it works great, you should not that this DSPic family have specific PWM output for Motor driving with a Sink/Source Current of about 25mA. So I’ll go with it and push the source code when it’ll be ready. I’ll modify the schematic to reflect that and do an other version with a totem pole and a little PIC18F.
Stay tuned ;)