 Okay, in this lab we will use the timer a little bit differently, but we not use the timer like the timer, but as a counter. Then we will count the press of our button, and this press after we count, I don't know, four, five presses, we turn on the LED, for example. Then we will configure now the timer as a counter. Then I will start new project again, a four for one LQFP64 PIM package. And now definitely I need to use the LED as an output, it will be not directly controlled with the timer. But now I need to search for the timer and with the clock source, which can be the external one. The external timer input source. It's here, it's for example on timer one, it's the ETR input, ETR2 in my case. It's on PIN PA P812. Then it's everything from this part. About the clocks, we left this clock configuration in default state. And for the configuration, also this timer frequency now doesn't matter because our clock source is now the, will be the PIN. Then we configure here the timer. Okay, we also can check. This input is on the different side than the PIN, the button, which is PC13. Then don't forget to connect the PC13 with PA12. I will do this little bit, little bit later. Okay, the configuration, the press scale, we can have zero, but the counter period I will put here five. Why not? The input polarity will be not inverted. I think everything is, is okay how we want plan to use this. Then after I confirm five presses, I will toggle with the LED. I need here enable the, the, the interrupt. It will be the update interrupt, which is on the, on the overflow, not break interrupt, no, no trigger. And the communication interrupts are no capture, capture, compare interrupt. The update interrupt is the correct one in this case. I also check my GPO pins. It's configure as push pull. No pull up, no pull down, slow. I check also the timer. It's alternate function. And it will be more than less the input. Then I start the new project. I start to generate this in the, in the file. And I use the timer three project name. Okay. And I can generate, generate my project. Everything is okay. Okay. Now we can look on the, on main, but what is different? Here I need to first build my, my project to allow me to go to definition, but I will search for the timer, timer one in it. We can see that is the basic, basic initialization. It's okay. We also configuring the clock source to set this on the external pane. And this is on the master synchronization, which, which is disabled now. Then from the, from the main, it's no big changes in the, in the MSP. We can search for the PA, PA 12 set as the alternate function for the, for timer one. And we enabling also the, the interrupts. And then we can look into the interrupts section. And here we can found that we have the interrupt handler here. And we're using the HL interrupt handler or so. Then as usual, we need to, to search for the callbacks. We use the same callback like before the period elapsed callback, which we find in the drivers in the timer. And we search for weak and we search for the period elapsed callback. This is the correct one. Okay. This callback we put here and we said the, we says that after we get the entire, we toggle with the lead, then we put here the GPO toggle pin GPO a GPO underscore pin underscore five. This is toggling with my pin. And last part I need definitely to start my timer like before it will be HL team. And we have only basic functionality, but like before with the interrupt. And it will be H team one. Then now we need to compile my code. And I need to connect my ETR pin P812 with the PC13. And for this I look into, into my, my schematics. I know that the PC13 PA P812, I think it was PC13 is here. And PA 12, it's on the maybe opposite side of the header. PA 12, PA 12, it's here. Then I can connect these two pins together. I compile my code. I try to download it into my application, run my code and I will try five presses. I put here five that it will be maybe five plus one, then six. It's working. Sorry about the miss, miscalculation. I always forget the plus one. Then after five presses we get the, the interrupt and we change the state of the pin. Then now you know how to configure this, this pathway also as a counter. In case that you want to count something, some policies, then this is the example for you.