3

I want to call a function 64 times per second with a ARM processor which is running linux. (ex: Rasberry Pi or Freescale i.mx6).

Ideally, I don't want too much jitter. I want to perform a task periodically... (ie: scanning a device)

If possible, I would like a hardware interrupt called 64 times per second.

With "standard PC hardware (x86)", it was possible to use IRQ8 from the RTC (clock) to achieve that behavior.

What is the equivalent with ARM processor architecture?

Reference 1, See section "Old "RTC Class" Drivers"

Reference 2

JYelton
  • 32,302
  • 33
  • 134
  • 249
ssinfod
  • 133
  • 3

2 Answers2

2

I would think a Watchdog timer would work in this situation. When the timer reaches 0 or it overflows (it depends on if it counts down or up) the processor will trigger an interrupt. If you configure the timer properly it might be able to trigger at 64Hz but that depends on the pre- and postscalers. It looks like the ARM processor does have such capabilities.

  • I see that the i.mx 6 has a EPIT timer (Enhanced periodic interrupt timer). Would it be possible to use this timer from the linux OS ? How do I use such timer from linux ? (Is it a driver?) I'm coming from the microcontroller world and I am not sure how to perform this task in linux. Can you point me some documentation/book about timer and linux?. – ssinfod Aug 19 '14 at 19:33
1

You could always create a real-time thread (assuming your kernel has been compiled with realtime support), and have an infinite loop that uses nanosleep to get the desired 64Hz sample frequency.

How strict is your jitter requirement exactly?

fred basset
  • 1,647
  • 6
  • 23
  • 37