Programming with on-chip Timers/Counters