Are you thinking of a software PWM? Quite easy to do really.

http://darreltaylor.com/DT_INTS-14/SPWM.html