On Mon, 30 Mar 1998 11:45:43 -0800 Steven Kosmerchock writes: > Hello everybody, >I'm new to the world of PIC's.I was wondering if anybody have any >suggestions to > help me out. Here's my problem: I need a timer that once activated >will run 30 > minutes, after the 30 minutes is up a relay will be triggered. Any >code, > schematics, or advice would be greatly appreciated. I have the >ability to use > and program these PIC's: 12C509, 12C672, 16F84, 16C63, 14000. Since the project only has one output and maybe one input, an 8-pin PIC will be plenty. The 12C509 will do. If the time can doesn't have to be *exactly* 30 minutes, the 12C509's internal RC oscillator can be used. The maximum error inherent with it is about +- 5%, or +- 1.5 minutes over 30 minutes. If precise timing is needed, use an external crystal. Since high MIPS is actually a disadvantage in this application, use a 32.768 KHz crystal. Among the inexpensive standard crystals, they are more precise for better timekeeping. The PIC will also use very little supply current at this slow speed. The only reason not to use a 32 KHz crystal is if the power to the PIC will be cut off and the time has to start as soon as it is turned back on. These crystals can take a second or so to start running. The relay will likely need a transistor to drive it. A FET such as a 2N7000 can be connected directly to the PIC output with no resistor. As for the software, use a simple delay loop that increments or decrements RAM registers until the desired amount of time (number of instruction cycles) has elapsed. 30 minutes is 14,745,600 PIC instruction cycles at 32.768 KHz. So about 3 bytes (24 bits) of counters would be needed. _____________________________________________________________________ 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 Or call Juno at (800) 654-JUNO [654-5866]