In Section 10.1 we showed how to configure timer TIM2 to control the LCD back light. In this example, we show how to enable the TIM2 interrupt. Since this builds upon work you have seen before, we present a basic outline in Listing 11.2. In addition to configuring the timer, it is necessary to configure the NVIC for the appropriate interrupt vector and to enable the timer to generate interrupts. Timers can generate interrupts on multiple conditions here we choose to trigger interrupts whenever the counter is updated. Finally,
we need a handler which, at a minimum, clears the pending interrupt