Hi! Seyler Jean-Yves wrote: > > hello Nuno (or Nu–o ?), That's Nuno, without ~. I'm from Portugal, not Spain. > > All timers are maintained by an Interrupt timer. > > > Do you mean you must wait for a timer induced interruption to increment your > several auxilliary timers ? > Remember I must use a 12C509 without an interrupt :-( > Somebody told me I could use a watchdog wakeup ? (but the timing would be : > 1st not accurate, 2nd too long) > -> any other idea ? Well, the interrupt based timers, guarantee that time is always correct. In my case, I use the 16f84 on 8.192MHz. I increment timers with 125us resolution. Without interrupts, things get a little more difficult. To keep accurate timing, you would need isochronous tasks. This means that you need to know how much time each task takes, and keep timing based on this. > By "semaphore", I think you mean 1-bit-"flag" at H or L level ? Yep. Flag 1, resource busy. Flag 0, resource free. > > > That was also my way of thinking : no need to use stacks ! Stacks are still a good option with more complex routines. But not on a 12C509. It would be overkill. > > Typical cycles are not closed, but can be. It all depends on the timing > > constraints (maximum atomic execution time for each task.). > > > What do you mean by "cycles are not closed" ? To me, a closed cycle means that the full cycle is executed without interruption. Suppose you need to write 10 chars to an LCD: you can send them all at once, or you can send one, task switch, send another, switch, and so on. The first approach will be a bit easier to code. The second allows other task to do small jobs in between. If you choose to take my approach, try to keep tasks as simple and as short as possible. The less time they take to execute, the more you will approach to a multi-tasking environment. 8) Bye, Nuno. > Thanks for any additional idea ;-) > > Jean-Yves -- ---- ~~~~~~~ ------- Nuno Filipe Freitas Pedrosa -- ~~~~ ~~ ----- SIEMENS S.A. Portugal TEL: +351 1 4242454 - ~~~~ ~~ ---- mailto:Nuno.Pedrosa@icn.siemens.de - ~~~~ ~~ ---- "MSWindows - Best run on a SlideShow" =======================================================================