

Let us assume that we are using the value of 50,000 for TIM2_ARRH/L as in the last post then by setting TIM2_CCR1H/L to 25,000 will give a duty cycle of 50%. TIM2_ARRH/L are used to determine the period of the signal whilst TIM2_CCR1H/L are used to determine the duty cycle of the signal. These two registers are analogous to the TIM2_ARRH and TIM2_ARRL registers. TIM2_CCR1H & TIM2_CCR1L – Capture/Compare Register 1 High/Low TIM2_CCMR1 – Capture/Compare Mode Register 1.TIM2_CCER1 – Capture/Compare Enable register 1.

