Hi,
I think if you are learning you should not go that much complexity at first just for 15 sec delay.
You can use the below snippet,
In the function:
TSCR1 = 0x80;
TSCR2 = 0x07;
TCx = TCNT + 0x7270E; // i think bus clock 4 MHz
// Now disable all interrupts
__asm SEI;
Select respective channel in TIOS
Select respective interrupt in TIE
//Enable all interrupts
__asm CLI;
In Interrupt routine:
//Clear respective flag from TFLG1 without touching other flags
TCx = TCNT + 0x7270E;
--- > And enjoy 15 sec delay repeatedly.
Note: But you should follow the instructions of CompilerGuru also. Then only you can achieve it.
Regards
Xzidax