Page 1 of 1

Explain values of ICU

Posted: Mon Feb 04, 2013 10:16 am
by ruslanpopov
Using PWM-ICU example for STM32F100 and Tectu's Servo Library, I create own test application:
https://github.com/RaD/armka_demos/blob ... ter/main.c

Then I have connected PWM output (PB9) with ICU input (PA0) with a wire.

Following values in disconnected state:

Code: Select all

Period: 708 Width: 676

Following values in connected state:

Code: Select all

Period: 1 Width: 1


Just don't understand how to use them. I think that Period has to be about 36000 and width about 12000.

How to check that PWM frequency is 36kHz?

Re: Explain values of ICU

Posted: Tue Feb 05, 2013 9:12 pm
by ruslanpopov
This question is important for me, answer please.

Re: Explain values of ICU

Posted: Tue Feb 05, 2013 9:53 pm
by Giovanni
I don't understand your question well.

If you connect a PWM output to an ICU input the ICU driver returns exactly the same values you put in the PWM driver. The PWM-ICU application demonstrates this.

I would check if your pins are:
1) Unconnected on your board.
2) Programmed using the correct alternate function number.

ruslanpopov wrote:How to check that PWM frequency is 36kHz?


Using a frequency meter or an oscilloscope.

Giovanni