This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

getting interrupt from timer 7 on capture with beaglebone

Hi

 

I'm trying to get interrupt from timer 7 on capture using device driver I wrote on linux Angstrom (kernel 3.2.34) with beaglebone.

I'm working on it for quite a while with no progress, I can get interrupt for match and overflow events but not for capture.

I also succeed to transmit output from this pin using timer (measured using scope and all seems to be nice).

 

The input is from GPIO1_28,  the mux for the timer pin is done with:

echo 12 > /sys/kernel/debug/omap_mux/gpmc_wen  : MODE 2 and RXACTIVE on, Pulldown, and Pullup/pulldown enabled.

 

My code is basically does  this:

omap_timer = omap_dm_timer_request_specific(id);

/*config timer to use sysclk using dirrect write to reg */

request_irq(irq_num, irq_handler, 0, "nice_name", timer);

omap_dm_timer_set_int_enable(omap_timer,  OMAP_TIMER_INT_CAPTURE);

omap_dm_timer_set_capture(omap_timer, 1, 0, 0); // also tried with omap_dm_timer_set_capture(omap_timer, 1, 0, 1)

omap_dm_timer_enable(omap_timer);

/* also tried to put here

                write 0 to TRR and

                omap_dm_timer_start(omap_timer);

*/

my questions:

1. Does my code should work or am I missing something? Should I start the timer before trying to capture?

2. can someone give me a Linux example code (user space io kernel space)? That will boost my work.

3. Should I do something so the pin will be input?  If I understand right from the reference manual , porgpocfg  should not be set and I will have input, BUT to do output I also didn't set it and it worked (!?).  To be more clear, I didn't change anything on muxing nor porgpocfg  from the way I did output from this timer, I assume I should change something.

4. The input from GPIO should work?

 

Here is how i doing output from the GPIO pin:

echo 60 > /sys/class/gpio/export

echo low > /sys/class/gpio/gpio60/direction

echo 0 > /sys/class/gpio/gpio60/value

echo 1 > /sys/class/gpio/gpio60/value

 

Thanks in advance.