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.

How to handle multiple interrupts on tm4c ? Setting priorities to smoothly handle multiple interrupts is still unclear.

Other Parts Discussed in Thread: TM4C123GH6PM

I want to calculate rpm of four motors simultaneously. I connect each channel of four encoders to tm4c123gh6pm in edge time mode(timer capture).....so 4 interrupts for that and also four timer interrupts because in each interrupt I am using fifo to normalise some hundreds of samples of ticks to calculate rpm by timer capture. Am I following correct procedure? QEI has slower sampling frequency so I do not want to use it.

  • Hello Ishan,

    Interrupts is a method for peripheral or system events to capture CPU's attention. Now the CPU can execute one instruction at a time so in reality it is not possible for "simultaneous" code execution. Hence the first myth to break is that RPM of four motors can be calculated simultaneously.

    The next thing to understand is time slice of operation. If the motor RPM is computed every X ticks of CPU clock and it takes Y ticks of CPU clock to make the computation, then then at minimum 4 * Y = X. If the requirement is met then you are not overloading the CPU. The next myth to break is that due to other system activities and context switchover latency X must be sufficiently greater than 4 * Y. Hence you need to make an assessment.

    The last important thing to note in the post is use of QEI. Even if QEI is "slower sampling frequency" how much error does it introduce in you measurement and is it acceptable to your application. If not then please justify why it is not?

    Regards
    Amit
  • My application is much more advanced than you seem to imagine. QEI is least error-prone but I also want quickest response as I am using PID Control of 4 DC Motors. It is integrated with Raspberry Pi to keep the heading angle of a robot constant whilst traversing and further I have to do path and motion planning.
  • ISHAN PATEL said:
    My application is much more advanced than you seem to imagine.

    Ouch!

    Perhaps if you'd announce the extent of your application - provide (some) basic specifications - we'd not waste time (& have to resort to) imagination!

    As you've stated your desire to perform, "4 calculations simultaneously" - might (some) doubt creep in upon the claim of, "advanced?"

  • There is no advantage to controlling a system faster than it can respond. Faster is not necessarily better.

    Robert
  • Robert Adsett72 said:
    There is no advantage to controlling a system faster than it can respond.

    And...Activity is NO substitute for Achievement!

  • And it may just barely be possible our imaginations are being underestimated.

    Robert
  • I already mentioned my application is previous post cb1 & robert