There is a newer version of this page. You can find it here.
Preface
This is a collection of soft mods for the generic I/Os of a Linux based PLC. It can be used for example with Raspberry Pi, Beagle Bone Black. The Linux Scheduler and some specific circuits are used to implement different things, which would require more complicated hardware, otherwhise.
GPIO PWM
This is a soft PWM driver, which makes use of a standard digital Output Pin. The Interval is constantly changed, to achieve the precise timing which is necessary to fulfill the requirements of the specified duty cycle. It has to be used from a separate, high priority task, which drives the output. But as the interval of this task constantly changes, you should best not add anything else to this task.