Timer usage

112 views
Skip to first unread message

Frédéric

unread,
Jun 2, 2015, 4:24:38 AM6/2/15
to beagl...@googlegroups.com
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.

ciesla...@gmail.com

unread,
Jun 2, 2015, 5:46:54 AM6/2/15
to beagl...@googlegroups.com
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

Frédéric

unread,
Jun 2, 2015, 9:24:02 AM6/2/15
to beagl...@googlegroups.com
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?

--
Frédéric

Tomasz Cieśla

unread,
Jun 2, 2015, 9:37:45 AM6/2/15
to beagl...@googlegroups.com
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.

Frédéric

unread,
Jun 2, 2015, 9:47:56 AM6/2/15
to beagl...@googlegroups.com
Le 02/06/2015, Tomasz a écrit :

> 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

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

Thanks!

--
Frédéric
Reply all
Reply to author
Forward
0 new messages