Hello Timothy & PIC.ers, As has been pointed out by a few others, do some research on state-machines. I had only a vague idea of the concept when I started using PICs, and somehow (eesshh.. brain-burning stuff) produced my original products without them. The project definitions would not differ vastly from your own. One day, browsing through the p*clist, I came across Andy Kunz's treatise on his use of the things. He gave us some very tightly written asm code, which I scratched my hair out trying to follow, but the concept was very clear :-- LOOP_1 looping in a known state, give it a number (eg. 0-100). | \/ monitor all possible trigger conditions which could kick the program to another state. | \/ on recognition of any such trigger (stimulus) call a transition subroutine, followed by a destination state. The transition subroutine *and* destination state are both optional, the destination state can even be the original one. | \/ no stimuli? >> goto LOOP_1 The whole shebang gets formalised in a neat table, I've been adapting the technique for +/- 4 years now & can't consider using any other way of writing code for target apps. with multiple stable states. I'll send you more info, off-list if you want. ..mmm... If Andy's around maybe he could comment & give us the latest skinny on these.. best regards, John >Date: Tue, 18 Feb 2003 12:06:33 -0000 >From: Timothy Box >Subject: [PIC]: Programming logic solving > >Hi all > >Being a self taught programmer I often waste a lot of time converting "I >WANT TO DO XXXX" into code. Do our learned gentlemen have any pointers to >how they would tackle the task or perhaps a good site. > >I know it all depends on exactly wha .. eMail from the desk of John Sanderson. JS Controls, PO Box 1887, Boksburg 1460, Rep. of S. Africa. Tel / Voice / Fax : 011 893 4154 email : jsand @pixie.co.za Cell : 082 741 6275 Manufacturer & Purveyor of laboratory force testing apparatus and related products & services. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu