# How to measure duty-cycle with Input Capture from STM32F103C8T6?

I'm trying to measure the duty-cycle of the 0-5V electrical PWM signal I have generated from the any source. How can I do this? Anyone can help me?

• IDE: Keil
• Microcontroller: STM32F103C8T6
• that information belongs in the question above .... use the edit button to add it, then delete the comment – jsotola Nov 3 '18 at 23:06

Don't forget to check the input pin in the pin definitions table of the Datasheet. If it's not marked as 5 Volt Tolerant (FT in the I/O Level column), then place a suitable voltage divider between the signal source and the input pin.