Artikkelissa I have a small application in mind, and would like some input > from the group as to the best way to go. This would be a very > simple, and simple to program, Programmable Logic Controller. I --- > Each PLC would accept a limited number of inputs and drive a > few optically-isolated outputs. In the past, I've used a > central PC as a controller, with a PLC scripting language > I developed to run it. The need for expansion and desire to make > the units available to other users has prompted me to try > something like this. I have a kind of solution to this. Maybe not good enough. Maybe too good. (For less in/out, use PLC.INC. Ask Antti at SiStudio about it) I've made a PLC out of 16F84, 4015, 2x 4014 and 2x 4094. And 4x20 lcd to monitor IO. 16 ins, 16 outs, cmos level. Optos and relays coming. Reads compiled ladder based on PLC.INC (macros). VERY prototype :) Chips cost ~60 FIM (US$ 10-12), and really FUN making it :) Core (kernel? bios?) takes 336 words, so plenty of memory left (for 100 or so commands) . Some day, when I have money & time, I'll go for C73 with interpreter and loader in PIC, ext. seeproms for program. Code looks like this: include "plc1.inc" ;main stuff: 'kernel', macros ld P01,0 ;P0x input and TMR1,7 ;internal clocks push ;push is used for branches ld P01,1 and TMR2,0 push ld P01,2 and TMR2,1 or_b ;or branches or_b ld P00,3 s P10,2 ;set and reset s P10,3 ;P1x output s P10,4 s P10,5 s P10,6 ld P00,4 r P10,2 r P10,3 r P10,4 r P10,5 r P10,6 ld TMR2,3 tmr 0,5,P00,0 ;8 timers ld Tmr,0 out P10,1 ld_i P00,0 out M0,1 ld TMR2,3 tmr 1,5,M0,1 ld Tmr,1 out P10,0 ld P00,7 ctr 0,0x0a,P00,6 ;and 8 counters ld Ctr,0 out P10,7 endp It's then compiled with mpasm and programmed into PIC. Runs fine. You don't have to understand asm a bit, but you can mix asm in the code. If you need more information on this, ask. No nothing found in public places (yet), but I can hack you rude schematics. Code is simply asm, 23k (-> nobody want's it on list) Kimmo 'When I was young, this was pasture.' 'But it IS pasture.' 'Well, it was BETTER pasture.' - Terry P.