Timer Modules and Counters

Can I use the Timer modules on the PIC18F8520 in my custom code?

**Yes, all five timers can be available for you to use in your code.

Timers 1-4 are available by default.

Timer 0, however, is used by the Generate_Pwms() function if you use ifi_library.lib or FRC_library.lib. These libraries use Timer0 to synchronize any PWM outputs generated by the User processor to make sure they avoid any SPI interrupts.

If you want to use Timer0 yourself, then you can replace ifi_library.lib/FRC_library.lib with ifi_alltimers.lib/FRC_alltimers.lib in the project.

A white paper with an example of using a timer can be found here, http://www.ifirobotics.com/docs/timers_white_paper_2004-jan-14.pdf.**

Any recommendations for a counter (about 6000 counts/sec) to attach to a 500 count/rev, bidirectional binary motor encoder?

We do not have anything already setup. You will just have to use Interrupts and the available resources on the microprocessor.**