wouter van ooijen & floortje hanneman wrote: > With only one interrupt, how do you handle a combination of tasks, for > instance > - task at 100 kHz taking 5 uS (uses 50%, 50% left over) > - task at 1kHz taking 100 uS (uses 10%, 40% left over) > This is the same problem that makes it hard to make arbitrary > combinations > of Ubicom/Scenix virtual peripherals. There is no problem at all with the scenario you describe. As long as the 100us task can accept a latency of 5us+overhead. The timer will run (preferrably) at the highest possible speed, or at least 100kHz and the 100kHz task will be interruptible. The problems begin when latency is not acceptable or when repeatable timing is required (temporal determinism) afaik. Thus running an I2C peripheral and a RS232 receiver in parallel begins to be interesting. One conceptual solution for small systems is to make sure that there is only one critically timed task running at any given time (I2C peripheral does not function at the same time the RS232 receiver does f.ex.). This requires some clever thinking beforehead that has nothing to do with coding. However, it works. It is also possible to interleave tasks by hand using a script and markup in the source. I have done this, it is not fun, but it works. Peter -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body