Explain values of ICU

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
ruslanpopov
Posts: 35
Joined: Sun Aug 19, 2012 9:36 pm

Explain values of ICU

Post 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?
ruslanpopov
Posts: 35
Joined: Sun Aug 19, 2012 9:36 pm

Re: Explain values of ICU

Post by ruslanpopov »

This question is important for me, answer please.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Explain values of ICU

Post 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
Post Reply