UPC EETAC Bachelor's Degree in Telecommunications Systems and in Network Engineering EEL

 

 

Basic concepts on TMR2 peripheral

L12


A timer with hardware parallel load

1. Architecture and configuration bits

Study peripheral timer TMR2 architecture and configuration possibilities.

  1. Search for the peripheral section in the microcontroller datasheet. 
  2. Analyse the peripheral's schematic or block diagram in Fig. 1. Determine what is its main characteristic compared with TMR0.
  3. Determine its design equation on how to use it in our applications.

TMR2 module

Fig 1. Hardware components (a kind of RTL view) of the TMR2 of the Microchip PIC18F46K22.

 

TMR2 discussion

equation

Fig 2. Interpretation of TMR2 architecture using CSD conventions. Thus, a var_TMR2_flag is generated after a timing period TP.

 

2. Example project: 18.5 s timer driven by the internal TMR2 time-base

- Timer_LCD_TMR2 (design phase #4 of the tutorial 18.5 s in P12)