Using the onboard timers BBB

I’m trying to figure out if it’s feasible to use the onboard timers on the BBB to launch an interrupt. I have a function that requires precise timing and I’d like to use an interrupt to do it. Of course to trigger the interrupt I’d need to use one of the timers on the processor. I need to know if this is possible and what I need to do in order to enable the timer and set it up for interrupt generation.

Any help that gets me going down the right path would be helpful. To start, I’d really just like to get a timer configured, but I don’t know if I need to enable drivers, create a device tree overlay, or anything. Thank you in advance.

UPDATE:

I think the drivers are loaded by the kernel, so I need to enable the timers with a device tree overlay. I’m trying to enable timer4 for my purpose and I’m trying to mimic one of the sample device tree overlays I see into my device tree overlay, but doing so causes the boot to fail :frowning:

Yes, the timer subsystems [4-7] can get used to generate an interupt. I’m not sure if this hardware feature is supported by the kernel.

You can use it in an easy manner by libpruio direct register access. Set up the IRQ configuration before creating the PruIo instance and make sure to set the related timer registers accordingly, before you call PruIo.config().

Regards