My question is simple Is it possible to generate PWM via GPIO ??
I will control 4 motor"s speed with RPi
purse time 20ms
maxspeed purse 2ms
minspeed purse 1ms
I heard it can be done just setting string on GPIO
please show me some sample code
Without going any hardware hacking, the GPIO has one PWM output. So with that, you'll only control one motor speed. Even if you do some hardware hacking, it only has 2 PWMs anyway.
And sadly, I can't find the proper documentation for setting the clock frequencys, etc. I've just looked at Gerts code so-far. The BCM ARM peripherals manual seems to be lacking the clock settings (or I've just missed them).
So for 4 motors your really looking at doing in other ways - e.g. connect up an Arduino and use it's PWM outputs, and send high-level commands to it from the Pi.
for some stuff to drive the PWM output (and other GPIO pins)