;********************************************************* ;* PIC 12F675 three second On Delay timer ;********************************************************* ;*********************************************************************************************************** ; This is for delaying application of the full filament voltage on a linear amp * ;*********************************************************************************************************** ;******************************************************************************************************************** ; An internal oscillator is used. GP0 is the output (Pin 7) There is a connection to a 1 Kohm to a LED to ground ; and to the base of the 2N3904. The emitter is grounded and the collector is connected to one end of ; the reed realy and the other end is connected to 12 volts (a 5 volt relay would only require a single supply). ; There is a 1N914 connected across the relay coil --cathode goes to the supply and the anode to the collector. ; The LED gives a visual indication of a time out. Not elegant but it works! ;********************************************************************************************************************* List p=12f675 Include "p12f675.inc" __CONFIG 0X3F94 ;Internal oscillator no clock out COUNT1 EQU 0x20 COUNT2 EQU 0x21 COUNT3 EQU 0x22 ORG 0x000 ;Start program memory location GOTO MAIN ORG 0x004 ;Reset Vector GOTO MAIN ;*******************************3 Seconds************************************************************************* SEC MOVLW 0x78 ; Basic 3 second timer MOVWF COUNT1 L1 MOVLW 0x78 MOVWF COUNT2 L2 MOVLW 0x45 MOVWF COUNT3 L3 DECFSZ COUNT3,1 GOTO L3 DECFSZ COUNT2,1 GOTO L2 DECFSZ COUNT1,1 GOTO L1 MOVLW 0x01 MOVWF COUNT1 LP98 DECFSZ COUNT1,1 GOTO LP98 NOP NOP NOP NOP RETLW 0 ;*************************************************************************************************** MAIN CALL 0x3FF ; Call up internal calibration BSF STATUS,RP0 ; hange to Bank 1 MOVWF OSCCAL ; set up for RC oscillator CLRF GPIO ; Initiate GPIO MOVLW 001h ; Set GPIO <0> to Digital I/O others not used MOVWF CMCON ; Turn Off Comparator CLRF ANSEL ; Turn off Analog Select MOVWF TRISIO ; GP <0> is the output GP0 = Pin #7 BCF STATUS,RP0 ; Change back to Bank 0 BCF GPIO,GP0 ; Clears the output so no output at turn on ;*************************************************************************************** BSF GPIO,GP0 CALL SEC BCF GPIO,GP0 LOOP1 CALL SEC ;Keeps the timer "on" until the next power cycle GOTO LOOP1 SLEEP ;***************Actual time 3.04 Seconds--Close enough***************** End