Hi Ian;
That's what I did for all the other timing intervals. I have several 40uS and longer, and one is so long I do all my busy work and servicing routines for the entire program loop while waiting for its interrupt.
The problem was with very short delays. With an 8MHz clock there's only 8 clock cycles for a 1uS delay - ANY little loop and compare statements eat that right up and many more besides! Even Mark's "Waitus" statement takes 1.875uS to get started.
I can live with ~2uS for the low end, so I see a path going the Waitus route. After the initial 1.875uS overhead, it actually increments in 500ns steps. I've also got to add perhaps 5 clock cycles to raise a port pin, so I'm getting closer to 2.5uS overall.
While field selection of the delay is needed, stability is the most important aspect - It's replacing a previously analog function.
Thanks and Best Regards,
Ken
↧