TC multi IT handlers

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

New in AVR32 world, I am playing with TC modules on an EVK1100 (UC3A0512).
Starting from TV example 3 (using the TC0 to create an interrupt each 100ms), i have done one library to manage time for LEDs.
Now, i started to create a second library with the use of TC1 (used to create a different time base). So i have done quite the same source code (changing only the TC_CHANNEL) and of course changing the IT handling to another functions :
INTC_register_interrupt(&timer_irq, AVR32_TC_IRQ1, AVR32_INTC_INT0);

The result is that my code is not working (It freeze the first timer and in standalone it doen't work (the handling is not done) ).
My question is : Is it possible to create two different handler functions for TC_IRQ0 and TC_IRQ1 ? Is somebody already perform a similar case ?

regards,
PE

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, it is possible to have two different handler functions. Are you calling INTC_register_interrupt twice and with two different handler functions (i.e. timer_irq0 and timer_irq1)? Are you sure you're acknowledging the interrupts by reading the sr of the appropriate TC in each of the handler functions?

Letting the smoke out since 1978

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for your answer. Yes i was calling the INTC_register_interrupt twice, but i was also calling the INTC_init_interrupts twice ... which was destroying my previoux configuration ...
Now it seems fixed.
Thanks for your answer.