Timer2 optimised settings

Discussion in 'Embedded Systems and Microcontrollers' started by nnxen, Jan 15, 2015.

  1. nnxen

    Thread Starter New Member

    Dec 22, 2012
    Hi, I'm using timer2 on my 18F4550 as a sample rate timer. I can achieve my desired sample rate through various combinations of the postsclaer, prescaler and PR2 values.

    My question is, is there any advantage to using a particular combination? i.e, its there any optimisation to be gained by ensuring one of these parameters is kept as low as possible?
  2. MagicMatt


    Sep 30, 2013
    Not that I'm aware of, however if you want to use some of the other functions in the PIC that use Timer2, you should check how they work. For example, the PWM module in many PICs ignores the postscaler.