2009-07-16 07:47:09     own timer in BF537

Document created by Aaronwu Employee on Aug 16, 2013
Version 1Show Document
  • View in full screen mode

2009-07-16 07:47:09     own timer in BF537

Adam W (POLAND)

Message: 77452   

 

Can I use any of BF537 timers for my own ?

 

I want to count time  (about 50ms gradient) to do some special LED flashing. Maybe is it possible to read one of system Linux counters ? Any sugestions ?

 

thanks

 

Adam

QuoteReplyEditDelete

 

 

2009-07-16 12:03:17     Re: own timer in BF537

Matthew Barousse (UNITED STATES)

Message: 77464   

 

I'm working on something very similar. Give this page a good read:   docs.blackfin.uclinux.org/doku.php?id=linux-kernel:timers

 

There's a sample kernel module that will do exactly what you need it to. It's in /user/blkfin-test/timer_test. You can even convert from miliseconds to jiffys. I don't know how you would blink LEDs using that, though. That's where I'm currenty stuck - linking userspace code to a kernel module.

QuoteReplyEditDelete

 

 

2009-07-16 14:20:40     Re: own timer in BF537

Mike Frysinger (UNITED STATES)

Message: 77477   

 

use the gptimers framework:

  docs.blackfin.uclinux.org/doku.php?id=gptimers

QuoteReplyEditDelete

 

 

2009-07-22 06:06:47     Re: own timer in BF537

Adam W (POLAND)

Message: 77860   

 

well, writing device driver is not a piece of cake

 

I have read about jiffies, but it is accesble only from kernel space. Isnt it easiest way to write device driver (or something like this) that only returns jiffies value? And of course how can do that ?

QuoteReplyEditDelete

 

 

2009-07-22 06:40:15     Re: own timer in BF537

Mike Frysinger (UNITED STATES)

Message: 77861   

 

jiffies is not (easily) available to userspace.  if you want to simply implement a busy loop, then use the cycles register and CCLK.

 

QuoteReplyEditDelete

 

 

2009-07-22 09:59:03     Re: own timer in BF537

Robin Getz (UNITED STATES)

Message: 77874   

 

Adam:

 

How precise does it need to be?

 

You should be able to use a 1ms kernel timer tick, and get pretty close (but it will never be exact).

 

-Robin

Attachments

    Outcomes