Question about Timer0 interrupts on PIC18 - once the interrupt is triggered, does the timer keep incrementing? Or does it stop until the interrupt is cleared?

Also, really stupid question, but what is the advantage of having a higher clock speed for the PIC? It just goes faster, right? I'm trying to get my ADC code and my LED code to work together - there's no downside to just doing it all at 10 Mhz, right?

Views: 94

Reply to This

Replies to This Discussion

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 flag 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.
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.

tl;dr Trust bro, 10MHz is fast enough/good enough.


© 2024   Created by PML.   Powered by

Badges  |  Report an Issue  |  Terms of Service