pcawte/AgDev

Timers (or revising clock)

HeathenUK opened this issue · 1 comments

Hi Paul,

Really appreciate all the work you've put into bringing this toolchain up, it's made my work (as someone who prefers C to BASIC or ASM but who struggles with the dated Zilog toolchain) much, much more productive.

At the moment you make use of the MOS centisecond timer (which is at half resolution) in order to provide the underlying "millis" for time.h, which is a neat way of using an existing resource and works perfectly for many uses. However, I'm working on porting my audio demo code to your toolchain and that depends on much tighter timers (for me, it needs to be at least ~50us per tick).

Would you be willing to consider adapting Jeroen's existing ez80f92 timer code (here and here) to offer a higher resolution underlying timebase? Being selfish as I say it'd be great if clock() could return a figure based around the microsecond range (albeit at a lowish resolution ticking up by 25 every 25us or similar).

Regards,

Greg

Late addendum: I've just noticed that the underlying CE toolchain has fairly full timer control, but clearly targeting a different register map.