bigfarmerdave
New Member
Ok, I'm still learning this micro controller stuff. You all have pointed me in the direction of some very informative reading (which I really appreciate) but I still have a few fuzzy areas that I need cleared up.
In reviewing options, I see that there are a number of solutions to use as a timing circuit for a micro controller. I'm using a PIC16F876 and am wondering what to use as my timing circuit. It looks like a quartz crystal would be a stable solution and appears that it is connected across pins 9 and 10, OSC1 and OSC2 respectively, obviously with some supportive circuitry (caps) as well. My question is, how do you determine what frequency of crystal to use? This particular PIC is rated at 20MHz so I'm assuming I would want to use a 20MHz crystal. What advantage is there to using a lower frequency crystal?
I've read through the PIC data sheets and am trying to get a handle on TIMER0, TIMER1, and TIMER2 as well. It looks like TIMER0 & TIMER1 are software selectable internal or external and that it can be set to Timer Mode or Counter Mode. Timer Mode is incremented with every instruction cycle and Counter Mode is incremented on ever rising or falling edge of the T0CK1 pin. What would be the benefits of each of these modes? I assume that every instruction begins exactly 200 ns after the last one when using a 20MHz crystal?
In reviewing options, I see that there are a number of solutions to use as a timing circuit for a micro controller. I'm using a PIC16F876 and am wondering what to use as my timing circuit. It looks like a quartz crystal would be a stable solution and appears that it is connected across pins 9 and 10, OSC1 and OSC2 respectively, obviously with some supportive circuitry (caps) as well. My question is, how do you determine what frequency of crystal to use? This particular PIC is rated at 20MHz so I'm assuming I would want to use a 20MHz crystal. What advantage is there to using a lower frequency crystal?
I've read through the PIC data sheets and am trying to get a handle on TIMER0, TIMER1, and TIMER2 as well. It looks like TIMER0 & TIMER1 are software selectable internal or external and that it can be set to Timer Mode or Counter Mode. Timer Mode is incremented with every instruction cycle and Counter Mode is incremented on ever rising or falling edge of the T0CK1 pin. What would be the benefits of each of these modes? I assume that every instruction begins exactly 200 ns after the last one when using a 20MHz crystal?
Last edited: