On Thu, 31 Dec 1998 18:08:30 +0100 Gianni writes: >Hi! >I have written a program for a PIC16F84 that emulate a motorized 2 cam >programmable daily timer. >I keep in PIC's eeprom the setpoint (20 max) in the following >24h BCD format 1)byte HH 2)byte mm 3)byte which bit I want to >set/reset . >Every minute I compare the actual time with the setpoint and if time >is >= >setpoint I copy the third byte in a buffer then repaet for next >setpoint. >At the end of eeprom , I copy the buffer to the out port . >This works properly only if setpoint (HH:mm) are in ascending order. It seems like it would work no matter what the order is, if you check all the setpoints every minute. The only conflict would be if two or more setpoints are telling the same output to go opposite ways the same minute. In that case, the last one in the table would dominate. >Unfortunately I have only 27 bytes of code free and 25 of ram. If I were writing this (in assembler), I can't imagine the time-keeping and setpoint-checking parts of the program needing more than 100 or so code locations. The rest of the space could be used by the likely much more complicated code to provide a user interface to set the setpoints. It may be time to review the situation and re-write your program entirely. Most of my projects go through at least one such total rewrite. ___________________________________________________________________ You don't need to buy Internet access to use free Internet e-mail. Get completely free e-mail from Juno at http://www.juno.com/getjuno.html or call Juno at (800) 654-JUNO [654-5866]