Problem using time in microseconds

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

Moderator: RoccoMarco

Post Reply
nikhil
Posts: 40
Joined: Thu Jan 03, 2013 8:46 pm

Problem using time in microseconds

Post by nikhil »

Hello,

I want to use chThdSleepMicrosecond function. I have set CH_FREQUENCY to 1000000. But code hangs when call above function. Same code works fine when I call chThdSleepMilliseconds. Am I missing something? I am using chibios 2.6.5 with stm32f4.


--
Nikhil
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Problem using time in microseconds

Post by Giovanni »

Hi,

There is a limit to the resolution you can get, the CPU is not able to serve 1000000 interrupts per second. See the GPT driver if you need higher resolutions. You may also use halPolledDelay().

Giovanni
Post Reply