This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Timer interrupt

hello everyone, is there anybody know how to set timer interrupt with ST10 269

The problem is that: the Tempo of sending data from the my ST10 269 to DAC is not the same everytime, it changes between 10us and 12us, because in my program there are so many jumps for several conditions.

Now I want the tempo of sending of the data everytime the same. for this I want to use the timer. Everytime by starting a new step the timer will start, the algorithm runs the same time ,and wait after computation till the timer finish timing to 20us. then send the signal to DAC, and the second step will follow,as well the time will be reset,and start again.

How can this with C realize.

thanks in advance

Parents
  • Yes, but you didn't say which timer? Secondly, the repeatability would depend on what the core is doing at the time of the occurrence along with the interrupt level. You will ALWAYS have some amount of jitter when using software to make an update, it only a matter of how much you can minimize by your actions (control of the core).

    So you would have an interrupt that will calculate the new set point and another interrupt that is synchronized to an event (or periodic). The easiest way would be to use a PEC channel to make your move as this is simply a MOV instruction injected into the pipeline of the cpu. If this not good enough then perhaps you need another interrupt to put the cpu into an idle state before the actual event will occur (also assuming that no other interrupts would also be allowed) so when the periodic interrupt does occur you should get the most repeatable update.

Reply
  • Yes, but you didn't say which timer? Secondly, the repeatability would depend on what the core is doing at the time of the occurrence along with the interrupt level. You will ALWAYS have some amount of jitter when using software to make an update, it only a matter of how much you can minimize by your actions (control of the core).

    So you would have an interrupt that will calculate the new set point and another interrupt that is synchronized to an event (or periodic). The easiest way would be to use a PEC channel to make your move as this is simply a MOV instruction injected into the pipeline of the cpu. If this not good enough then perhaps you need another interrupt to put the cpu into an idle state before the actual event will occur (also assuming that no other interrupts would also be allowed) so when the periodic interrupt does occur you should get the most repeatable update.

Children