2009-05-30 12:36:10 How to make a high precision timer in linux
yacobi chen (CHINA)
Message: 74821
I want to get a 10kHz PWM in one of BF527 GPIOs.
All the 8 timers in BF527 are configured to other usage. So I have to use the general timer supported by linux kernel.
The timer precision is decided by system tick, which is up to 1/1000 second.
So, how can I get a high precision timer? I don't want to change the parameter HZ in system.
QuoteReplyEditDelete
2009-05-30 13:02:27 Re: How to make a high precision timer in linux
Robin Getz (UNITED STATES)
Message: 74822
Yacobi:
I'm not sure it is practical - is 10kHz the slowest thing you are using all the timers for?
-Robin
QuoteReplyEditDelete
2009-05-30 23:44:17 Re: How to make a high precision timer in linux
yacobi chen (CHINA)
Message: 74829
Thank you Robin.
The requisite frequence can be reduced to 500Hz. So kernel timer can fit this work, I think.
By the way, It is no way to get a high precision timer without the 8 timers supported by BF527. Is that right?
QuoteReplyEditDelete
2009-05-31 02:31:10 Re: How to make a high precision timer in linux
Sonic Zhang (CHINA)
Message: 74831
Yes, unless you adapt an external timer device to the system bus or GPIO.
QuoteReplyEditDelete
2009-05-31 04:26:37 Re: How to make a high precision timer in linux
yacobi chen (CHINA)
Message: 74873
I am wondering about the timers in blackfin(BF527).
If I configure a GPIO to other usages rather than timer, can I use the corresponding timer to count ticks?
For example, I configure PG11 to HOST_WR, can I use timer7 to count?
QuoteReplyEditDelete
2009-05-31 07:38:43 Re: How to make a high precision timer in linux
Robin Getz (UNITED STATES)
Message: 74875
Yacobi:
Yes - but you will need to write a custom GPIO handler - if you want to use the existing things - the lactency of the entire system would make it too slow.
-Robin