On Apr 7, 1:28 pm, Joep Suijs <[email protected]> wrote: > Hi Mike, > > I assumed that you used the taks feature in JAL > (http://www.casadeyork.com/jalv2/jalv2/c689.html) > Is this the case or did you created 'tasks' like non-blocking > functions, called at regular intervals? This is in general the way I > build my apps... > > Joep All the procedures called in the main loop are designed to be non- blocking.
The JAL Start Task and Suspend don't work on 18F (confirmed by Kyle) and are pretty useless anyway without signals or ability to have "suspend" in a procedure/function call. It's no reflection on Kyle. I'm pretty convinced the 8bit PIC especially the the 10, 12, 16 is useless Hardware for that kind of traditional co-operative Multi- tasking kernel design. I looked at "task" and "suspend" and looked at RTOS. Considered my past experience of Z80, PIC bit, 8051, 78HC11, occam, Modula-2, Forth, my Lego RCX 1.x script language and small Real Time OSes and decided a "ready to go" set of libraries or Scheduler/Kernel/OS or whatever makes no sense for 8 bit PIC, esp, less than 18F. I decided a set of procedures/rules and principles to follow for Real Time Multitasking on 8 bit PIC (10, 12, 16 and 18F series) is the only sane way to go. I will codify these better and have more code examples and compatible libraries. 1) Have a single high resolution timer Interrupt with software counters to poll/semaphore stuff. 2) Use Interrupt driven shared buffers (pipe) either using built in HW (HW serial) or polled by the RTC ISR in (1). Use these for anything that would otherwise block on I/O (I2C, serial, EEPROM write cycle or whatever). 3) Use low level functions that internally use a queue/semaphore to decide on if output can be done, input can be done, delay complete and have these pass out parameters and return True only if all operations are complete. This is called repeatedly in a loop (loop can itself only run when RTC ISR sets semaphore). 4) Highest level procedures run in loop and skip if a semaphore signal not set. 5) Don't use boolean flags/semaphore/signals. Use Bytes that are incremented by one process (i.e. RTC or other interrupt) and decremented by controlled Process (high level Procedure if it's > 0. otherwise skip). I've also programmed ARM, MIPS and x86. Usually it makes sense on those to have a small OS kernel. Standard Linux and NT are not "Real Time" suitable though. -- You received this message because you are subscribed to the Google Groups "jallib" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jallib?hl=en.
