Timer usage

Hi!

I’m looking for tutorials explaining how to configure/use BBB timers, but can’t find anything…

I would like to use a BBB to count pulses and make binning:

  • pulses width = 100ns
  • bins width = 10-100µs
  • total acquistion length = 250ms-5s

I guess it is possible to configure a timer in capture event mode, so it increases at each new pulse. Than, I would also need to configure an interrupt to transfert the counter (minus its previous value) at each end of bins, and store this value in memory.

Maybe it is possible to use DMA to automatically do the transfert every 10-100µs?

Any help welcome.

Thanks.

You can use the Pulse-Width Modulation Subsystem (PWMSS) for that, chapter 15 in datasheet od AM335x Sitara Processor
You can write / read registers using devmem2
Remember to enable L4 clock before

Thanks for your answer.

Is there any project I can have a look at to understand how things work?
I'm new to BBB/PRU, and I have to admit that it is not easy to use...

Maybe there are some libs/modules available?

Read inside the AM335x datasheet about eCAP module. It's basically copy-paste from TI DSP's, so you can find on web some examples about configuration of the registers for the DSP - you'll need only to change the memory offset.
1 - enable eCAP module (clock, etc) writing correct registers
2 - set the pin mux - you can use linux shell for that
3 - configure eCAP registers
T.

Ok! Didn't know about similarity with TI DSP's... That's usefull info ;o)

Thanks!