I only have a 16-bit timer available to run in low-power mode, and I would like to have a tick rate of 1 ms when running normally.
However, my application will from time to time have long idle periods where it will onlywake up a couple of times per day.
Is it possible to run the tickless timer at a slower rate than the system tick, and not go into deep-sleep unless the xExpectedIdleTime is more than one count on the tickless timer, which for instance could be running at 1Hz?
Are there any recommended ways for sleeping for extended periods of time?
Yes - if you are providing your own tickless idle implementation then
you can either:
Have one clock that provides both the normal tick interrupts, and is
re-programmed before sleep to generate the long sleep time, and after
sleep to set the clock back to the tick frequency.
or
Use two clocks, say clock A and clock B. Then set clock A to
generate the tick interrupt, before sleep stop clock A and set clock B
to wake you up after the long sleep, on wake restart clock A so it
generates the regular ticks again.