Timer0 interrupts in PIC18 - Personal Mechatronics Lab2024-03-29T14:01:26Zhttp://www.pml4all.org/forum/topics/timer0-interrupts-in-pic18?feed=yes&xn_auth=noMight as well try here, even…tag:www.pml4all.org,2014-05-01:6212885:Comment:273212014-05-01T09:00:52.379ZKenny Kimhttp://www.pml4all.org/profile/KennyKim
<p><span><span>Might as well try here, even though I'm using the PIC16, I think it's safe to assume Timer0 works the same. When Timer0 counts to 0xFF and rolls over to 0x00, it will throw an interrupt (assuming you've enabled that and set it up properly) and set a fl</span></span><span><span><span>ag in one of its registers (don't know the name for the PIC18 one) and it will NOT count at all untill you CLEAR that flag. So it's not the interrupt that's stopping the count, it's the overflow flag…</span></span></span></p>
<p><span><span>Might as well try here, even though I'm using the PIC16, I think it's safe to assume Timer0 works the same. When Timer0 counts to 0xFF and rolls over to 0x00, it will throw an interrupt (assuming you've enabled that and set it up properly) and set a fl</span></span><span><span><span>ag in one of its registers (don't know the name for the PIC18 one) and it will NOT count at all untill you CLEAR that flag. So it's not the interrupt that's stopping the count, it's the overflow flag or w/e it's called.</span>
<br />
<span>And higher clock speed = higher instruction cycle speed = more lines of code can run per second = generally faster overall program run time. No downside to doing it at 10 MHz since with PICs the internal instruction cycle speed is 1/4 the clock it's running off of. So 2.5 million instruction cycles per sec means you have 400 ns instruction cycle time.</span><br />
<br />
<span>tl;dr Trust bro, 10MHz is fast enough/good enough.</span></span></span></p>