Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
Posted: Fri Oct 26, 2012 3:08 pm
Start from from (say) a 4MHz clock that's 1us per instruction cycle.
Generate interrupts with one of the timers (probably timer0) at 10kHz.
In the ISR turn LEDs on and off as needed at 100Hz.
That will give you 1% resolution, and ~100 instruction cycles for the code to control the LEDs.
If you need either better resolution or more code you'll need a faster clock.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum