LDmicro0.1 MICRO=Microchip PIC16F877 40-PDIP CYCLE=10000 CRYSTAL=20000000 BAUD=9600 COMPILED=C:\Documents and Settings\labozidar\My Documents\LD micro\Lcd.hex IO LIST Xreset at 0 Xrun at 0 Xset at 0 Xslowdn at 0 Xslowup at 0 Ydone at 0 END PROGRAM RUNG COMMENT countdown timer by MGP 3/9/2014 END RUNG COMMENT -- R1 = 0.1sec countdown, R2 fastcounter used when setting time, change times if wanted\r\n-- All contacts (inputs) are pushbuttons END RUNG CONTACTS R1 1 TON T1 50000 TOF T2 50000 COIL R1 0 0 0 END RUNG CONTACTS R2 1 TON T3 30000 TOF T4 30000 COIL R2 0 0 0 END RUNG CONTACTS Xset 0 LEQ time 998 PARALLEL SERIES CONTACTS Xslowup 0 PARALLEL SERIES OSR ADD time time 1 END SERIES TON T5 1000000 COIL Rfastcnt 0 0 0 END END END SERIES CONTACTS Rfastcnt 0 CONTACTS R2 0 OSR ADD time time 1 END END END RUNG CONTACTS Xset 0 GEQ time 1 PARALLEL SERIES CONTACTS Xslowdn 0 PARALLEL SERIES OSR SUB time time 1 END SERIES TON T6 1000000 COIL Rfastcnt2 0 0 0 END END END SERIES CONTACTS Rfastcnt2 0 CONTACTS R2 0 OSR SUB time time 1 END END END RUNG COMMENT -- store value of time in eeprom (memo) after set END RUNG CONTACTS Xset 0 OSF MOVE memo time END RUNG PERSIST memo END RUNG OSR MOVE time memo END RUNG CONTACTS Xrun 0 OSR COIL Rrun 0 1 0 END RUNG CONTACTS Xreset 0 PARALLEL MOVE time memo COIL Rrun 0 0 1 END END RUNG COMMENT -- Countdown ----------------------- END RUNG CONTACTS Rrun 0 PARALLEL SERIES GEQ time 1 CONTACTS R1 0 OSR SUB time time 1 END SERIES EQU time 0 COIL Ydone 0 0 0 END END END RUNG COMMENT ---------------------------------------------- END RUNG COMMENT -- display routine--- END RUNG CONTACTS R1 0 CTC Crefresh 3 END RUNG DIV lcd time 10 END RUNG MUL lcd2 lcd 10 END RUNG SUB lcd3 time lcd2 END RUNG EQU Crefresh 0 FORMATTED_STRING lcd 9 116 105 109 101 58 32 92 50 46 OSF FORMATTED_STRING lcd3 6 92 49 92 114 92 110 END