As mentioned in my top comments, we want an MRE.
But, 24 hours is a long time for an interval timer. So, I don't think this can be done purely with the timer hardware as the timer compare registers are [AFAICT] limited to 16 bits. Even at one interrupt / second, this is 86400 (0x15180) interrupts which is beyond 16 bits
We'll have to do this in S/W [with a "tick" counter]. This is how most systems do it.
Here is an example. It assumes that the timer ISR is called once per millisecond [adjust to suit]:
#define TICKS_PER_SECOND 1000LL
uint64_t tick_count = 0; // monotonic tick counter
uint64_t tick_interval = TICKS_PER_SECOND * 24 * 60 * 60; // ticks for 1 day
uint64_t tick_fire = tick_interval; // time of next callback
void
timer_ISR(void)
{
// advance tick counter
tick_count += 1;
// have we hit the required interval?
if (tick_count >= tick_fire) {
// advance to next interval
tick_fire = tick_count + tick_interval;
// NOTE: doing that first allows the callback function to adjust the
// firing time of the next event
// called once every 24 hours ...
timer_24_hours();
}
}