afb
Member
I'm making a variable period timer from 10 seconds up to 10 minutes or so - required resolution of one second. Happy with the accuracy of using the time variable, but finding a problem with starting the the timing period. The command time=0 sets the time register to zero but the overall function seems to be free-running so the first increment of the time variable can occur (I find by experiment) anything from immediately up to one second later depending on just when the "time=0" command was executed. Not an issue at the 10 minute end of things but a large error in 10 seconds! I can improve the situation slightly by running at 32MHz to reduce the error to a maximum of half a second but would prefer this to be a tenth of a second or less.
Starting a PWM stream at 100Hz (possible at 4MHz) - presumably derived from the same internal timer - and counting/dividing its pulses by 100 from the moment of button press works ok, but robs me of an input and output on a project that already uses all the available 08M2 legs (incl a "disconnect" SERIN). I'd prefer not to do it this way with a 14M2 on the grounds of size.
ANY IDEAS ?
Starting a PWM stream at 100Hz (possible at 4MHz) - presumably derived from the same internal timer - and counting/dividing its pulses by 100 from the moment of button press works ok, but robs me of an input and output on a project that already uses all the available 08M2 legs (incl a "disconnect" SERIN). I'd prefer not to do it this way with a 14M2 on the grounds of size.
ANY IDEAS ?