> >I am new to the PIC world and am wondering if the 16C54 can handle time >delays >of 48 hours, 24 hours, 12 hours and 6 hours depending on contact closures >at >inputs, and then do something? > Of course it can. On a '54 you have no interrupts, so to get an idea of "real time" you have to watch the RTCC counter (8 bits) and detect that it has overflowed (or rolled round to zero again). The RTCC rollover is dependent on: 1 the crystal frequency (which is internally divided by 4) 2 the prescaler value (if used) 3 the initial value of the RTCC register Because you would normally run the PIC at a decent speed (for processing stuff quickly) it is likely that your RTCC rollover occurs 'very often', so to count 1 second you might have to count (say) 512 rollovers. Then for 48hrs you will have to count 172800 seconds. Alternatively count 3600 seconds for one hour and count that 48 times. (more than one way 2 skin a cat). If accuracy is important then you will need to use a crystal oscillator, and choose one with a frequency that divides down into time units you can deal with. If accuracy (and speed) is not important you can use an R/C oscillator which you can set to run at the most convenient frequency. See the Embedded Controller Handbook for an alarm clock program which measures real time based on RTCC overflows. Andy -- --------------------------------------------------------------------- Andrew M Errington Tel: +44 1524 593678 Microcomputer Consultant Fax: +44 1524 844011 Lancaster University a.errington@lancaster.ac.uk Lancaster LA1 4YW http://www.lancs.ac.uk/people/cpaame/cpaame.htm --------------------------------------------------------------------- >