Hi all,
I have tested the DMTimer in the BeagleBone in free mode and compare mode (with direct access to the registers) and all was fine (counter was fine and interrupt was generated in compare mode).
However, I have been trying to make the DMTimer work in capture mode and I did not succeed at all. The dedicated input trigger seems not to work (no interrupt is raised, and no values are loaded into the TCAR registers). I have tried with TIMER4 (and TIMER7 later) pin in the BeagleBone.
What I need is saving the current timer value into the TCAR registers when a change/pulse in the timer dedicated input is detected.
This is my configuration:
Multiplex:
Configure dedicated pin as TIMER4 peripheral (Should not be required as this is the default configuration of BeagleBone)
Interrupts: (I suppose this should be fine, as interrupt triggers in compare mode)
Set register INTC_ILR92 to 0 (max priority)
Set bit 92%32 on INTC_MIR3 to 1 to enable interrupt
DMTimer module:
Disable timer: set TCLR to 0
Re-load 0 in overflow: set TLDR to 0
Clear initial count: set TCRR to 0
Enable interrupt: set TIMER_IRQ_CAPTURE to IRQENABLE_SET --> value = (1<<2)
Enable timer: set TIMER_START | TIMER_AUTORELOAD | TIMER_CAPTURE_RISING to TCLR --> value = 1 | (1<<1) | (1<<8)
Clear any pending associated interrupt.
As a fallback solution I am now reading the free running timer value from a GPIO interrupt handler that detects the change; however I would need the most accurate timer value possible.
Does anyone have an idea about what I am doing wrong?
Thanks in advance.