What is Postscaler in PIC microcontroller?

What is Postscaler in PIC microcontroller?

The prescaler and postscaler are fairly common in most of the mid-range and advanced microcontrollers. The postscaler concept is much similar to the prescaler. Only here, the value of the prescaler determines the number of times the timer register has to overflow to produce an interrupt.

What is a Postscaler?

Postscaler: A circuit that slows the rate of the interrupt generation(or WDT reset)from a counter/timer by dividing it down.

Which timer is used for Postscaler?

Timer2 is an 8-bit timer with a prescaler, a postscaler, and a period register. Using the prescaler and postscaler at their maximum settings, the overflow time is the same as a 16-bit timer. Timer2 is the PWM time-base when the CCP module(s) is used in the PWM mode.

What is the use of PR2 reg in Timer2?

PR2 is a readable and writable register and initialized to FFh upon Reset. Register TMR2 is used to store the “initial” count value (the value from which it begins to count). Register PR2 is used to store the “ending” count value (the maximum value we need/want to reach).

What is the difference between timer and counter?

It is a device that counts down from a specified time interval and used to generate a time delay, for example, an hourglass is a timer….Difference between a Timer and a Counter.

Timer Counter
A timer uses the frequency of the internal clock, and generates delay. A counter uses an external signal to count pulses.

What is the difference between Timer and counter?

What is the value of prescaler which should be used so that the Timer has maximum Timer period?

For example, one cannot (without some tricks) achieve 1 µs resolution and a 1 sec maximum period using a 16-bit timer. In this example using 1 µs resolution would limit the period to about 65ms maximum. However the prescaler allows tweaking the ratio between resolution and maximum period to achieve a desired effect.

How many ports are present in pic18f4520?

It has total 40 pins. Out of these 40 pins, 34 pins can be used as input output pins. These pins are grouped into five which are called PORTS denoted by A, B, C, D and E….USE INPUT OUTPUT PORTS OF PIC18F452 MICROCONTROLLER.

Bit0 RB0 Bit4 RB4
I/O I/O
TTL/ST TTL
Interrupt on change

How is PR2 value calculated?

  1. Case-1 For 25% Duty cycle. ii) Value to be loaded in Duty cycle register (CCPRxL) = %Duty Cycle x PR2 Value.
  2. = 0.25 x 249. = 62.25.
  3. ii) Value to be loaded in Duty cycle register (CCPRxL) = %Duty Cycle x PR2 Value.
  4. ii) Value to be loaded in Duty cycle register (CCPRxL) = %Duty Cycle x PR2 Value.
  5. Case- For 75% Duty cycle.

What’s the difference between A prescaler and a postscaler?

The prescaler slows down how fast the counter counts. The postscaler doesn’t slow the counter, just how often it generates interrupts. This is clearly shown in the timer block diagram.

How is the PWM used in a PIC MCU?

In PIC MCU the PWM is a common peripheral and some version of PIC MCU has more than on the PWM module. The PWM peripheral is used to generate a digital signal with a user-defined period. Also, the user can configure the duty cycle (“ON” time) that can be used to encode a message or control the amount of power supplied to electrical devices.

How to calculate the PWM duty cycle in Pic?

The PWM duty cycle is specified by writing to the CCPR1L register and to the CCP1CON<5:4> bits (Up to 10-bit resolution). The CCPR1L contains the eight MSbs and the CCP1CON<5:4> contains the two LSbs. This 10-bit value is represented by CCPR1L:CCP1CON<5:4>. PWM Duty Cycle = (CCPR1L:CCP1CON<5:4>) • TOSC • (TMR2 Prescale Value) Where,

What can pulse width modulation ( PWM ) be used for?

Pulse width modulation (PWM) is not only used in communication systems but also used in high current driving applications like motor drivers, LED drivers, etc. In PIC MCU the PWM is a common peripheral and some version of PIC MCU has more than on the PWM module.