interrupt handle

abuteir wrote on Sunday, June 27, 2010:

Interrupt-generated control signal of a servo-drive with a planned duration of 160 µsec.

The interrupt-generated pulse covers the range from 140 through 205.

This variance of 40% of Impulse period  of the signal is not under the operation of the drives be acceptable.

I would like to change in the kernel of FreeRTOS. What I should change or what function is responsible for the Impulse -signal?

Thank you very much.


richard_damon wrote on Sunday, June 27, 2010:

Not having the details of how you are making an “Interrupt-generated control signal” it is hard to tell what your problem is, and I suspect it really isn’t a problem in FreeRTOS, though it may be in how you are using it.

By design, FreeRTOS needs to disable at least certain interrupts for periods of time to create critical sections, so that it can update some data structures. If this is the cause of your problem, one solution would be to make sure the interrupt you are using in your pulse generation is one that is not disabled, which also means that interrupt can not call any FreeRTOS routines. (Not all ports support this though, it would be nice to know what processor you are using).

If you can not do this, you may need to set up your program so it doesn’t do anything needing longer critical sections (depending on the allowable variation), which will probably require it to be running a task that disables scheduling while you are timing the pulse.

I will note that using interrupts for precise timing control at this level is normally dangerous, and needs to be done only with a careful analysis of the processor and software being used, as there are a number of things that can cause increased interrupt latency. One of the cost of generic multi-tasking, is the need for critical section to protect shared control data, and this causes interrupt latency.

abuteir wrote on Wednesday, June 30, 2010:

thank you for your answer.

but in realty, i have checked my program, it working very will with use AVR ATMega323 but with using the ATMega128 it will not work well. for this  reason, should be changed in the Kernel of FreeRTOS .

but actually i can’t decide with which function should be start .