Olin, > This is exactly the kind of code where you don't want a compiler between you > and the machine. It may be fine to write the application in C on the RTOS, > but I certainly wouldn't want to see critical parts of the RTOS written in > anything but assembler. When you are writing an RTOS, you have to assume > that the task switching code is both speed and space critical. You also > have to perform some fancy stack diddling which would confuse most > compilers. Since you want a pre-emptive RTOS, a lot of the task switching > code will be in the interrupt routine. This is even more reason to write it > in assembler. I agree that I would be better to write the kernel with an assembler. But if I want to use C in my application code, I would at least need a compiler that states clearly how to mix assembly and C, how is the stack used etc. I have now ordered IAR's EWPIC18, hopefully it can do the job. > Are you really sure you need a pre-emptive RTOS? Is it really that hard to > break your tasks into "small" chunks of no-wait code? Pre-emptive can look > like the more elegant solution, but adds more overhead and trouble than you > may realize. The big gotcha is that any thread has to be prepared to be > swapped out at any time. This means you either need to disable task > swithing during critical parts or add interlocks around global state. Yes, I have tried a couple of different ways of doing a co-operative RTOS, but I ran into large problems in certain areas in my application. I have already ported my application to ATmega103 and written an RTOS to it. But, as mentioned earlier my superiors are not willing to change the type of the processor in our telephone, so I'll have to stick with 16C77 compatibles. > I've done a lot of embedded system designs (It's what I do for a living). > While I have used multiple tasks or pseudo-tasks (can't do real tasks on > PICs other than 18 family, for example) many times, I have never yet needed > to do pre-emptive task swithing on a small resource-limited system. Well... I don't know what kind of designs does the company you work for do. I can assure you that the pre-emptive RTOS is really necessary here. Most of our competitors use 16-bit or 32-bit processors in their products. We use PIC. (Not my fault, the decision was made before I was hired :) Regards, Kari Lehikko -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body