Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Teensy 4 PIT timers and interrupt requests

  1. #1

    Teensy 4 PIT timers and interrupt requests

    Hi

    I was thinking about PIT timers and attaching and prioritising IRQ's (as you do).

    For example:

    Code:
    attachInterruptVector(IRQ_PIT, example_ISR); 
    NVIC_ENABLE_IRQ(IRQ_PIT);               
    NVIC_SET_PRIORITY(IRQ_PIT, 0);
    I would like to use the PIT timers to trigger several interrupts, but IRQ_PIT has only 1 entry in IMXRT.h.

    Does that mean only 1 interrupt can be requested? Is it possible to make several, different interrupt requests? And then set different priorities and time intervals for each one?

    Thanks

  2. #2
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,531
    you'll need to check some status flags in the ISR to see which PIT timer fired, see
    https://forum.pjrc.com/threads/54711...l=1#post195605

  3. #3
    Thank you for the reply and link.

    Is it possible to have multiple interrupt requests, e.g. IRQ_PIT[1], IRQ_PIT[2], etc, which can have different priorities?

  4. #4
    Quote Originally Posted by xenington View Post
    Thank you for the reply and link.

    Is it possible to have multiple interrupt requests, e.g. IRQ_PIT[1], IRQ_PIT[2], etc, which can have different priorities?
    Have you tried TeensyTimerTool Library:- https://github.com/luni64/TeensyTimerTool ?
    Here is Thread on this forum:- https://forum.pjrc.com/threads/59112-TeensyTimerTool

  5. #5

    Problem solved

    @HallMark

    Yes, I have thanks. the TeensyTimerTools clashed with the flexPWM timer I was using to measure input frequencies. I found a way round it though with FreqMeasureMulti_X:

    https://forum.pjrc.com/threads/59844...l=1#post235397

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •