programmable timer / clock generator
Most microcontrollers have a PMW/Counter logic block available that runs independently of the CPU. Check the datasheet to see if that's available on your micro, it's free and easy.