/********************************************************************************/
/** Timer2: Measurement of the PWM (duty cycle/frequency)                      **/
/********************************************************************************/
/** Two boards are necessary for this example:                                 **/
/**  - 1st board: flash this example -> master board                           **/
/**  - 2nd board: flash the CCU6_PWM_Generation example -> slave board         **/
/** Connect P1.2 of the master board with one of the PWM output pins of the    **/
/** slave board.                                                               **/
/**                                                                            **/
/** Measuring the low part of the PWM:                                         **/
/** Timer2 starts counting with a falling edge on P1.2                         **/
/** Timer2 captures on the rising edge on P1.2 (PWM low phase, capDC)          **/
/**                                                                            **/
/** Measuring the period of the PWM:                                           **/
/** Timer2 still runs from previous falling edge                               **/
/** Timer2 captures on the falling edge on P1.2 (PWM period, capPer)           **/
/**                                                                            **/
/** Always one period is skipped in order to reprogram the edge detection of   **/
/** the Timer2.                                                                **/
/**                                                                            **/
/** Max. PWM period is 1.6ms (625Hz)                                           **/
/** @ 1kHz PWM frequency (1ms) the min. recognizable DC is 0.3%, max. 99.8%    **/
/********************************************************************************/
/**         start          capture   capture                capture            **/
/**         Timer2         Timer2    Timer2                 Timer2             **/
/**       -----                --------              ---------                 **/
/** P1.2       |              |        |            |         |                **/
/**            :--------------:\       :------------          :------...       **/
/**            :    capDC     : \      :\                     :    capDC       **/
/**            :<------------>:  \     : \                    :<-----...       **/
/**            :                  \    :  \                   :                **/
/**            :     PWM_Capture() ISR :   \                  :                **/
/**           (captured on rising edge):    \                 :                **/
/**            :                       :     \                :                **/
/**            :    capPer             :      \               :    capPer      **/
/**            :<--------------------->:       \              :<-----...       **/
/**                                             \                              **/
/**                                      PWM_Capture() ISR                     **/
/**                            (captured on  falling edge)                     **/
/********************************************************************************/