Author Topic: PIC microcontroller  (Read 14465 times)

0 Members and 1 Guest are viewing this topic.

Offline scrat

  • Frequent Contributor
  • **
  • Posts: 608
  • Country: it
Re: PIC microcontroller
« Reply #25 on: December 11, 2010, 07:00:43 pm »
@Hypernova:
In interrupt routines, even if they take some time to execute, time distance between successive executions remains the same, provided that you don't use jumps to different length code branches. This is especially important for control purposes, where different sampling/refresh periods can be an issue.
The LENGTH of time the interrupt takes is also crucial. If it takes 10ms to service your ISR and the interrupt interval is 8ms then you either REstart your Interrupt (endless loop) or more likley IGnore the interrupt until the 1st one finishes, time till next interrupt is then twice the 8ms expected

I was assuming one would not demand a processor to do in 8ms a 10ms task, of course. Although sometimes it is quite difficult to say how much a particular process will take to execute, while the timing constraint may be already known.

If it's too much work load you should package the work and throw it to a lower level and reduce you loop speed to longer than 10ms, so you don't hog the cpu. Otherwise you need to find a time machine.  ;)

A time machine! I wander why I've never thought to use one! :D
One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. - Elbert Hubbard
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf