3
\$\begingroup\$

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

\$\endgroup\$
1
  • \$\begingroup\$ Linux used to have a system level "tick" @ 10 ms which was changable to 1 ms. research in this area. \$\endgroup\$ Commented May 29, 2014 at 17:12

2 Answers 2

2
\$\begingroup\$

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.

\$\endgroup\$
1
  • \$\begingroup\$ 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?. \$\endgroup\$
    – ssinfod
    Commented Aug 19, 2014 at 19:33
1
\$\begingroup\$

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?

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.